Module: HostConfig

Defined in:
lib/host_config.rb

Defined Under Namespace

Classes: MissingConfigFile

Constant Summary collapse

VERSION =
"0.0.3"

Class Method Summary collapse

Class Method Details

.init!(opts = {}) ⇒ Object



11
12
13
14
15
16
17
18
19
# File 'lib/host_config.rb', line 11

def init!( opts={} )
  @base_path = opts[:base_path] || Rails.root
  @logger = opts[:logger] || Rails.logger
  @hostname = opts[:hostname] || Socket.gethostname.split('.').shift
  @config = {}
  @config[:hostname] = opts[:hostname]
  @logger.debug "Loading host config #{@hostname}"
  process( load_config( @hostname ) )
end