class Guard::Dsl
def watch(pattern, &action)
- See: #guard -
See: Guard::Watcher -
Other tags:
- Yieldreturn: - a directory, a filename, an array of
Other tags:
- Yieldparam: m - matches of the pattern
Other tags:
- Yield: - a block to be run when the pattern is matched
Parameters:
-
pattern
(String, Regexp
) -- the pattern that Guard must watch for
Other tags:
- Example: Declare global watchers outside of a Guard -
Example: Declare watchers for a Guard -
def watch(pattern, &action) # Allow watches in the global scope (to execute arbitrary commands) by # building a generic Guard::Plugin. @plugin_options ||= nil return guard(:plugin) { watch(pattern, &action) } unless @plugin_options @plugin_options[:watchers] << Watcher.new(pattern, action) end