Class: Phase::CLI::SSH

Inherits:
Command show all
Defined in:
lib/phase/cli/ssh.rb

Direct Known Subclasses

Mosh

Instance Attribute Summary collapse

Attributes inherited from Command

#args, #options

Instance Method Summary collapse

Methods inherited from Command

#initialize

Methods included from Util::Console

#fail, #log

Constructor Details

This class inherits a constructor from Phase::CLI::Command

Instance Attribute Details

#instance=(value) ⇒ Object

Sets the attribute instance

Parameters:

  • value

    the value to set the attribute instance to.



20
21
22
# File 'lib/phase/cli/ssh.rb', line 20

def instance=(value)
  @instance = value
end

#username=(value) ⇒ Object

Sets the attribute username

Parameters:

  • value

    the value to set the attribute username to.



20
21
22
# File 'lib/phase/cli/ssh.rb', line 20

def username=(value)
  @username = value
end

Instance Method Details

#runObject



22
23
24
25
26
# File 'lib/phase/cli/ssh.rb', line 22

def run
  parse_connection_string
  log "connecting to instance #{ instance.resource.id }..."
  exec "#{ options.conn } #{ username }@#{ instance.resource.dns_name }"
end