Class: SSHKit::Backend::Local
Instance Attribute Summary
Attributes inherited from Abstract
#host
Instance Method Summary
collapse
#make, #rake
Methods inherited from Abstract
#as, #background, 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
|
# File 'lib/sshkit/backends/local.rb', line 8
def initialize(&block)
@block = block
end
|
Instance Method Details
#capture(*args) ⇒ Object
28
29
30
31
|
# File 'lib/sshkit/backends/local.rb', line 28
def capture(*args)
options = args..merge(verbosity: Logger::DEBUG)
_execute(*[*args, options]).full_stdout.strip
end
|
#execute(*args) ⇒ Object
24
25
26
|
# File 'lib/sshkit/backends/local.rb', line 24
def execute(*args)
_execute(*args).success?
end
|
#run ⇒ Object
12
13
14
|
# File 'lib/sshkit/backends/local.rb', line 12
def run
instance_exec(&@block)
end
|
#test(*args) ⇒ Object
16
17
18
19
20
21
22
|
# File 'lib/sshkit/backends/local.rb', line 16
def test(*args)
options = args..merge(
raise_on_non_zero_exit: false,
verbosity: Logger::DEBUG
)
_execute(*[*args, options]).success?
end
|