ec2-host 0.2.1 → 0.2.3

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: a11603984da7e55345504bce0b96e21a903d26f9
4
- data.tar.gz: d01d8ea00adca128ad0e2eb0036725fd4cd2cffa
3
+ metadata.gz: 26bbe969dcb79b034feceb28ffb1416399a5c907
4
+ data.tar.gz: 8f8659465c4774b7d2b1268063123265d578d02c
5
5
  SHA512:
6
- metadata.gz: a047cb53fc0a9f1c7234ccd8df891e23223574d8d389d7b968cab5da6890ecf171d71157f916d0122a2b24a2942422be3b61a686244f1784b8c92728914cb131
7
- data.tar.gz: 26074ba59e96bf6b71c52862667b882db1d7254b5d053f3e537bdd51f8f1996cb7849fe2c19de186380e69ba7b84863b59e2f1efb25ea3a7576b303def3123d9
6
+ metadata.gz: 01aec0e3eb94ce83b476e38ce5a7397b96daa2a1723b36a917a4a3fc5433f09958afdf69b80ed5b3fd2e78750c847af2f9c5e02bdfdb1d4ee5e3a95d5aae94cc
7
+ data.tar.gz: cc5fd0f347cfb14439aeb7d1757e5d808125aeaa2c0ea76558c34e7c12a7d79ab0afcc74a91c431e9c5ae36b4a079900e2e74dd8174fb67b5ae372969396b3a0
@@ -1,3 +1,13 @@
1
+ # 0.2.3 (2015/08/28)
2
+
3
+ Changes:
4
+
5
+ * Remove shutting-down hosts from lists in addition to terminated as default
6
+
7
+ # 0.2.2 (2015/08/28)
8
+
9
+ yanked
10
+
1
11
  # 0.2.1 (2015/08/26)
2
12
 
3
13
  Fixes:
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |gem|
2
2
  gem.name = "ec2-host"
3
- gem.version = '0.2.1'
3
+ gem.version = '0.2.3'
4
4
  gem.author = ['Naotoshi Seo']
5
5
  gem.email = ['sonots@gmail.com']
6
6
  gem.homepage = 'https://github.com/sonots/ec2-host'
@@ -41,7 +41,7 @@ class EC2
41
41
  #
42
42
  # @param [Hash] condition search parameters
43
43
  def match?(condition)
44
- return false if !condition[:state] and terminated? # remove terminated host from lists as default
44
+ return false if !condition[:state] and (terminated? or shutting_down?)
45
45
  return false unless role_match?(condition)
46
46
  condition = HashUtil.except(condition,
47
47
  :role, :role1, :role2, :role3,
@@ -99,6 +99,26 @@ class EC2
99
99
  state == "terminated"
100
100
  end
101
101
 
102
+ def shutting_down?
103
+ state == "shutting-down"
104
+ end
105
+
106
+ def stopping?
107
+ state == "stopping"
108
+ end
109
+
110
+ def stopped
111
+ state == "stopped"
112
+ end
113
+
114
+ def running?
115
+ state == "running"
116
+ end
117
+
118
+ def pending?
119
+ state == "pending"
120
+ end
121
+
102
122
  def role_match?(condition)
103
123
  # usage is an alias of role
104
124
  if role = (condition[:role] || condition[:usage])
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ec2-host
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Naotoshi Seo
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-08-26 00:00:00.000000000 Z
11
+ date: 2015-08-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk