Class: Monoz::Configuration
- Inherits:
-
Object
- Object
- Monoz::Configuration
- Defined in:
- lib/monoz/configuration.rb
Instance Attribute Summary collapse
-
#config_file_path ⇒ Object
readonly
Returns the value of attribute config_file_path.
Class Method Summary collapse
Instance Method Summary collapse
- #contents ⇒ Object
-
#initialize(project_path) ⇒ Configuration
constructor
A new instance of Configuration.
- #root_path ⇒ Object
Constructor Details
#initialize(project_path) ⇒ Configuration
Returns a new instance of Configuration.
11 12 13 14 15 |
# File 'lib/monoz/configuration.rb', line 11 def initialize(project_path) @config_file_path = find_config_file(project_path) raise Monoz::Errors::ConfigurationNotFound.new("Configuration not found at: #{project_path}") unless @config_file_path @contents = load_config(@config_file_path) || {} end |
Instance Attribute Details
#config_file_path ⇒ Object (readonly)
Returns the value of attribute config_file_path.
8 9 10 |
# File 'lib/monoz/configuration.rb', line 8 def config_file_path @config_file_path end |
Class Method Details
.default_config ⇒ Object
26 27 28 |
# File 'lib/monoz/configuration.rb', line 26 def default_config { "folders" => ["apps", "gems"] } end |
Instance Method Details
#contents ⇒ Object
17 18 19 |
# File 'lib/monoz/configuration.rb', line 17 def contents @contents ||= load_config(@config_file_path) if @config_file_path end |
#root_path ⇒ Object
21 22 23 |
# File 'lib/monoz/configuration.rb', line 21 def root_path File.dirname @config_file_path end |