class Guard::Watcher

def match(file)

Returns:
  • (Array) - an array of matches (or containing a single path

Parameters:
  • file (String) -- the file to test
def match(file)
  f = file
  deleted = file.start_with?('!')
  f = deleted ? f[1..-1] : f
  if @pattern.is_a?(Regexp)
    if m = f.match(@pattern)
      m = m.to_a
      m[0] = file
      m
    end
  else
    f == @pattern ? [file] : nil
  end
end