Class: Nesta::SystemCommand

Inherits:
Object
  • Object
show all
Defined in:
lib/nesta/system_command.rb

Instance Method Summary collapse

Instance Method Details

#run(*args) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
# File 'lib/nesta/system_command.rb', line 3

def run(*args)
  system(*args)
  if ! $?.success?
    message = if $?.exitstatus == 127
                "#{args[0]} not found"
              else
                "'#{args.join(' ')}' failed with status #{$?.exitstatus}"
              end
    Nesta.fail_with(message)
  end
end