Class: SSHKit::Backend::Printer

Inherits:
Abstract
  • Object
show all
Includes:
CommandHelper
Defined in:
lib/sshkit/backends/printer.rb

Direct Known Subclasses

Local, Netssh, Skipper

Instance Attribute Summary

Attributes inherited from Abstract

#host

Instance Method Summary collapse

Methods included from CommandHelper

#make, #rake

Methods inherited from Abstract

#as, config, configure, #debug, #error, #fatal, #info, #initialize, #log, #make, #rake, #trace, #warn, #with, #within

Constructor Details

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

Instance Method Details

#capture(*args) ⇒ Object Also known as: capture!



21
22
23
# File 'lib/sshkit/backends/printer.rb', line 21

def capture(*args)
  String.new.tap { execute(*args) }
end

#execute(*args) ⇒ Object Also known as: upload!, download!, test



12
13
14
15
16
# File 'lib/sshkit/backends/printer.rb', line 12

def execute(*args)
  command(*args).tap do |cmd|
    output << cmd
  end
end

#runObject



8
9
10
# File 'lib/sshkit/backends/printer.rb', line 8

def run
  instance_exec(host, &@block)
end