Module for notifying test result to terminal title
GUARDFILE_TEMPLATE | = | File.expand_path('../guard/templates/Guardfile', __FILE__) | The Guardfile template for `guard init` | |
HOME_TEMPLATES | = | File.expand_path('~/.guard/templates') | The location of user defined templates | |
WINDOWS | = | RbConfig::CONFIG['host_os'] =~ %r!(msdos|mswin|djgpp|mingw)! | ||
DEV_NULL | = | WINDOWS ? 'NUL' : '/dev/null' | ||
WATCH_ALL_MODIFICATIONS_DEPRECATION | = | <<-EOS.gsub(/^\s*/, '') Starting with Guard v1.1 the 'watch_all_modifications' option is removed and is now always on. EOS .gsub(/^\s*/, '') | Deprecation message for the `watch_all_modifications` start option | |
NO_VENDOR_DEPRECATION | = | <<-EOS.gsub(/^\s*/, '') Starting with Guard v1.1 the 'no_vendor' option is removed because the monitoring gems are now part of a new gem called Listen. (https://github.com/guard/listen) You can specify a custom version of any monitoring gem directly in your Gemfile if you want to overwrite Listen's default monitoring gems. EOS .gsub(/^\s*/, '') | Deprecation message for the `no_vendor` start option | |
VERSION | = | '1.6.2' | The current gem version of Guard |
interactor | [RW] | |
listener | [RW] | |
lock | [RW] | |
options | [RW] | |
runner | [RW] | |
running | [RW] | |
scope | [RW] |
Add a Guard plugin group.
@param [String] name the group name @option options [Boolean] halt_on_fail if a task execution
should be halted for all Guard plugins 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 plugin 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 plugin options (see the given Guard documentation) @return [Guard::Guard] the added Guard plugin
Convert the old scope format to the new scope format.
@example Convert old scopes
convert_scopes({ :guard => :rspec, :group => :backend }) => { :plugins => [:rspec], :groups => [:backend] }
Adds a command logger in debug mode. This wraps common command execution functions and logs the executed command before execution.
Tries to load the Guard plugin main class. This transforms the supplied Guard plugin name into a class name:
When no class is found with the strict case sensitive rules, another try is made to locate the class without matching case:
@param [String] name the name of the Guard @param [Boolean] fail_gracefully whether error messages should not be printed @return [Class, nil] the loaded class
Smart accessor for retrieving a specific plugin group or several plugin groups at once.
@see Guard.guards
@example Filter groups by String or Symbol
Guard.groups('backend') Guard.groups(:backend)
@example Filter groups by Regexp
Guard.groups(/(back|front)end/)
@param [String, Symbol, Regexp] filter the filter to apply to the Groups @return [Array<Group>] the filtered groups
Smart accessor for retrieving a specific Guard plugin or several Guard plugins at once.
@see Guard.groups
@example Filter Guard plugins by String or Symbol
Guard.guards('rspec') Guard.guards(:rspec)
@example Filter Guard plugins by Regexp
Guard.guards(/rsp.+/)
@example Filter Guard plugins by Hash
Guard.guards({ :name => 'rspec', :group => 'backend' })
@param [String, Symbol, Regexp, Hash] filter the filter to apply to the Guard plugins @return [Array<Guard>] the filtered Guard plugins
Determine if Guard needs to quit. This checks for Ctrl-D pressed.
@return [Boolean] whether to quit or not
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 @deprecated @option options [Boolean] watch_all_modifications watches all file modifications if true @deprecated @option options [Boolean] no_vendor ignore vendored dependencies
Start Guard by evaluating the `Guardfile`, initializing declared Guard plugins and starting the available file change listener. Main method for Guard that is called from the CLI when Guard starts.
@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