Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Ignore paths like GEM_HOME that are empty strings

  • Loading branch information...
commit 55509f23693bb344696d1dfa7fa0f0eb2108adf6 1 parent e35a538
@indirect indirect authored
Showing with 15 additions and 2 deletions.
  1. +2 −2 lib/bundler.rb
  2. +13 −0 spec/runtime/setup_spec.rb
View
4 lib/bundler.rb
@@ -118,8 +118,8 @@ def configure_gem_home_and_path
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
View
13 spec/runtime/setup_spec.rb
@@ -173,4 +173,17 @@
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

1 comment on commit 55509f2

@amerine

woot.

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