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::Result class.
Instance Method Summary collapse
-
#initialize(result) ⇒ RubyGit::CommandLine::Result
constructor
Initialize a new result object.
-
#process_stderr {|stderr, result| ... } ⇒ String?
Process the captured stderr output.
-
#process_stdout {|stdout, result| ... } ⇒ String?
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| ... } ⇒ String?
Process the captured stderr output
129 130 131 132 133 134 |
# File 'lib/ruby_git/command_line/result.rb', line 129 def process_stderr(&block) return if block.nil? @processed_stderr = block.call(stderr, self) self end |
#process_stdout {|stdout, result| ... } ⇒ String?
Process the captured stdout output
64 65 66 67 68 69 |
# File 'lib/ruby_git/command_line/result.rb', line 64 def process_stdout(&block) return 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.
100 101 102 |
# File 'lib/ruby_git/command_line/result.rb', line 100 def stderr defined?(@processed_stderr) ? @processed_stderr : unprocessed_stderr end |
#stdout ⇒ String?
Return the processed stdout output (or original if it was not processed)
This output is only returned if a stdout redirection is a
ProcessExecuter::MonitoredPipe.
35 36 37 |
# File 'lib/ruby_git/command_line/result.rb', line 35 def stdout defined?(@processed_stdout) ? @processed_stdout : unprocessed_stdout end |
#unprocessed_stderr ⇒ String?
Returns the original stderr output before it was processed
150 151 152 |
# File 'lib/ruby_git/command_line/result.rb', line 150 def unprocessed_stderr __getobj__.stderr end |
#unprocessed_stdout ⇒ String?
Returns the original stdout output before it was processed
85 86 87 |
# File 'lib/ruby_git/command_line/result.rb', line 85 def unprocessed_stdout __getobj__.stdout end |