# File lib/guard/watcher.rb, line 46 def self.match_files(guard, files) return [] if files.empty? guard.watchers.inject([]) do |paths, watcher| files.each do |file| if matches = watcher.match(file) if watcher.action result = watcher.call_action(matches) if guard.options[:any_return] paths << result elsif result.respond_to?(:empty?) && !result.empty? paths << Array(result) end else paths << matches[0] end end end guard.options[:any_return] ? paths : paths.flatten.map { |p| p.to_s } end end