lib/whatweb/matcher/url.rb in simple_whatweb-0.1.0 vs lib/whatweb/matcher/url.rb in simple_whatweb-0.2.0
- old
+ new
@@ -1,5 +1,7 @@
+# frozen_string_literal: true
+
module WhatWeb
module Matcher
class URL < Base
attr_reader :url
def initialize(target, match)
@@ -19,14 +21,14 @@
if is_relative? && !has_query?
target.uri.path.match? /#{url}$/
elsif is_relative? && has_query?
"#{target.uri.path}?#{target.uri.query}".match? /#{url}$/
elsif !is_relative? && has_query?
- "#{target.uri.path}?#{target.uri.query}" == url
+ url == "#{target.uri.path}?#{target.uri.query}"
else
# !is_relative? && !has_query?
target.uri.path == url
end
end
end
end
-end
\ No newline at end of file
+end