lib/autoproj/package_managers/bundler_manager.rb in autoproj-2.8.4 vs lib/autoproj/package_managers/bundler_manager.rb in autoproj-2.8.5.b1
- old
+ new
@@ -168,11 +168,13 @@
FileUtils.rm backup_file
end
end
end
- def self.run_bundler_install(ws, gemfile, *options, update: true, binstubs: nil, gem_path: ws.config.gems_install_path)
+ def self.run_bundler_install(ws, gemfile, *options, update: true, binstubs: nil,
+ gem_home: ws.config.gems_gem_home,
+ gem_path: ws.config.gems_install_path)
if update && File.file?("#{gemfile}.lock")
FileUtils.rm "#{gemfile}.lock"
end
options << '--path' << gem_path
@@ -180,11 +182,11 @@
if binstubs
options << "--binstubs" << binstubs
end
connections = Set.new
- run_bundler(ws, 'install', *options, gemfile: gemfile) do |line|
+ run_bundler(ws, 'install', *options, gem_home: gem_home, gemfile: gemfile) do |line|
case line
when /Installing (.*)/
Autobuild.message " bundler: installing #{$1}"
when /Fetching.*from (.*)/
host = $1.gsub(/\.+$/, '')
@@ -194,21 +196,21 @@
end
end
end
end
- def self.bundle_gem_path(ws, gem_name, gemfile: nil)
+ def self.bundle_gem_path(ws, gem_name, gem_home: nil, gemfile: nil)
path = String.new
- PackageManagers::BundlerManager.run_bundler(ws, 'show', gem_name, gemfile: gemfile) do |line|
+ PackageManagers::BundlerManager.run_bundler(ws, 'show', gem_name, gem_home: gem_home, gemfile: gemfile) do |line|
path << line
end
path.chomp
end
- def self.run_bundler(ws, *commandline, gemfile: nil)
+ def self.run_bundler(ws, *commandline, gem_home: nil, gemfile: nil)
Bundler.with_clean_env do
target_env = Hash[
- 'GEM_HOME' => nil,
+ 'GEM_HOME' => gem_home,
'GEM_PATH' => nil,
'BUNDLE_GEMFILE' => gemfile,
'RUBYOPT' => nil,
'RUBYLIB' => nil
]