class Ec2ssh::Command::Update

Public Class Methods

new(cli) click to toggle source
Calls superclass method Ec2ssh::Command::Base::new
# File lib/ec2ssh/command/update.rb, line 10
def initialize(cli)
  super
end

Public Instance Methods

builder() click to toggle source
# File lib/ec2ssh/command/update.rb, line 25
def builder
  @builder ||= Builder.new dsl
end
dsl() click to toggle source
# File lib/ec2ssh/command/update.rb, line 29
def dsl
  @dsl ||= Ec2ssh::Dsl::Parser.parse File.read(dotfile_path)
end
run() click to toggle source
# File lib/ec2ssh/command/update.rb, line 14
def run
  ssh_config = SshConfig.new(ssh_config_path)
  raise MarkNotFound unless ssh_config.mark_exist?

  ssh_config.parse!
  lines = builder.build_host_lines
  ssh_config_str = ssh_config.wrap lines
  ssh_config.replace! ssh_config_str
  cli.yellow ssh_config_str
end