lib/nanoc/checking/checks/external_links.rb in nanoc-4.9.6 vs lib/nanoc/checking/checks/external_links.rb in nanoc-4.9.7
- old
+ new
@@ -67,11 +67,11 @@
rescue => e
last_err = e
next
end
- if res.code =~ /^3..$/
+ if /^3..$/.match?(res.code)
if i == 4
return Result.new(href, 'too many redirects')
end
location = extract_location(res, url)
@@ -99,10 +99,10 @@
nil
when /^https?:\/\//
location
else
base_url = url.dup
- base_url.path = (location =~ /^\// ? '' : '/')
+ base_url.path = (/^\//.match?(location) ? '' : '/')
base_url.query = nil
base_url.fragment = nil
base_url.to_s + location
end
end