Class: RubyGit::CommandLine::Result
- Inherits:
-
SimpleDelegator
- Object
- SimpleDelegator
- RubyGit::CommandLine::Result
- Defined in:
- lib/ruby_git/command_line/result.rb
Overview
The result of running a git command
Adds stdout and stderr processing to the ProcessExecuter::ResultWithCapture
class.
Instance Method Summary collapse
-
#initialize(result) ⇒ RubyGit::CommandLine::Result
constructor
Initialize a new result object.
-
#process_stderr {|stderr, result| ... } ⇒ self
Process the captured stderr output.
-
#process_stdout {|stdout, result| ... } ⇒ self
Process the captured stdout output.
-
#stderr ⇒ String?
Return the processed stderr output (or original if it was not processed).
-
#stdout ⇒ String?
Return the processed stdout output (or original if it was not processed).
-
#unprocessed_stderr ⇒ String?
Returns the original stderr output before it was processed.
-
#unprocessed_stdout ⇒ String?
Returns the original stdout output before it was processed.
Constructor Details
#initialize(result) ⇒ RubyGit::CommandLine::Result
Initialize a new result object
|
# File 'lib/ruby_git/command_line/result.rb', line 15
|
Instance Method Details
#process_stderr {|stderr, result| ... } ⇒ self
Process the captured stderr output
147 148 149 150 151 152 153 |
# File 'lib/ruby_git/command_line/result.rb', line 147 def process_stderr(&block) return self if block.nil? @processed_stderr = block.call(stderr, self) self end |
#process_stdout {|stdout, result| ... } ⇒ self
Process the captured stdout output
72 73 74 75 76 77 78 |
# File 'lib/ruby_git/command_line/result.rb', line 72 def process_stdout(&block) return self if block.nil? @processed_stdout = block.call(stdout, self) self end |
#stderr ⇒ String?
Return the processed stderr output (or original if it was not processed)
This output is only returned if a stderr redirection is a
ProcessExecuter::MonitoredPipe
.
113 114 115 |
# File 'lib/ruby_git/command_line/result.rb', line 113 def stderr defined?(@processed_stderr) ? @processed_stderr : unprocessed_stderr end |
#stdout ⇒ String?
Return the processed stdout output (or original if it was not processed)
38 39 40 |
# File 'lib/ruby_git/command_line/result.rb', line 38 def stdout defined?(@processed_stdout) ? @processed_stdout : unprocessed_stdout end |
#unprocessed_stderr ⇒ String?
Returns the original stderr output before it was processed
171 172 173 |
# File 'lib/ruby_git/command_line/result.rb', line 171 def unprocessed_stderr __getobj__.stderr end |
#unprocessed_stdout ⇒ String?
Returns the original stdout output before it was processed
96 97 98 |
# File 'lib/ruby_git/command_line/result.rb', line 96 def unprocessed_stdout __getobj__.stdout end |