sport_ngin_aws_auditor 3.2.0 → 3.3.0

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: 41d1decba10c84cc01e2651addad2e71c88aa467
4
- data.tar.gz: 2a346488fc698a3ac5de44bd7a8e7e7f300d6d42
3
+ metadata.gz: de82e361c575984d1e01122170cd265345d56f0c
4
+ data.tar.gz: a88b8df2c897593871c79f6cb637b81b8d928716
5
5
  SHA512:
6
- metadata.gz: a47cd28e41a0e7cb599d1c271dba4424951e607589f41ae991c46df5469ba2d1edcba86e08ba6d63aceef9d562bbdaee28e9d6bea0affb88815a075e4486abac
7
- data.tar.gz: 30eeda03adf4d0d718a9df08706fe575693a0d9ccdc88bc6202be9daca0bca2e2a3295e7ebc594f50105fc4b1105511a95a503a87e4f8a87126dd470621212f4
6
+ metadata.gz: 768a03ae321131c4fa4dda61a9e7311a41df2c43cb82f98652a1f8ceb9eb46d8cb559be08b592da2bea2fa2cc9466f9f7936f3bcbd557c20b3fedd0c38ad8acc
7
+ data.tar.gz: 95d1340b3e0a48d080d0b8a36d17cd6cfb7d725e35a31511b8c15f80f1674f22540f34ee5e0be2cc7f118dee8df86b506f62011fc65c71a59e496ba123dcda85
data/CHANGELOG.markdown CHANGED
@@ -1,3 +1,8 @@
1
+ #### v3.3.0
2
+ * Slack should print instances that have tags
3
+
4
+ > Emma Sax: Andy Fleener: https://github.com/sportngin/sport_ngin_aws_auditor/pull/12
5
+
1
6
  #### v3.2.0
2
7
  * Proper recognition of windows/linux/vpc instances
3
8
 
@@ -69,9 +69,8 @@ module SportNginAwsAuditor
69
69
 
70
70
  def self.colorize(key, value)
71
71
  if key.include?(" with tag")
72
- k = key.dup # because key is a frozen string right now
73
- k.slice!(" with tag")
74
- say "<%= color('#{k}: #{"*" << value.to_s}', :blue) %>"
72
+ key, value = modify_tag_prints(key, value)
73
+ say "<%= color('#{key}: #{value}', :blue) %>"
75
74
  elsif value < 0
76
75
  say "<%= color('#{key}: #{value}', :yellow) %>"
77
76
  elsif value == 0
@@ -84,7 +83,7 @@ module SportNginAwsAuditor
84
83
  def self.print_to_slack(instances_hash, class_type, environment)
85
84
  discrepancy_hash = Hash.new
86
85
  instances_hash.each do |key, value|
87
- if !(value == 0) && !(key.include?(" with tag"))
86
+ if value != 0
88
87
  discrepancy_hash[key] = value
89
88
  end
90
89
  end
@@ -102,6 +101,9 @@ module SportNginAwsAuditor
102
101
  to_print << "#{header(class_type)}\n"
103
102
 
104
103
  discrepancy_hash.each do |key, value|
104
+ if key.include?(" with tag")
105
+ key, value = modify_tag_prints(key, value)
106
+ end
105
107
  to_print << "#{key}: #{value}\n"
106
108
  end
107
109
 
@@ -109,6 +111,12 @@ module SportNginAwsAuditor
109
111
  slack_job.perform
110
112
  end
111
113
 
114
+ def self.modify_tag_prints(key, value)
115
+ key = key.dup # because key is a frozen string right now
116
+ key.slice!(" with tag")
117
+ return key, "*" << value.to_s
118
+ end
119
+
112
120
  def self.header(type, length = 50)
113
121
  type.upcase!.slice! "INSTANCE"
114
122
  half_length = (length - type.length)/2.0 - 1
@@ -1,3 +1,3 @@
1
1
  module SportNginAwsAuditor
2
- VERSION = "3.2.0"
2
+ VERSION = "3.3.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sport_ngin_aws_auditor
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.2.0
4
+ version: 3.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Elliot Hursh
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2016-07-11 00:00:00.000000000 Z
13
+ date: 2016-07-14 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: aws-sdk