Module Guard
In: lib/guard/cli.rb
lib/guard/dsl.rb
lib/guard/dsl_describer.rb
lib/guard/group.rb
lib/guard/guard.rb
lib/guard/hook.rb
lib/guard/interactor.rb
lib/guard/listener.rb
lib/guard/listeners/darwin.rb
lib/guard/listeners/linux.rb
lib/guard/listeners/polling.rb
lib/guard/listeners/windows.rb
lib/guard/notifier.rb
lib/guard/ui.rb
lib/guard/version.rb
lib/guard/watcher.rb
lib/guard.rb

Guard is the main module for all Guard related modules and classes. Also other Guard implementation should use this namespace.

Methods

Classes and Modules

Module Guard::Hook
Module Guard::Notifier
Module Guard::UI
Class Guard::CLI
Class Guard::Darwin
Class Guard::Dsl
Class Guard::DslDescriber
Class Guard::Group
Class Guard::Guard
Class Guard::Interactor
Class Guard::Linux
Class Guard::Listener
Class Guard::Polling
Class Guard::Watcher
Class Guard::Windows

Constants

VERSION = '0.8.8'   The current gem version of Guard
GUARDFILE_TEMPLATE = File.expand_path('../guard/templates/Guardfile', __FILE__)   The Guardfile template for `guard init`

Attributes

interactor  [RW] 
listener  [RW] 
lock  [RW] 
options  [RW] 

Public Class methods

Add a Guard group.

@param [String] name the group name @option options [Boolean] halt_on_fail if a task execution

  should be halted for all Guards in this group if one Guard throws `:task_has_failed`

@return [Guard::Group] the group added (or retrieved from the `@groups` variable if already present)

Add a Guard to use.

@param [String] name the Guard name @param [Array<Watcher>] watchers the list of declared watchers @param [Array<Hash>] callbacks the list of callbacks @param [Hash] options the Guard options (see the given Guard documentation) @return [Guard::Guard] the guard added

Detects the paths that have changed.

Deleted paths are prefixed by an exclamation point. @see Guard::Listener#modified_files

@param [Array<String>] paths the watched paths @return [Array<String>] the changed paths

Adds a command logger in debug mode. This wraps common command execution functions and logs the executed command before execution.

Detects the paths that have been deleted.

Deleted paths are prefixed by an exclamation point. @see Guard::Listener#modified_files

@param [Array<String>] paths the watched paths @return [Array<String>] the deleted paths

Tries to load the Guard main class.

@param [String] name the name of the Guard @return [Class, nil] the loaded class

Smart accessor for retrieving a specific group or several groups at once.

@param [NilClass] filter returns all groups @param [String, Symbol] filter return the group with the given name, or nil if not found @param [Regexp] filter returns all groups matching the Regexp, or [] if no group found

@see Guard.guards

Returns a list of guard Gem names installed locally.

@return [Array<String>] a list of guard gem names

Get the symbol we have to catch when running a supervised task. If we are within a Guard group that has the `:halt_on_fail` option set, we do NOT catch it here, it will be catched at the group level.

@see .run_on_guards

@param [Guard::Guard] guard the Guard to execute @return [Symbol] the symbol to catch

Smart accessor for retrieving a specific guard or several guards at once.

@param [String, Symbol] filter return the guard with the given name, or nil if not found @param [Regexp] filter returns all guards matching the Regexp, or [] if no guard found @param [Hash] filter returns all guards matching the given Hash.

  Example: `{ :name => 'rspec', :group => 'backend' }`, or [] if no guard found

@param [NilClass] filter returns all guards

@see Guard.groups

Creates the initial Guardfile template or add a Guard implementation Guardfile template to an existing Guardfile.

@see Guard::Guard.init

@param [String] guard_name the name of the Guard to initialize

Locate a path to a Guard gem.

@param [String] name the name of the Guard without the prefix `guard-` @return [String] the full path to the Guard gem

Pause Guard listening to file changes.

Reload all Guards currently enabled.

@param [Hash] An hash with a guard or a group scope

Initialize the groups array with the `:default` group.

@see Guard.groups

Run a block where the listener and the interactor is blocked.

@yield the block to run

Trigger `run_all` on all Guards currently enabled.

@param [Hash] An hash with a guard or a group scope

Trigger `run_on_change` on all Guards currently enabled.

Run the `:run_on_change` task. When the option `:watch_all_modifications` is set, the task is split to run changed paths on {Guard::Guard#run_on_change}, whereas deleted paths run on {Guard::Guard#run_on_deletion}.

@param [Array<String>] files the list of files to pass to the task @param [Guard::Guard] guard the guard to run @raise [:task_has_failed] when task has failed

Loop through all groups and run the given task (as block) for each Guard.

Stop the task run for the all Guards within a group if one Guard throws `:task_has_failed`.

@param [Hash] An hash with a guard or a group scope

Run a Guard task, but remove the Guard when his work leads to a system failure.

When the Group has `:halt_on_fail` disabled, we‘ve to catch `:task_has_failed` here in order to avoid an uncaught throw error.

@param [Guard::Guard] guard the Guard to execute @param [Symbol] task the task to run @param [Array] args the arguments for the task @raise [:task_has_failed] when task has failed

Initialize the Guard singleton.

@option options [Boolean] clear if auto clear the UI should be done @option options [Boolean] notify if system notifications should be shown @option options [Boolean] debug if debug output should be shown @option options [Array<String>] group the list of groups to start @option options [String] watchdir the director to watch @option options [String] guardfile the path to the Guardfile @option options [Boolean] watch_all_modifications watches all file modifications if true

Start Guard by evaluate the `Guardfile`, initialize the declared Guards and start the available file change listener.

@option options [Boolean] clear if auto clear the UI should be done @option options [Boolean] notify if system notifications should be shown @option options [Boolean] debug if debug output should be shown @option options [Array<String>] group the list of groups to start @option options [String] watchdir the director to watch @option options [String] guardfile the path to the Guardfile

Stop Guard listening to file changes

[Validate]