Skip to content
Snippets Groups Projects
Commit 3018e16d authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets
Browse files

Merge pull request #45 from n-rodriguez/add_process_out2

Add process.out to CommandFailed error
parents c2541d93 3507a357
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -23,14 +23,18 @@ module Grit
# The integer exit status.
attr_reader :exitstatus
 
# Everything output on the command's stdout as a String.
attr_reader :out
# Everything output on the command's stderr as a String.
attr_reader :err
 
def initialize(command, exitstatus=nil, err='')
def initialize(command, exitstatus=nil, err='', out='')
if exitstatus
@command = command
@exitstatus = exitstatus
@err = err
@out = out
message = "Command failed [#{exitstatus}]: #{command}"
message << "\n\n" << err unless err.nil? || err.empty?
super message
Loading
Loading
@@ -344,7 +348,7 @@ module Grit
 
status = process.status
if raise_errors && !status.success?
raise CommandFailed.new(argv.join(' '), status.exitstatus, process.err)
raise CommandFailed.new(argv.join(' '), status.exitstatus, process.err, process.out)
elsif process_info
[status.exitstatus, process.out, process.err]
else
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment