diff options
-rw-r--r-- | lib/bundler/source.rb | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/lib/bundler/source.rb b/lib/bundler/source.rb index 4b6330a645..b8c973f250 100644 --- a/lib/bundler/source.rb +++ b/lib/bundler/source.rb @@ -98,22 +98,18 @@ module Bundler # SUDO HAX if Bundler.requires_sudo? - sudo "mkdir -p #{Bundler.rubygems.gem_dir}/gems #{Bundler.rubygems.gem_dir}/specifications" - sudo "cp -R #{Bundler.tmp}/gems/#{spec.full_name} #{Bundler.rubygems.gem_dir}/gems/" - sudo "cp -R #{Bundler.tmp}/specifications/#{spec.full_name}.gemspec #{Bundler.rubygems.gem_dir}/specifications/" + Bundler.sudo "mkdir -p #{Bundler.rubygems.gem_dir}/gems #{Bundler.rubygems.gem_dir}/specifications" + Bundler.sudo "cp -R #{Bundler.tmp}/gems/#{spec.full_name} #{Bundler.rubygems.gem_dir}/gems/" + Bundler.sudo "cp -R #{Bundler.tmp}/specifications/#{spec.full_name}.gemspec #{Bundler.rubygems.gem_dir}/specifications/" spec.executables.each do |exe| - sudo "mkdir -p #{Bundler.rubygems.gem_bindir}" - sudo "cp -R #{Bundler.tmp}/bin/#{exe} #{Bundler.rubygems.gem_bindir}" + Bundler.sudo "mkdir -p #{Bundler.rubygems.gem_bindir}" + Bundler.sudo "cp -R #{Bundler.tmp}/bin/#{exe} #{Bundler.rubygems.gem_bindir}" end end spec.loaded_from = "#{Bundler.rubygems.gem_dir}/specifications/#{spec.full_name}.gemspec" end - def sudo(str) - Bundler.sudo(str) - end - def cache(spec) cached_path = cached_gem(spec) raise GemNotFound, "Missing gem file '#{spec.full_name}.gem'." unless cached_path |