module Middleman::Util

def self.path_match(matcher, path)

Returns:
  • (Boolean) - Whether the path matches the matcher

Parameters:
  • path () -- A path as a string
  • matcher () -- A matcher string/regexp/proc/etc
def self.path_match(matcher, path)
  if matcher.respond_to? :match
    matcher.match path
  elsif matcher.respond_to? :call
    matcher.call path
  else
    File.fnmatch(matcher.to_s, path)
  end
end