Class: AWS_SSH::Run

Inherits:
Object
  • Object
show all
Defined in:
lib/aws_ssh/runner.rb

Instance Method Summary collapse

Instance Method Details

#forceObject



16
17
18
19
# File 'lib/aws_ssh/runner.rb', line 16

def force
  ec2 = EC2.new
  ec2.write
end

#generateObject



7
8
9
10
11
12
13
14
# File 'lib/aws_ssh/runner.rb', line 7

def generate
  config = ENV['HOME']+"/.ssh/"+AWS_SSH::HOSTS_FILE
  # 4 hour cache
  if (File.exists?(config) && File.ctime(config) < (Time.now - (AWS_SSH::CACHE_TIME) )) || ! File.exists?(config)
    self.force
    self.merge
  end
end

#mergeObject



21
22
23
# File 'lib/aws_ssh/runner.rb', line 21

def merge
  `#{AWS_SSH::MERGE_CMD}`
end