Class: Lambit::Common::Config
- Inherits:
-
Object
- Object
- Lambit::Common::Config
- Includes:
- Singleton
- Defined in:
- lib/lambit/common/config.rb
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
-
#global_options ⇒ Object
readonly
Returns the value of attribute global_options.
Instance Method Summary collapse
Instance Attribute Details
#config ⇒ Object (readonly)
Returns the value of attribute config.
12 13 14 |
# File 'lib/lambit/common/config.rb', line 12 def config @config end |
#global_options ⇒ Object (readonly)
Returns the value of attribute global_options.
11 12 13 |
# File 'lib/lambit/common/config.rb', line 11 def @global_options end |
Instance Method Details
#init_config(options) ⇒ Object
14 15 16 17 18 19 20 21 22 |
# File 'lib/lambit/common/config.rb', line 14 def init_config() @global_options = project_path = ['project-path'] config_filename = ['config-filename'] || 'lambit.yml' config_path = ::File.join(project_path, config_filename) exit_now!("#{config_filename} file not found!") unless File.exist?(config_path) @config = YAML.load_file(config_path) end |