Class: WinRM::Output

Inherits:
Object
  • Object
show all
Defined in:
lib/winrm/output.rb

Overview

This class holds raw output and has convenience methods to parse.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeOutput



20
21
22
# File 'lib/winrm/output.rb', line 20

def initialize
  @data = []
end

Instance Attribute Details

#exitcodeInteger



25
26
27
# File 'lib/winrm/output.rb', line 25

def exitcode
  @exitcode
end

Instance Method Details

#<<(data) ⇒ Object

Appends stream data to the output



55
56
57
# File 'lib/winrm/output.rb', line 55

def <<(data)
  @data << data
end

#outputString



28
29
30
31
32
# File 'lib/winrm/output.rb', line 28

def output
  @data.flat_map do |line|
    [line[:stdout], line[:stderr]]
  end.compact.join
end

#stderrString



42
43
44
45
46
# File 'lib/winrm/output.rb', line 42

def stderr
  @data.map do |line|
    line[:stderr]
  end.compact.join
end

#stdoutString



35
36
37
38
39
# File 'lib/winrm/output.rb', line 35

def stdout
  @data.map do |line|
    line[:stdout]
  end.compact.join
end