Mercurial > hg > soundsoftware-site
comparison lib/redmine/.svn/text-base/configuration.rb.svn-base @ 245:051f544170fe
* Update to SVN trunk revision 4993
author | Chris Cannam |
---|---|
date | Thu, 03 Mar 2011 11:42:28 +0000 |
parents | 0579821a129a |
children |
comparison
equal
deleted
inserted
replaced
244:8972b600f4fb | 245:051f544170fe |
---|---|
64 def [](name) | 64 def [](name) |
65 load unless @config | 65 load unless @config |
66 @config[name] | 66 @config[name] |
67 end | 67 end |
68 | 68 |
69 # Yields a block with the specified hash configuration settings | |
70 def with(settings) | |
71 settings.stringify_keys! | |
72 load unless @config | |
73 was = settings.keys.inject({}) {|h,v| h[v] = @config[v]; h} | |
74 @config.merge! settings | |
75 yield if block_given? | |
76 @config.merge! was | |
77 end | |
78 | |
69 private | 79 private |
70 | 80 |
71 def load_from_yaml(filename, env) | 81 def load_from_yaml(filename, env) |
72 yaml = YAML::load_file(filename) | 82 yaml = YAML::load_file(filename) |
73 conf = {} | 83 conf = {} |