aws_ssh 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/aws_ssh/cache.rb +4 -0
- data/lib/aws_ssh/ec2.rb +1 -1
- data/lib/aws_ssh/runner.rb +4 -2
- data/lib/aws_ssh/version.rb +1 -1
- data/lib/aws_ssh.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a29fb3972592fe9a5515f6b0980977736c7b150e
|
4
|
+
data.tar.gz: 13272a3858270e3a3daeabac3c7c2b82846d544f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e942774c61463151f57ee62eb45d4c4414047b4b5caeb797792ac9845d9cdf5a2dddf356ac79277213d33f853d1d4ac87bbc83e0c45ea0d54c85e1be8b357ea7
|
7
|
+
data.tar.gz: c724c62b75f28e1557fcef2ceaebc7b615f448afbca89e57607d90cf7e425f738ace9e4467ec66c0d41d11ce48883dcecc7bb7cd91da7ad623d378add763f309
|
data/lib/aws_ssh/ec2.rb
CHANGED
@@ -55,7 +55,7 @@ module AWS_SSH
|
|
55
55
|
tags = instance.tags.to_h
|
56
56
|
key_file = nil
|
57
57
|
base = ENV['HOME']+"/.ssh/"+instance.key_name
|
58
|
-
@ssh_key_suffixes.each{|k| if File.exists?(base+k) then key_file = base+k end }
|
58
|
+
@ssh_key_suffixes.each{|k| if key_file.nil? && File.exists?(base+k) then key_file = base+k end }
|
59
59
|
return {
|
60
60
|
:name => if tags["Name"].nil? then nil else tags["Name"].to_s.strip end,
|
61
61
|
:user => if tags["user"].nil? then @User else tags["user"].to_s.strip end,
|
data/lib/aws_ssh/runner.rb
CHANGED
@@ -1,11 +1,13 @@
|
|
1
1
|
require "aws_ssh/files"
|
2
|
+
require "aws_ssh/cache"
|
2
3
|
module AWS_SSH
|
3
4
|
class Run
|
4
5
|
def generate
|
5
|
-
config = AWS_SSH::HOSTS_FILE
|
6
|
+
config = ENV['HOME']+"/.ssh/"+AWS_SSH::HOSTS_FILE
|
6
7
|
# 4 hour cache
|
7
|
-
if (File.exists?(config) && File.mtime(config) < (Time.now - (
|
8
|
+
if (File.exists?(config) && File.mtime(config) < (Time.now - (AWS_SSH::CACHE_TIME) )) || ! File.exists?(config)
|
8
9
|
self.force
|
10
|
+
self.write
|
9
11
|
end
|
10
12
|
end
|
11
13
|
|
data/lib/aws_ssh/version.rb
CHANGED
data/lib/aws_ssh.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: aws_ssh
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Charles Marshall
|
@@ -85,6 +85,7 @@ files:
|
|
85
85
|
- bin/aws_ssh_setup
|
86
86
|
- bin/aws_ssh_teardown
|
87
87
|
- lib/aws_ssh.rb
|
88
|
+
- lib/aws_ssh/cache.rb
|
88
89
|
- lib/aws_ssh/cmds.rb
|
89
90
|
- lib/aws_ssh/ec2.rb
|
90
91
|
- lib/aws_ssh/exceptions.rb
|