Class: Phase::CLI::SSH

Inherits:
Command show all
Includes:
Mixins::Loggable
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 included from Mixins::Loggable

#fail!, #log

Methods inherited from Command

#initialize

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.



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

def instance=(value)
  @instance = value
end

#username=(value) ⇒ Object

Sets the attribute username

Parameters:

  • value

    the value to set the attribute username to.



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

def username=(value)
  @username = value
end

Instance Method Details

#runObject



24
25
26
27
28
# File 'lib/phase/cli/ssh.rb', line 24

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