lib/bundler.rb in bundler-1.9.10 vs lib/bundler.rb in bundler-1.10.0.pre
- old
+ new
@@ -10,11 +10,10 @@
module Bundler
preserve_gem_path
ORIGINAL_ENV = ENV.to_hash
- autoload :AnonymizableURI, 'bundler/anonymizable_uri'
autoload :Definition, 'bundler/definition'
autoload :Dependency, 'bundler/dependency'
autoload :DepProxy, 'bundler/dep_proxy'
autoload :Deprecate, 'bundler/deprecate'
autoload :Dsl, 'bundler/dsl'
@@ -119,16 +118,11 @@
if groups.empty?
# Load all groups, but only once
@setup = load.setup
else
- @completed_groups ||= []
- # Figure out which groups haven't been loaded yet
- unloaded = groups - @completed_groups
- # Record groups that are now loaded
- @completed_groups = groups
- unloaded.any? ? load.setup(*groups) : load
+ load.setup(*groups)
end
end
def require(*groups)
setup(*groups).require(*groups)
@@ -210,14 +204,16 @@
path = custom_path || root
path.join(self.settings.app_cache_path)
end
def tmp(name = Process.pid.to_s)
- Pathname.new(Dir.mktmpdir(["bundler", name]))
+ @tmp ||= Pathname.new Dir.mktmpdir("bundler")
+ @tmp.join(name)
end
- def rm_rf(path)
- FileUtils.remove_entry_secure(path) if path && File.exist?(path)
+ def cleanup
+ FileUtils.remove_entry_secure(@tmp) if defined?(@tmp) && @tmp
+ rescue
end
def settings
return @settings if defined?(@settings)
@settings = Settings.new(app_config_path)