lib/cmds/result.rb in cmds-0.2.0 vs lib/cmds/result.rb in cmds-0.2.1
- old
+ new
@@ -1,9 +1,7 @@
require 'nrser/refinements'
-using NRSER
-
class Cmds
# a simple data structure returned from calling {Cmds#capture}
# on a {Cmd} instance.
#
# it contains the exit status code, standard output and standard error,
@@ -53,17 +51,10 @@
# @return [Result] it's self (so that it can be chained).
#
# @raise [SystemCallError] if the command failed.
#
def assert
- if error?
- msg = <<-BLOCK.squish
- command `#{ @cmd }` exited with status #{ @status }
- and stderr #{ err.inspect }
- BLOCK
-
- raise SystemCallError.new msg, @status
- end
+ Cmds.check_status @cmd, @status, @err
self
end # raise_error
end # Result
end # Cmds