Skip to content
Browse files

Switched override_gem_home default to true

  • Loading branch information...
1 parent 50901c8 commit 9f70a8f9793bb10f2c053f92a00dfff436550647 @jkutner jkutner committed Sep 3, 2013
Showing with 11 additions and 10 deletions.
  1. +2 −2 lib/warbler/config.rb
  2. +2 −2 spec/warbler/config_spec.rb
  3. +4 −4 spec/warbler/jar_spec.rb
  4. +3 −2 warble.rb
View
4 lib/warbler/config.rb
@@ -124,7 +124,7 @@ class Config
# Override GEM_HOME environment variable at runtime. When false, gems in
# GEM_HOME will be loaded in preference to those packaged within the jar
# file. When true, only gems packaged in the jar file will be loaded.
- # Defaults to false
+ # Defaults to true
attr_accessor :override_gem_home
# Extra configuration for web.xml. Controls how the dynamically-generated web.xml
@@ -189,7 +189,7 @@ def initialize(warbler_home = WARBLER_HOME)
@webinf_files = FileList[]
@init_filename = 'META-INF/init.rb'
@init_contents = ["#{@warbler_templates}/config.erb"]
- @override_gem_home = false
+ @override_gem_home = true
@script_files = []
@warbler_scripts = "#{WARBLER_HOME}/lib/warbler/scripts"
View
4 spec/warbler/config_spec.rb
@@ -19,7 +19,7 @@
config = Warbler::Config.new
config.includes.should be_empty
config.jar_name.size.should > 0
- config.override_gem_home.should be_false
+ config.override_gem_home.should be_true
end
end
@@ -39,7 +39,7 @@
config.webxml.should be_kind_of(OpenStruct)
config.pathmaps.should be_kind_of(OpenStruct)
config.pathmaps.public_html.should == ["%{public/,}p"]
- config.override_gem_home.should be_false
+ config.override_gem_home.should be_true
end
it "should allow configuration through an initializer block" do
View
8 spec/warbler/jar_spec.rb
@@ -58,14 +58,14 @@ def apply_extra_config(config)
it "does not override ENV['GEM_HOME'] by default" do
jar.add_init_file(config)
contents = jar.contents('META-INF/init.rb')
- contents.should include("ENV['GEM_HOME'] ||=")
+ contents.should include("ENV['GEM_HOME'] =")
end
it "overrides ENV['GEM_HOME'] when override_gem_home is set" do
- config.override_gem_home = true
+ config.override_gem_home = false
jar.add_init_file(config)
contents = jar.contents('META-INF/init.rb')
- contents.should include("ENV['GEM_HOME'] =")
+ contents.should include("ENV['GEM_HOME'] ||=")
end
it "adds a main.rb" do
@@ -326,7 +326,7 @@ def apply_extra_config(config)
it "adds ENV['GEM_HOME'] to init.rb" do
jar.add_init_file(config)
contents = jar.contents('META-INF/init.rb')
- contents.should include("ENV['GEM_HOME'] ||=")
+ contents.should include("ENV['GEM_HOME'] =")
contents.should =~ /WEB-INF\/gems/
end
View
5 warble.rb
@@ -90,8 +90,9 @@
# config.compiled_ruby_files = FileList['app/**/*.rb']
# When set to true, Warbler will override the value of ENV['GEM_HOME'] even it
- # has already been set.
- # config.override_gem_home = false
+ # has already been set. When set to false it will use any existing value of
+ # GEM_HOME if it is set.
+ # config.override_gem_home = true
# Allows for specifing custom executables
# config.executable = ["rake", "bin/rake"]

0 comments on commit 9f70a8f

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