Class: SSHKit::Backend::Netssh

Inherits:
Printer show all
Includes:
CommandHelper
Defined in:
lib/sshkit/backends/netssh.rb

Defined Under Namespace

Classes: Configuration

Instance Attribute Summary

Attributes inherited from Abstract

#host

Instance Method Summary collapse

Methods included from CommandHelper

#make, #rake

Methods inherited from Abstract

#as, #initialize, #make, #rake, #with, #within

Constructor Details

This class inherits a constructor from SSHKit::Backend::Abstract

Instance Method Details

#background(*args) ⇒ Object



27
28
29
30
# File 'lib/sshkit/backends/netssh.rb', line 27

def background(*args)
  options = args.extract_options!.merge(run_in_background: true)
  _execute(*[*args, options]).success?
end

#capture(*args) ⇒ Object



32
33
34
# File 'lib/sshkit/backends/netssh.rb', line 32

def capture(*args)
  _execute(*args).stdout.strip
end

#configObject



40
41
42
# File 'lib/sshkit/backends/netssh.rb', line 40

def config
  @config ||= Configuration.new
end

#configure {|config| ... } ⇒ Object

Yields:



36
37
38
# File 'lib/sshkit/backends/netssh.rb', line 36

def configure
  yield config
end

#execute(*args) ⇒ Object



23
24
25
# File 'lib/sshkit/backends/netssh.rb', line 23

def execute(*args)
  _execute(*args).success?
end

#runObject



14
15
16
# File 'lib/sshkit/backends/netssh.rb', line 14

def run
  instance_exec(host, &@block)
end

#test(*args) ⇒ Object



18
19
20
21
# File 'lib/sshkit/backends/netssh.rb', line 18

def test(*args)
  options = args.extract_options!.merge(raise_on_non_zero_exit: false)
  _execute(*[*args, options]).success?
end