Sha256: c45360d15d8c2357fcbcf819a079c909227408fe5e1bc26595923243dc9520a9

Contents?: true

Size: 462 Bytes

Versions: 2

Compression:

Stored size: 462 Bytes

Contents

module Utils

  def command(cmd)
    puts cmd if $verbose
    ret=''
    unless $dry
      ret = `#{cmd}` unless $dry
      if $?.exitstatus != 0 ## return failure
        puts "While executing:"
        puts cmd
        puts "The command failed with exitstatus $?.exitstatus"
        puts "Full output of command follows"
        puts "="*40
        puts ret
        puts "Nothing to do. Aborting!"
        exit! 1
      end
    end
    ret
  end


end #module

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
devinstall-0.2.6 lib/devinstall/utils.rb
devinstall-0.2.5 lib/devinstall/utils.rb