Module: Dbmanager::YmlParser
Defined Under Namespace
Classes: YmlInvalidError
Instance Method Summary collapse
Instance Method Details
permalink #config ⇒ Object
[View source]
11 12 13 |
# File 'lib/dbmanager/yml_parser.rb', line 11 def config @config ||= yml_load(db_config_file).deep_merge(override_config) end |
permalink #environments ⇒ Object
[View source]
24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/dbmanager/yml_parser.rb', line 24 def environments @environments ||= begin yml_sorted_envs.each_with_object(ActiveSupport::OrderedHash.new) do |arr, hash| env_name, env_config = arr[0], arr[1] begin hash[env_name] = Environment.new env_config.merge(:name => env_name) rescue NoMethodError raise YmlInvalidError, (env_name, env_config) end end end end |
permalink #override_config ⇒ Object
[View source]
15 16 17 |
# File 'lib/dbmanager/yml_parser.rb', line 15 def override_config File.file?(db_override_file) ? yml_load(db_override_file) : {} end |
permalink #reload_config ⇒ Object
[View source]
19 20 21 22 |
# File 'lib/dbmanager/yml_parser.rb', line 19 def reload_config @config = nil config end |