bender-bot 0.6.2 → 0.6.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/VERSION +1 -1
  3. data/lib/bender/bot.rb +12 -5
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f4d54bc66c4adb36b8818f5e9d99690cfa9e1469
4
- data.tar.gz: 8228afdc63456046fc27e1b92cc1f88a73c9063e
3
+ metadata.gz: 16a097145cfdcc734e12df57606e67d363c2c614
4
+ data.tar.gz: f1c109b61161bdee403f656b707d1773d331a919
5
5
  SHA512:
6
- metadata.gz: 8a9db7d32cc56a231060920ee4cce4518308c834d67ec2a0b27933dcf499f0bed4ae58c573a5daae024519cfccae70b5eb202cbb965050aeca1645f46a295a90
7
- data.tar.gz: c910eb660ff6df14bc745d50c638d063dc2d3e4c5afe7518d5b82d57774eb128bd738f1f3a40679bf543b9846c012ccfcb7ca3200fef621bcfab9e32e6442d59
6
+ metadata.gz: b2e0bebe81fb108140633f466bbc505271eeb3419db719adaf7e099d11f06200bbfafc6ce51b900b59461081487ccbd64ed46f28226069b2ef0cb3c07d2b9123
7
+ data.tar.gz: e1bc4357247d6e4046e68e1a7b00d767a4b4ad346a9e5be833c783e5e7275b6aa772ab55f44e02b0fd0ed3c02f1e7763fce8c07669d5e50d306bf4c8014b5821
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.6.2
1
+ 0.6.3
@@ -59,7 +59,7 @@ class BenderBot
59
59
  desc: 'Close an incident',
60
60
  },
61
61
  open: {
62
- fmt: "SEVERITY=#{SEVERITIES.keys.sort_by(&:to_i).join(',')} SUMMARY_TEXT",
62
+ fmt: "#{SEVERITY_FIELD.upcase}=#{SEVERITIES.keys.sort_by(&:to_i).join(',')} SUMMARY_TEXT",
63
63
  desc: 'Open a new incident',
64
64
  },
65
65
  summary: {
@@ -160,7 +160,7 @@ class BenderBot
160
160
  unless status =~ /resolved|closed/i
161
161
  '%s (%s - %s) [%s]: %s' % [
162
162
  incident_link(i),
163
- short_severity(i['fields'][SEVERITY_FIELD] && i['fields'][SEVERITY_FIELD]['value']),
163
+ short_severity(sev_for(i)),
164
164
  normalize_value(i['fields']['status']),
165
165
  friendly_date(i['fields']['created']),
166
166
  i['fields']['summary']
@@ -191,8 +191,7 @@ class BenderBot
191
191
  i['fields']['summary']
192
192
  ]
193
193
 
194
- sev = i['fields'][SEVERITY_FIELD]['value'] rescue ''
195
- severities[sev] << repr
194
+ severities[sev_for(i)] << repr
196
195
  statuses[status] += 1
197
196
  end
198
197
  end
@@ -203,7 +202,7 @@ class BenderBot
203
202
  summary << '%s: %d incident(s)' % [ status, size ]
204
203
  end
205
204
  summary << ''
206
- summary << 'By Severity:'
205
+ summary << "By #{SEVERITY_FIELD.capitalize}:"
207
206
  severities.keys.sort.each do |severity|
208
207
  summary << '%s: %d incident(s)' % [
209
208
  short_severity(severity),
@@ -502,4 +501,12 @@ private
502
501
 
503
502
  def prefix ; config[:prefix] end
504
503
 
504
+
505
+ def sev_for i
506
+ sev = if i['fields'][SEVERITY_FIELD]
507
+ i['fields'][SEVERITY_FIELD]['value'] || i['fields'][SEVERITY_FIELD]['name']
508
+ end
509
+ sev.nil? ? '??' : sev
510
+ end
511
+
505
512
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bender-bot
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.2
4
+ version: 0.6.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sean Clemmer