Class: Serverspec::Type::Command

Inherits:
Base
  • Object
show all
Defined in:
lib/serverspec/type/command.rb

Instance Attribute Summary

Attributes inherited from Base

#name

Instance Method Summary collapse

Methods inherited from Base

#initialize, #inspect, #to_ary, #to_s

Constructor Details

This class inherits a constructor from Serverspec::Type::Base

Instance Method Details

#exit_statusObject



17
18
19
# File 'lib/serverspec/type/command.rb', line 17

def exit_status
  command_result.exit_status.to_i
end

#stderrObject



13
14
15
# File 'lib/serverspec/type/command.rb', line 13

def stderr
  command_result.stderr
end

#stdoutObject



5
6
7
# File 'lib/serverspec/type/command.rb', line 5

def stdout
  command_result.stdout
end

#stdout_as_jsonObject



9
10
11
# File 'lib/serverspec/type/command.rb', line 9

def stdout_as_json
  MultiJson.load(command_result.stdout)
end