Created
November 2, 2010 15:52
-
-
Save bradrobertson/659821 to your computer and use it in GitHub Desktop.
Attempt at patching trinidad to take APP_PATH into account when loading config
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# command_line_parser_spec.rb | |
it "respects web_app_dir if applicable when loading config" do | |
args = "--dir #{MOCK_WEB_APP_DIR} --config".split | |
options = subject.parse(args) | |
options[:config].should == "#{MOCK_WEB_APP_DIR}/config/trinidad.yml" | |
end | |
# command_line_parser.rb (line 32) | |
if default_options.has_key?(:config) | |
config_file = default_options[:web_app_dir] ? "#{default_options[:web_app_dir]}/#{default_options[:config]}" : default_options[:config] | |
config_options = YAML.load_file(config_file) | |
default_options.deep_merge!(config_options.symbolize!) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment