Class: Inspec::Resources::Bash

Inherits:
Cmd
  • Object
show all
Defined in:
lib/inspec/resources/bash.rb

Instance Attribute Summary

Attributes inherited from Cmd

#command

Instance Method Summary collapse

Methods inherited from Cmd

#exist?, #exit_status, #result, #stderr, #stdout

Constructor Details

#initialize(command, options = {}) ⇒ Bash

Returns a new instance of Bash.



25
26
27
28
29
# File 'lib/inspec/resources/bash.rb', line 25

def initialize(command, options = {})
  @raw_command = command
  options[:shell] = "bash" if options.is_a?(Hash)
  super(CommandWrapper.wrap(command, options))
end

Instance Method Details

#resource_idObject



31
32
33
# File 'lib/inspec/resources/bash.rb', line 31

def resource_id
  @raw_command || "bash"
end

#to_sObject



35
36
37
# File 'lib/inspec/resources/bash.rb', line 35

def to_s
  "Bash command #{@raw_command}"
end