Permalink
Browse files

change extension from config.erb.yml to config.yml.erb

  • Loading branch information...
1 parent ec13f8d commit 7ed71ac9f2b7b6768486b3da7691d55a9c93f36d @kamui kamui committed Jun 20, 2012
@@ -116,7 +116,7 @@ def config_file(*paths)
Dir.glob(pattern) do |file|
$stderr.puts "loading config file '#{file}'" if logging?
document = IO.read(file)
- document = ERB.new(document).result if file.include?('.erb.')
+ document = ERB.new(document).result if file.split('.').include?('erb')
yaml = config_for_env(YAML.load(document)) || {}
yaml.each_pair do |key, value|
for_env = config_for_env(value)
@@ -55,8 +55,8 @@ Gem::Specification.new do |s|
"lib/sinatra/test_helpers.rb",
"sinatra-contrib.gemspec",
"spec/capture_spec.rb",
- "spec/config_file/key_value.erb.yml",
"spec/config_file/key_value.yml",
+ "spec/config_file/key_value.yml.erb",
"spec/config_file/key_value_override.yml",
"spec/config_file/missing_env.yml",
"spec/config_file/with_envs.yml",
@@ -24,7 +24,7 @@ def config_file(*args, &block)
end
it 'should render options in ERB tags' do
- config_file 'key_value.erb.yml'
+ config_file 'key_value.yml.erb'
settings.foo.should == "bar"
settings.something.should == 42
settings.nested['a'].should == 1

0 comments on commit 7ed71ac

Please sign in to comment.