summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSantiago Pastorino <santiago@wyeworks.com>2011-08-08 17:15:38 -0300
committerSantiago Pastorino <santiago@wyeworks.com>2011-08-08 17:15:38 -0300
commita20a8f7d4cfb14eaf602f24c42dea926c7560ce0 (patch)
tree46acc08ff4cf8c2f9dac17ca47913961335a41cc
parent6bb7b10fbe7ad5876c3601413a5aa29cbe2c1b80 (diff)
downloadbundler-a20a8f7d4cfb14eaf602f24c42dea926c7560ce0.tar.gz
Use Bundler.sudo method
-rw-r--r--lib/bundler/source.rb14
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