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

This commit is contained in:
Jack Chu 2012-06-20 03:05:54 -04:00
parent 569a449fef
commit 3b53e3d844
4 changed files with 3 additions and 3 deletions

View File

@ -116,7 +116,7 @@ module Sinatra
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)

View File

@ -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",

View File

@ -24,7 +24,7 @@ describe Sinatra::ConfigFile do
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