lib/middleman-webp/pathname_matcher.rb in middleman-webp-0.2.5 vs lib/middleman-webp/pathname_matcher.rb in middleman-webp-0.2.6
- old
+ new
@@ -13,11 +13,11 @@
#
# file - File, Pathname or String
def matches?(path)
return false if path.nil?
- send match_method, path
+ send match_method, Pathname.new(path)
end
private
def match_method
@@ -30,18 +30,18 @@
:matches_glob?
end
end
def matches_glob?(path)
- Pathname.new(path).fnmatch?(@pattern)
+ path.fnmatch?(@pattern)
end
def matches_re?(path)
- !@pattern.match(Pathname.new(path).to_s).nil?
+ !@pattern.match(path.to_s).nil?
end
def matches_proc?(path)
- @pattern.call(Pathname.new(path).to_s)
+ @pattern.call(path.to_s)
end
end
end
end