Module: Guard::Deprecated::Watcher::ClassMethods

Defined in:
lib/guard/deprecated/watcher.rb

Constant Summary collapse

MATCH_GUARDFILE =
<<-EOS.gsub(/^\s*/, "")
  Starting with Guard 2.8.3 this method is deprecated.
EOS

Instance Method Summary collapse

Instance Method Details

#match_guardfile?(files) ⇒ Boolean

Returns:

  • (Boolean)

16
17
18
19
20
21
22
23
# File 'lib/guard/deprecated/watcher.rb', line 16

def match_guardfile?(files)
  require "guard/guardfile/evaluator"
  UI.deprecation(MATCH_GUARDFILE)
  options = ::Guard.state.session.evaluator_options
  evaluator = ::Guard::Guardfile::Evaluator.new(options)
  path = evaluator.guardfile_path
  files.any? { |file| File.expand_path(file) == path }
end