awsssh 3.1.0 → 3.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +3 -0
- data/lib/awsssh.rb +31 -0
- data/lib/awsssh/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: caeb72480b0957d619eccec899094360a69aae5d
|
4
|
+
data.tar.gz: 6c50e5ec014427ee04beeca9ae0f37d7ad0b8e1a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b58ca402ea1cffed671b172b6de3e16f1bbb6ae9af86173b8132c4f28c6b6b57d3e940b5a22e81830b9f98edf03a3c5e98e43b3424ed20ff0bf3c4a328eddef7
|
7
|
+
data.tar.gz: 408e5fb5e67dd482675b8a8d4ef77a8701f15569a9bb4796b01d50be7b826f3be039798be0469db0059c320e2c5548fc533fc8f2056fcaa95fa93ad7bae40858
|
data/README.md
CHANGED
data/lib/awsssh.rb
CHANGED
@@ -3,6 +3,8 @@ require "thor"
|
|
3
3
|
require "inifile"
|
4
4
|
require "aws-sdk"
|
5
5
|
require "colorize"
|
6
|
+
require "open-uri"
|
7
|
+
require "json"
|
6
8
|
|
7
9
|
|
8
10
|
module Awsssh
|
@@ -18,6 +20,7 @@ module Awsssh
|
|
18
20
|
:stopped => :light_red
|
19
21
|
}
|
20
22
|
}
|
23
|
+
check_version
|
21
24
|
end
|
22
25
|
|
23
26
|
desc "list_profiles", "List all your avavible profiles"
|
@@ -169,5 +172,33 @@ module Awsssh
|
|
169
172
|
exec "ssh #{hostname}"
|
170
173
|
exit 0
|
171
174
|
end
|
175
|
+
|
176
|
+
def check_version
|
177
|
+
temp_file = "/tmp/awsssh_version_check"
|
178
|
+
if File.exists?(temp_file)
|
179
|
+
if ((Time.now - File.mtime(temp_file)) / (60 * 60 * 2)).to_i != 0 # check all 2h
|
180
|
+
check = true
|
181
|
+
else
|
182
|
+
check = false
|
183
|
+
end
|
184
|
+
else
|
185
|
+
check = true
|
186
|
+
end
|
187
|
+
if check
|
188
|
+
begin
|
189
|
+
rubygems = JSON.parse(open("https://rubygems.org/api/v1/versions/awsssh/latest.json").read)
|
190
|
+
if rubygems["version"] != VERSION
|
191
|
+
puts " ############################################".colorize(:red)
|
192
|
+
puts " # You're using an old version of this gem! #".colorize(:red)
|
193
|
+
puts " # Run `gem update awsssh` #".colorize(:red)
|
194
|
+
puts " ############################################".colorize(:red)
|
195
|
+
puts
|
196
|
+
end
|
197
|
+
rescue
|
198
|
+
ensure
|
199
|
+
FileUtils.touch(temp_file)
|
200
|
+
end
|
201
|
+
end
|
202
|
+
end
|
172
203
|
end
|
173
204
|
end
|
data/lib/awsssh/version.rb
CHANGED