summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndre Arko <andre@arko.net>2010-02-25 09:11:22 -0800
committerAndre Arko <andre@arko.net>2010-02-25 09:11:22 -0800
commit55509f23693bb344696d1dfa7fa0f0eb2108adf6 (patch)
tree7ca2ae641b31d3caa92f3755056b8e6927d31340
parente35a538da495c5c7cf4b2fb87d508066c4bf7bf2 (diff)
downloadbundler-55509f23693bb344696d1dfa7fa0f0eb2108adf6.tar.gz
Ignore paths like GEM_HOME that are empty strings
-rw-r--r--lib/bundler.rb4
-rw-r--r--spec/runtime/setup_spec.rb13
2 files changed, 15 insertions, 2 deletions
diff --git a/lib/bundler.rb b/lib/bundler.rb
index 2eb9f913f3..06512df96a 100644
--- a/lib/bundler.rb
+++ b/lib/bundler.rb
@@ -118,8 +118,8 @@ module Bundler
ENV['GEM_HOME'] = File.expand_path(bundle_path, root)
ENV['GEM_PATH'] = ''
else
- gem_home, gem_path = Gem.dir, Gem.path
- ENV["GEM_PATH"] = [gem_home, gem_path].flatten.compact.join(File::PATH_SEPARATOR)
+ paths = [Gem.dir, Gem.path].flatten.compact.reject{|p| p.empty? }
+ ENV["GEM_PATH"] = paths.join(File::PATH_SEPARATOR)
ENV["GEM_HOME"] = bundle_path.to_s
end
diff --git a/spec/runtime/setup_spec.rb b/spec/runtime/setup_spec.rb
index e91579852c..ac34f621b9 100644
--- a/spec/runtime/setup_spec.rb
+++ b/spec/runtime/setup_spec.rb
@@ -173,4 +173,17 @@ describe "Bundler.setup" do
out.should be_empty
end
+
+ it "ignores empty gem paths" do
+ install_gemfile <<-G
+ source "file://#{gem_repo1}"
+ gem "rack"
+ G
+
+ ENV["GEM_HOME"] = ""
+ bundle %{exec ruby -e "require 'set'"}
+
+ err.should be_empty
+ end
+
end