Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Use Bundler.sudo method

  • Loading branch information...
commit a20a8f7d4cfb14eaf602f24c42dea926c7560ce0 1 parent 6bb7b10
@spastorino spastorino authored
Showing with 5 additions and 9 deletions.
  1. +5 −9 lib/bundler/source.rb
View
14 lib/bundler/source.rb
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.