Skip to content
This repository
Browse code

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

  • Loading branch information...
commit 7ed71ac9f2b7b6768486b3da7691d55a9c93f36d 1 parent ec13f8d
Jack Chu authored June 20, 2012
2  lib/sinatra/config_file.rb
@@ -116,7 +116,7 @@ def config_file(*paths)
116 116
           Dir.glob(pattern) do |file|
117 117
             $stderr.puts "loading config file '#{file}'" if logging?
118 118
             document = IO.read(file)
119  
-            document = ERB.new(document).result if file.include?('.erb.')
  119
+            document = ERB.new(document).result if file.split('.').include?('erb')
120 120
             yaml = config_for_env(YAML.load(document)) || {}
121 121
             yaml.each_pair do |key, value|
122 122
               for_env = config_for_env(value)
2  sinatra-contrib.gemspec
@@ -55,8 +55,8 @@ Gem::Specification.new do |s|
55 55
     "lib/sinatra/test_helpers.rb",
56 56
     "sinatra-contrib.gemspec",
57 57
     "spec/capture_spec.rb",
58  
-    "spec/config_file/key_value.erb.yml",
59 58
     "spec/config_file/key_value.yml",
  59
+    "spec/config_file/key_value.yml.erb",
60 60
     "spec/config_file/key_value_override.yml",
61 61
     "spec/config_file/missing_env.yml",
62 62
     "spec/config_file/with_envs.yml",
0  spec/config_file/key_value.erb.yml → spec/config_file/key_value.yml.erb
File renamed without changes
2  spec/config_file_spec.rb
@@ -24,7 +24,7 @@ def config_file(*args, &block)
24 24
   end
25 25
 
26 26
   it 'should render options in ERB tags' do
27  
-    config_file 'key_value.erb.yml'
  27
+    config_file 'key_value.yml.erb'
28 28
     settings.foo.should == "bar"
29 29
     settings.something.should == 42
30 30
     settings.nested['a'].should == 1

0 notes on commit 7ed71ac

Please sign in to comment.
Something went wrong with that request. Please try again.