Class: WinRM::Output
- Inherits:
-
Object
- Object
- WinRM::Output
- Defined in:
- lib/winrm/output.rb
Overview
This class holds raw output and has convenience methods to parse.
Instance Attribute Summary collapse
-
#exitcode ⇒ Integer
Exitcode returned from command.
Instance Method Summary collapse
-
#<<(data) ⇒ Object
Appends stream data to the output.
-
#initialize ⇒ Output
constructor
A new instance of Output.
-
#output ⇒ String
Aggregated stdout and stderr streams.
-
#stderr ⇒ String
Stderr stream output.
-
#stdout ⇒ String
Stdout stream output.
Constructor Details
#initialize ⇒ Output
Returns a new instance of Output.
18 19 20 |
# File 'lib/winrm/output.rb', line 18 def initialize @data = [] end |
Instance Attribute Details
#exitcode ⇒ Integer
Returns exitcode returned from command.
23 24 25 |
# File 'lib/winrm/output.rb', line 23 def exitcode @exitcode end |
Instance Method Details
#<<(data) ⇒ Object
Appends stream data to the output
54 55 56 |
# File 'lib/winrm/output.rb', line 54 def <<(data) @data << data end |
#output ⇒ String
Returns Aggregated stdout and stderr streams.
26 27 28 29 30 |
# File 'lib/winrm/output.rb', line 26 def output @data.flat_map do |line| [line[:stdout], line[:stderr]] end.compact.join end |
#stderr ⇒ String
Returns stderr stream output.
40 41 42 43 44 |
# File 'lib/winrm/output.rb', line 40 def stderr @data.map do |line| line[:stderr] end.compact.join end |
#stdout ⇒ String
Returns stdout stream output.
33 34 35 36 37 |
# File 'lib/winrm/output.rb', line 33 def stdout @data.map do |line| line[:stdout] end.compact.join end |