Created
August 2, 2009 19:08
-
-
Save technicalpickles/160156 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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