Class: SSHKit::Backend::Netssh
Defined Under Namespace
Classes: Configuration
Class Attribute Summary collapse
Attributes inherited from Abstract
#host
Class Method Summary
collapse
Instance Method Summary
collapse
#make, #rake
Methods inherited from Abstract
#as, #debug, #error, #fatal, #info, #initialize, #log, #make, #rake, #trace, #warn, #with, #within
Class Attribute Details
.pool ⇒ Object
Returns the value of attribute pool.
97
98
99
|
# File 'lib/sshkit/backends/netssh.rb', line 97
def pool
@pool
end
|
Class Method Details
.config ⇒ Object
103
104
105
|
# File 'lib/sshkit/backends/netssh.rb', line 103
def config
@config ||= Configuration.new
end
|
99
100
101
|
# File 'lib/sshkit/backends/netssh.rb', line 99
def configure
yield config
end
|
Instance Method Details
#background(*args) ⇒ Object
69
70
71
72
73
|
# File 'lib/sshkit/backends/netssh.rb', line 69
def background(*args)
warn "[Deprecated] The background method is deprecated. Blame badly behaved pseudo-daemons!"
options = args..merge(run_in_background: true)
_execute(*[*args, options]).success?
end
|
#capture(*args) ⇒ Object
75
76
77
78
|
# File 'lib/sshkit/backends/netssh.rb', line 75
def capture(*args)
options = { verbosity: Logger::DEBUG }.merge(args.)
_execute(*[*args, options]).full_stdout.strip
end
|
#download!(remote, local = nil, options = {}) ⇒ Object
87
88
89
90
91
92
|
# File 'lib/sshkit/backends/netssh.rb', line 87
def download!(remote, local=nil, options = {})
summarizer = transfer_summarizer('Downloading')
with_ssh do |ssh|
ssh.scp.download!(remote, local, options, &summarizer)
end
end
|
#execute(*args) ⇒ Object
65
66
67
|
# File 'lib/sshkit/backends/netssh.rb', line 65
def execute(*args)
_execute(*args).success?
end
|
#run ⇒ Object
53
54
55
|
# File 'lib/sshkit/backends/netssh.rb', line 53
def run
instance_exec(host, &@block)
end
|
#test(*args) ⇒ Object
57
58
59
60
61
62
63
|
# File 'lib/sshkit/backends/netssh.rb', line 57
def test(*args)
options = args..merge(
raise_on_non_zero_exit: false,
verbosity: Logger::DEBUG
)
_execute(*[*args, options]).success?
end
|
#upload!(local, remote, options = {}) ⇒ Object
80
81
82
83
84
85
|
# File 'lib/sshkit/backends/netssh.rb', line 80
def upload!(local, remote, options = {})
summarizer = transfer_summarizer('Uploading')
with_ssh do |ssh|
ssh.scp.upload!(local, remote, options, &summarizer)
end
end
|