Class: Bonchi::Config
- Inherits:
-
Object
- Object
- Bonchi::Config
- Defined in:
- lib/bonchi/config.rb
Instance Attribute Summary collapse
-
#copy ⇒ Object
readonly
Returns the value of attribute copy.
-
#ports ⇒ Object
readonly
Returns the value of attribute ports.
-
#pre_setup ⇒ Object
readonly
Returns the value of attribute pre_setup.
-
#setup ⇒ Object
readonly
Returns the value of attribute setup.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(path) ⇒ Config
constructor
A new instance of Config.
Constructor Details
#initialize(path) ⇒ Config
Returns a new instance of Config.
7 8 9 10 11 12 13 |
# File 'lib/bonchi/config.rb', line 7 def initialize(path) data = YAML.load_file(path) @copy = Array(data["copy"]) @ports = Array(data["ports"]) @pre_setup = Array(data["pre_setup"]) @setup = data["setup"] || "bin/setup" end |
Instance Attribute Details
#copy ⇒ Object (readonly)
Returns the value of attribute copy.
5 6 7 |
# File 'lib/bonchi/config.rb', line 5 def copy @copy end |
#ports ⇒ Object (readonly)
Returns the value of attribute ports.
5 6 7 |
# File 'lib/bonchi/config.rb', line 5 def ports @ports end |
#pre_setup ⇒ Object (readonly)
Returns the value of attribute pre_setup.
5 6 7 |
# File 'lib/bonchi/config.rb', line 5 def pre_setup @pre_setup end |
#setup ⇒ Object (readonly)
Returns the value of attribute setup.
5 6 7 |
# File 'lib/bonchi/config.rb', line 5 def setup @setup end |
Class Method Details
.from_main_worktree ⇒ Object
15 16 17 18 19 20 21 |
# File 'lib/bonchi/config.rb', line 15 def self.from_main_worktree main = Git.main_worktree path = File.join(main, ".worktree.yml") return nil unless File.exist?(path) new(path) end |