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

Commit

Permalink
so it turns out caching Gem.dir is a terrible idea
Browse files Browse the repository at this point in the history
  • Loading branch information
indirect committed May 24, 2011
1 parent d8022b5 commit 74679e6
Showing 1 changed file with 3 additions and 13 deletions.
16 changes: 3 additions & 13 deletions lib/bundler/rubygems_integration.rb
Expand Up @@ -3,11 +3,6 @@ class RubygemsIntegration
def initialize
# Work around a RubyGems bug
configuration

# Cache Gem.dir and Gem.bindir because Rubygems 1.8 treats them as globals,
# changing them anytime you use Gem::Installer#install.
gem_dir
gem_bindir
end

def loaded_specs(name)
Expand Down Expand Up @@ -51,24 +46,19 @@ def sources
end

def gem_dir
# We cache this because Rubygems 1.8 changes Gem.dir every time
# a gem is installed, and we need the original.
@gem_dir ||= Gem.dir
Gem.dir
end

def gem_bindir
# We cache this for the same reason we cache gem_dir.
@gem_bindir ||= Gem.bindir
Gem.bindir
end

def user_home
Gem.user_home
end

def gem_path
# Make sure that Gem.path is an array of Strings, not some
# internal Rubygems object
Gem.path.map { |x| x.to_s }
Gem.path
end

def marshal_spec_dir
Expand Down

0 comments on commit 74679e6

Please sign in to comment.