Class: Serverspec::Backend::Ssh

Inherits:
Exec
  • Object
show all
Defined in:
lib/serverspec/backend/ssh.rb

Instance Method Summary collapse

Methods inherited from Exec

#check_executable, #check_installed_by_gem, #check_os, #check_readable, #check_running, #check_running_under_supervisor, #check_writable, #check_zero, #commands, #initialize, #method_missing

Constructor Details

This class inherits a constructor from Serverspec::Backend::Exec

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Serverspec::Backend::Exec

Instance Method Details

#do_check(cmd, opt = {}) ⇒ Object



6
7
8
9
# File 'lib/serverspec/backend/ssh.rb', line 6

def do_check(cmd, opt={})
  cmd = "sudo #{cmd}" if not RSpec.configuration.ssh.options[:user] == 'root'
  ssh_exec!(cmd)
end