lib/bundler.rb in bundler-1.0.12 vs lib/bundler.rb in bundler-1.0.13
- old
+ new
@@ -7,10 +7,11 @@
rescue LoadError
end
require 'yaml'
require 'bundler/rubygems_ext'
+require 'bundler/rubygems_integration'
require 'bundler/version'
module Bundler
ORIGINAL_ENV = ENV.to_hash
@@ -83,11 +84,10 @@
def ui
@ui ||= UI.new
end
def bundle_path
- # STDERR.puts settings.path
@bundle_path ||= Pathname.new(settings.path).expand_path(root)
end
def bin_path
@bin_path ||= begin
@@ -136,15 +136,15 @@
Definition.build(default_gemfile, default_lockfile, unlock)
end
end
def ruby_scope
- "#{Gem.ruby_engine}/#{Gem::ConfigMap[:ruby_version]}"
+ "#{Bundler.rubygems.ruby_engine}/#{Gem::ConfigMap[:ruby_version]}"
end
def user_bundle_path
- Pathname.new(Gem.user_home).join(".bundler")
+ Pathname.new(Bundler.rubygems.user_home).join(".bundler")
end
def home
bundle_path.join("bundler")
end
@@ -257,19 +257,20 @@
def configure_gem_home_and_path
if settings[:disable_shared_gems]
ENV['GEM_PATH'] = ''
ENV['GEM_HOME'] = File.expand_path(bundle_path, root)
- elsif Gem.dir != bundle_path.to_s
- paths = [Gem.dir, Gem.path].flatten.compact.uniq.reject{|p| p.empty? }
+ elsif Bundler.rubygems.gem_dir != bundle_path.to_s
+ possibles = [Bundler.rubygems.gem_dir, Bundler.rubygems.gem_path]
+ paths = possibles.flatten.compact.uniq.reject { |p| p.empty? }
ENV["GEM_PATH"] = paths.join(File::PATH_SEPARATOR)
ENV["GEM_HOME"] = bundle_path.to_s
end
# TODO: This mkdir_p is only needed for JRuby <= 1.5 and should go away (GH #602)
FileUtils.mkdir_p bundle_path.to_s rescue nil
- Gem.clear_paths
+ Bundler.rubygems.clear_paths
end
def upgrade_lockfile
lockfile = default_lockfile
if lockfile.exist? && lockfile.read(3) == "---"