Skip to content
This repository has been archived by the owner on Apr 14, 2021. It is now read-only.

Commit

Permalink
Ignore paths like GEM_HOME that are empty strings
Browse files Browse the repository at this point in the history
  • Loading branch information
indirect committed Feb 25, 2010
1 parent e35a538 commit 55509f2
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/bundler.rb
Expand Up @@ -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

Expand Down
13 changes: 13 additions & 0 deletions spec/runtime/setup_spec.rb
Expand Up @@ -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
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

woot.

Please sign in to comment.