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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 71e530b89ccea7c6954872d846d25a9fa50f1827
4
- data.tar.gz: 461fb7bbe46bb14a47d01ea81e18fb6067b7978b
3
+ metadata.gz: caeb72480b0957d619eccec899094360a69aae5d
4
+ data.tar.gz: 6c50e5ec014427ee04beeca9ae0f37d7ad0b8e1a
5
5
  SHA512:
6
- metadata.gz: 9f29fc4c05cbe9da050d7dc0efa8dae84a2b80da3d1a561eedcd1cdfbce1f7765833dae7315677ccc47c83c2450b8c2d9d1e62ca7e298cdc3c441f584a04c775
7
- data.tar.gz: 95383297c9c9f82410e0b576cb6dc56b0e093b497344894e88374c20680ae4f0b64f12921759381a4ecc4ad1a2c9749fa1132721b807dfc8268b9bddb7be4fd5
6
+ metadata.gz: b58ca402ea1cffed671b172b6de3e16f1bbb6ae9af86173b8132c4f28c6b6b57d3e940b5a22e81830b9f98edf03a3c5e98e43b3424ed20ff0bf3c4a328eddef7
7
+ data.tar.gz: 408e5fb5e67dd482675b8a8d4ef77a8701f15569a9bb4796b01d50be7b826f3be039798be0469db0059c320e2c5548fc533fc8f2056fcaa95fa93ad7bae40858
data/README.md CHANGED
@@ -61,6 +61,9 @@ issues:
61
61
  [github](https://github.com/sethiele/awsssh)
62
62
 
63
63
  ## Changelog
64
+ **2016-02-24 - v 3.1.1**
65
+ * [enh] Version Check
66
+
64
67
  **2016-02-24 - v 3.1.0**
65
68
  * [enh] Show only online Server
66
69
  * [enh] colors in output
@@ -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
@@ -1,3 +1,3 @@
1
1
  module Awsssh
2
- VERSION = "3.1.0"
2
+ VERSION = "3.1.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: awsssh
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.0
4
+ version: 3.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sebastian Thiele