Class: SSHKit::Backend::Local
Instance Attribute Summary
Attributes inherited from Abstract
#host
Instance Method Summary
collapse
#make, #rake
Methods inherited from Abstract
#as, config, configure, #debug, #error, #fatal, #info, #log, #make, #rake, #trace, #warn, #with, #within
Constructor Details
#initialize(&block) ⇒ Local
Returns a new instance of Local.
8
9
10
11
|
# File 'lib/sshkit/backends/local.rb', line 8
def initialize(&block)
@host = Host.new(hostname: 'localhost') @block = block
end
|
Instance Method Details
#capture(*args) ⇒ Object
29
30
31
32
|
# File 'lib/sshkit/backends/local.rb', line 29
def capture(*args)
options = { verbosity: Logger::DEBUG }.merge(args.)
_execute(*[*args, options]).full_stdout.strip
end
|
#execute(*args) ⇒ Object
25
26
27
|
# File 'lib/sshkit/backends/local.rb', line 25
def execute(*args)
_execute(*args).success?
end
|
#run ⇒ Object
13
14
15
|
# File 'lib/sshkit/backends/local.rb', line 13
def run
instance_exec(&@block)
end
|
#test(*args) ⇒ Object
17
18
19
20
21
22
23
|
# File 'lib/sshkit/backends/local.rb', line 17
def test(*args)
options = args..merge(
raise_on_non_zero_exit: false,
verbosity: Logger::DEBUG
)
_execute(*[*args, options]).success?
end
|