class Cfg

Public Class Methods

cfg() click to toggle source
# File lib/utils/cfg.rb, line 11
def cfg
  @cfg ||= Cfg.load
end
load() click to toggle source
# File lib/utils/cfg.rb, line 15
def load
  cfg =  File.expand_path($options[:config])
  env = $options[:env]
  hash = YAML.load(File.open(cfg))[env]
  hash.each do |k,v|
    hash[k] = v.to_i if v =~ /^\d+$/
  end
  obj = OpenStruct.new hash
  obj.new_nginx_conf = "#{obj.nginx_conf}.new"

  @cfg = obj
end
method_missing(method_sym, *arguments, &block) click to toggle source
# File lib/utils/cfg.rb, line 7
def method_missing(method_sym, *arguments, &block)
  cfg.send(method_sym, *arguments, &block)
end