Method: Wrake::Configuration#from_file
- Defined in:
- lib/wrake/configuration.rb
#from_file(file, env = nil) ⇒ Object
5 6 7 8 9 10 11 12 |
# File 'lib/wrake/configuration.rb', line 5 def from_file(file, env = nil) env ||= defined?(Rails) ? Rails.env : 'production' config = YAML::load(File.open(file))[env] config.each do |key, value| send("#{key}=", value) end end |