Skip to content
This repository
Browse code

Switched override_gem_home default to true

  • Loading branch information...
commit 9f70a8f9793bb10f2c053f92a00dfff436550647 1 parent 50901c8
Joe Kutner jkutner authored
4 lib/warbler/config.rb
@@ -124,7 +124,7 @@ class Config
124 124 # Override GEM_HOME environment variable at runtime. When false, gems in
125 125 # GEM_HOME will be loaded in preference to those packaged within the jar
126 126 # file. When true, only gems packaged in the jar file will be loaded.
127   - # Defaults to false
  127 + # Defaults to true
128 128 attr_accessor :override_gem_home
129 129
130 130 # Extra configuration for web.xml. Controls how the dynamically-generated web.xml
@@ -189,7 +189,7 @@ def initialize(warbler_home = WARBLER_HOME)
189 189 @webinf_files = FileList[]
190 190 @init_filename = 'META-INF/init.rb'
191 191 @init_contents = ["#{@warbler_templates}/config.erb"]
192   - @override_gem_home = false
  192 + @override_gem_home = true
193 193 @script_files = []
194 194 @warbler_scripts = "#{WARBLER_HOME}/lib/warbler/scripts"
195 195
4 spec/warbler/config_spec.rb
@@ -19,7 +19,7 @@
19 19 config = Warbler::Config.new
20 20 config.includes.should be_empty
21 21 config.jar_name.size.should > 0
22   - config.override_gem_home.should be_false
  22 + config.override_gem_home.should be_true
23 23 end
24 24 end
25 25
@@ -39,7 +39,7 @@
39 39 config.webxml.should be_kind_of(OpenStruct)
40 40 config.pathmaps.should be_kind_of(OpenStruct)
41 41 config.pathmaps.public_html.should == ["%{public/,}p"]
42   - config.override_gem_home.should be_false
  42 + config.override_gem_home.should be_true
43 43 end
44 44
45 45 it "should allow configuration through an initializer block" do
8 spec/warbler/jar_spec.rb
@@ -58,14 +58,14 @@ def apply_extra_config(config)
58 58 it "does not override ENV['GEM_HOME'] by default" do
59 59 jar.add_init_file(config)
60 60 contents = jar.contents('META-INF/init.rb')
61   - contents.should include("ENV['GEM_HOME'] ||=")
  61 + contents.should include("ENV['GEM_HOME'] =")
62 62 end
63 63
64 64 it "overrides ENV['GEM_HOME'] when override_gem_home is set" do
65   - config.override_gem_home = true
  65 + config.override_gem_home = false
66 66 jar.add_init_file(config)
67 67 contents = jar.contents('META-INF/init.rb')
68   - contents.should include("ENV['GEM_HOME'] =")
  68 + contents.should include("ENV['GEM_HOME'] ||=")
69 69 end
70 70
71 71 it "adds a main.rb" do
@@ -326,7 +326,7 @@ def apply_extra_config(config)
326 326 it "adds ENV['GEM_HOME'] to init.rb" do
327 327 jar.add_init_file(config)
328 328 contents = jar.contents('META-INF/init.rb')
329   - contents.should include("ENV['GEM_HOME'] ||=")
  329 + contents.should include("ENV['GEM_HOME'] =")
330 330 contents.should =~ /WEB-INF\/gems/
331 331 end
332 332
5 warble.rb
@@ -90,8 +90,9 @@
90 90 # config.compiled_ruby_files = FileList['app/**/*.rb']
91 91
92 92 # When set to true, Warbler will override the value of ENV['GEM_HOME'] even it
93   - # has already been set.
94   - # config.override_gem_home = false
  93 + # has already been set. When set to false it will use any existing value of
  94 + # GEM_HOME if it is set.
  95 + # config.override_gem_home = true
95 96
96 97 # Allows for specifing custom executables
97 98 # config.executable = ["rake", "bin/rake"]

0 comments on commit 9f70a8f

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