bin/check-trello-incidents.rb in sensu-plugins-trello-0.2.3 vs bin/check-trello-incidents.rb in sensu-plugins-trello-0.2.4
- old
+ new
@@ -1,6 +1,8 @@
#!/usr/bin/env ruby
+# frozen_string_literal: true
+
#
# Check for new incidents in Trello
#
# DESCRIPTION:
# Checks for cards in a trello list. If cards are present, the check returns
@@ -85,12 +87,10 @@
unknown 'Connection timed out'
end
end
def check_list(host, port, key, token, list)
- if list.match(/\A[a-z0-9]*\z/).nil?
- raise format('Invalid value for list parameter: %<list>s', list: list)
- end
+ raise format('Invalid value for list parameter: %<list>s', list: list) if list.match(/\A[a-z0-9]*\z/).nil?
path = format('/1/lists/%<list>s/cards', list: list)
uri = URI.parse(format('https://%<host>s:%<port>d%<path>s',
host: host, port: port, path: path))