Skip to content

Commit 12c6a25

Browse files
committed
refactor message formatting
1 parent cbca0d3 commit 12c6a25

1 file changed

Lines changed: 1 addition & 9 deletions

File tree

bin/check-trello-incidents.rb

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -106,15 +106,7 @@ def check_list(host, port, key, token, list)
106106
if incidents.empty?
107107
ok 'No new incidents'
108108
else
109-
msgs = []
110-
incidents.each do |incident|
111-
msgs.push(format('%<name>s %<last_activity>s',
112-
name: incident['name'],
113-
last_activity: incident['dateLastActivity']))
114-
end
115-
msg = msgs.join(';')
116-
117-
critical msg
109+
critical incidents.map { |incident| incident['name'] }.join('; ')
118110
end
119111
end
120112
end

0 commit comments

Comments
 (0)