Skip to content

Instantly share code, notes, and snippets.

@technicalpickles
Created August 2, 2009 19:08
Show Gist options
  • Save technicalpickles/160156 to your computer and use it in GitHub Desktop.
Save technicalpickles/160156 to your computer and use it in GitHub Desktop.
def run
command = "gem install #{gemspec_helper.gem_path}"
output.puts "Executing #{command.inspect}:"
sh sudo_wrapper(command) # TODO where does sh actually come from!? - rake, apparently
end
def sudo_wrapper(command)
if use_sudo?
"sudo #{command}"
else
command
end
end
def use_sudo?
if host_os =~ /mswin|windows|cygwin/i
false
else
true
end
end
def host_os
Config::CONFIG['host_os']
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment