Method: Pedia::Config#initialize

Defined in:
lib/wp/config.rb

#initialize(filename = "config.yml") ⇒ Config

Methods ###########################################################



54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# File 'lib/wp/config.rb', line 54

def initialize(filename="config.yml")
  Dir.mkdir CONFIG_DIR unless File.exists? CONFIG_DIR

  unless File.exists? CONFIG_FILE

  end

  yaml = YAML.load open(CONFIG_FILE)

  @options = {}

  yaml.each do |key, val|
    p [key, val]
    if opt = @@spec[key]
      @options[key] = opt.with(value: val)
    end
  end
end