Class: Ec2ssh::Command::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/ec2ssh/command.rb

Direct Known Subclasses

Init, Remove, Update

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(cli) ⇒ Base

Returns a new instance of Base.



8
9
10
# File 'lib/ec2ssh/command.rb', line 8

def initialize(cli)
  @cli = cli
end

Instance Attribute Details

#cliObject (readonly)

Returns the value of attribute cli.



6
7
8
# File 'lib/ec2ssh/command.rb', line 6

def cli
  @cli
end

Instance Method Details

#dotfileObject



12
13
14
# File 'lib/ec2ssh/command.rb', line 12

def dotfile
  @dotfile ||= Ec2ssh::Dsl::Parser.parse_file(dotfile_path)
end

#dotfile_pathObject



20
21
22
# File 'lib/ec2ssh/command.rb', line 20

def dotfile_path
  cli.options.dotfile
end

#ssh_config_pathObject



16
17
18
# File 'lib/ec2ssh/command.rb', line 16

def ssh_config_path
  cli.options.path || dotfile.path || "#{ENV['HOME']}/.ssh/config"
end