Module: Mech::Configurator

Included in:
Mech, Mech::Compiler::Format, Producer
Defined in:
lib/mech/configurator.rb

Instance Method Summary collapse

Instance Method Details

#configObject



9
10
11
12
13
14
15
16
17
18
19
# File 'lib/mech/configurator.rb', line 9

def config
  unless @config
    if init
      @config ||= Mech::Config.instance
    else
      raise 'Not load config file'
    end
  end

  @config
end

#init(path = nil) ⇒ Object



3
4
5
6
7
# File 'lib/mech/configurator.rb', line 3

def init(path = nil)
  require path || File.join(File.dirname(__FILE__), '..', 'conf')
  @config ||= Mech::Config.instance
  self
end