Permalink
Browse files

Use Bundler.sudo method

  • Loading branch information...
1 parent 6bb7b10 commit a20a8f7d4cfb14eaf602f24c42dea926c7560ce0 @spastorino spastorino committed Aug 8, 2011
Showing with 5 additions and 9 deletions.
  1. +5 −9 lib/bundler/source.rb
View
@@ -98,22 +98,18 @@ def install(spec)
# 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

0 comments on commit a20a8f7

Please sign in to comment.