fix Middleman::Util.path_match to work with string matchers
This commit is contained in:
parent
6e44851069
commit
b084982923
1 changed files with 3 additions and 1 deletions
|
@ -90,7 +90,9 @@ module Middleman
|
||||||
# @param path A path as a string
|
# @param path A path as a string
|
||||||
# @return [Boolean] Whether the path matches the matcher
|
# @return [Boolean] Whether the path matches the matcher
|
||||||
def self.path_match(matcher, path)
|
def self.path_match(matcher, path)
|
||||||
if matcher.respond_to? :match
|
if matcher.is_a? String
|
||||||
|
path.match matcher
|
||||||
|
elsif matcher.respond_to? :match
|
||||||
matcher.match path
|
matcher.match path
|
||||||
elsif matcher.respond_to? :call
|
elsif matcher.respond_to? :call
|
||||||
matcher.call path
|
matcher.call path
|
||||||
|
|
Loading…
Reference in a new issue