module Utils

Public Instance Methods

command(cmd) click to toggle source
# File lib/devinstall/utils.rb, line 16
def command(cmd)
  puts "\t#{cmd}" if $verbose
  ret=''
  unless $dry
    ret = `#{cmd}`
    if $?.exitstatus != 0 ## return failure
      err=CommandError.new "Error Running:\t #{cmd}"
      err.command_output = ret
      err.return_code = $?.exitstatus
      raise err
    end
  end
  ret
end
exit!(msg='Aborting') click to toggle source
# File lib/devinstall/utils.rb, line 31
def exit!(msg='Aborting')
  puts msg
  Kernel.exit 1
end