Class: Tomo::SSH::Options
- Inherits:
-
Object
- Object
- Tomo::SSH::Options
- Defined in:
- lib/tomo/ssh/options.rb
Constant Summary collapse
- DEFAULTS =
{ ssh_connect_timeout: 5, ssh_executable: "ssh", ssh_extra_opts: %w[-o PasswordAuthentication=no].map(&:freeze), ssh_forward_agent: true, ssh_reuse_connections: true, ssh_strict_host_key_checking: "accept-new" }.freeze
Instance Attribute Summary collapse
-
#executable ⇒ Object
readonly
Returns the value of attribute executable.
Instance Method Summary collapse
-
#build_args(host, script, control_path, verbose) ⇒ Object
rubocop:disable Metrics/AbcSize.
-
#initialize(options) ⇒ Options
constructor
A new instance of Options.
Constructor Details
Instance Attribute Details
#executable ⇒ Object
Returns the value of attribute executable.
15 16 17 |
# File 'lib/tomo/ssh/options.rb', line 15 def executable @executable end |
Instance Method Details
#build_args(host, script, control_path, verbose) ⇒ Object
rubocop:disable Metrics/AbcSize
25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/tomo/ssh/options.rb', line 25 def build_args(host, script, control_path, verbose) # rubocop:disable Metrics/AbcSize args = [verbose ? "-v" : ["-o", "LogLevel=ERROR"]] args << "-A" if forward_agent args << connect_timeout_option args << strict_host_key_checking_option args.push(*control_opts(control_path, verbose)) if reuse_connections args.push(*extra_opts) if extra_opts args << "-tt" if script.pty? args << host.to_ssh_args args << "--" [executable, args, script.to_s].flatten end |