Class: Lambit::Common::Config

Inherits:
Object
  • Object
show all
Includes:
Singleton
Defined in:
lib/lambit/common/config.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#configObject (readonly)

Returns the value of attribute config.



12
13
14
# File 'lib/lambit/common/config.rb', line 12

def config
  @config
end

#global_optionsObject (readonly)

Returns the value of attribute global_options.



11
12
13
# File 'lib/lambit/common/config.rb', line 11

def global_options
  @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(options)
  @global_options = options
  project_path    = options['project-path']
  config_filename = options['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