bin/check-consul-leader.rb in sensu-plugins-consul-0.0.7 vs bin/check-consul-leader.rb in sensu-plugins-consul-0.1.7
- old
+ new
@@ -59,10 +59,10 @@
end
def strip_ip(str)
ipv4_regex = '(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])'
ipv6_regex = '\[.*\]'
- if str =~ /^.*#{ipv4_regex}.*$/
+ if str =~ /^.*#{ipv4_regex}.*$/ # rubocop:disable Style/GuardClause
return str.match(/#{ipv4_regex}/)
elsif str =~ /^.*#{ipv6_regex}.*$/
return str[/#{ipv6_regex}/][1..-2]
else
return str