class Serverkit::Backends::SshBackend
Constants
- DEFAULT_SSH_OPTIONS
Attributes
Public Class Methods
Source
# File lib/serverkit/backends/ssh_backend.rb, line 17 def initialize(host: nil, ssh_options: nil, **args) super(**args) @host = host @ssh_options = ssh_options end
@param [String] host @param [Hash] ssh_options
Calls superclass method
Serverkit::Backends::BaseBackend::new
Private Instance Methods
Source
# File lib/serverkit/backends/ssh_backend.rb, line 26 def specinfra_backend @specinfra_backend ||= ::Specinfra::Backend::Ssh.new( host: host, ssh_options: ssh_options, request_pty: true, ) end
@return [Specinfra::Backend::Ssh]
Source
# File lib/serverkit/backends/ssh_backend.rb, line 35 def ssh_options { user: user }.merge(@ssh_options || DEFAULT_SSH_OPTIONS) end
@return [Hash]
Source
# File lib/serverkit/backends/ssh_backend.rb, line 40 def user ::Net::SSH::Config.for(@host)[:user] || ::Etc.getlogin end
@return [String]