summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndre Arko <andre@arko.net>2014-03-31 17:48:37 +0800
committerAndre Arko <andre@arko.net>2014-03-31 17:48:37 +0800
commit55e6c0e4321a44410aa6691b81294af1454dc664 (patch)
treeadde188cfe87a1cf4d7f608f9786b9cd8dead736
parent76fa37889c2e26ad37ea5458f566a389cb4456ab (diff)
downloadbundler-55e6c0e4321a44410aa6691b81294af1454dc664.tar.gz
use named tmp for path gems too
-rw-r--r--lib/bundler/source/path/installer.rb12
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/bundler/source/path/installer.rb b/lib/bundler/source/path/installer.rb
index 448a3b7c85..28e69875aa 100644
--- a/lib/bundler/source/path/installer.rb
+++ b/lib/bundler/source/path/installer.rb
@@ -5,7 +5,9 @@ module Bundler
class Installer < Bundler::GemInstaller
def initialize(spec, options = {})
@spec = spec
- @bin_dir = Bundler.requires_sudo? ? "#{Bundler.tmp}/bin" : "#{Bundler.rubygems.gem_dir}/bin"
+ @tmp_bin_dir = "#{Bundler.tmp(spec.full_name)}/bin"
+ @gem_bin_dir = "#{Bundler.rubygems.gem_dir}/bin"
+ @bin_dir = Bundler.requires_sudo? ? @tmp_bin_dir : @gem_bin_dir
@gem_dir = Bundler.rubygems.path(spec.full_gem_path)
@wrappers = options[:wrappers] || true
@env_shebang = options[:env_shebang] || true
@@ -17,13 +19,15 @@ module Bundler
return if spec.executables.nil? || spec.executables.empty?
if Bundler.requires_sudo?
- FileUtils.mkdir_p("#{Bundler.tmp}/bin") unless File.exist?("#{Bundler.tmp}/bin")
+ FileUtils.mkdir_p(@tmp_bin_dir) unless File.exist?(@tmp_bin_dir)
end
+
super
+
if Bundler.requires_sudo?
- Bundler.mkdir_p "#{Bundler.rubygems.gem_dir}/bin"
+ Bundler.mkdir_p @gem_bin_dir
spec.executables.each do |exe|
- Bundler.sudo "cp -R #{Bundler.tmp}/bin/#{exe} #{Bundler.rubygems.gem_dir}/bin/"
+ Bundler.sudo "cp -R #{@tmp_bin_dir}/#{exe} #{@gem_bin_dir}"
end
end
end