Class | Guard::Runner |
In: |
lib/guard/runner.rb
|
Parent: | Object |
The runner is responsible for running all methods defined on each guards.
RUN_ON_CHANGE_DEPRECATION | = | <<-EOS.gsub(/^\s*/, '') Starting with Guard v1.1 the use of the 'run_on_change' method in the '%s' guard is deprecated. Please consider replacing that method-call with 'run_on_changes' if the type of change is not important for your usecase or using either 'run_on_modifications' or 'run_on_additions' based on the type of the changes you want to handle. For more information on how to update existing guards, please head over to: https://github.com/guard/guard/wiki/Upgrade-guide-for-existing-guards-to-Guard-v1.1 EOS .gsub(/^\s*/, '') | Deprecation message for the `run_on_change` method | |
RUN_ON_DELETION_DEPRECATION | = | <<-EOS.gsub(/^\s*/, '') Starting with Guard v1.1 the use of the 'run_on_deletion' method in the '%s' guard is deprecated. Please consider replacing that method-call with 'run_on_removals' for future proofing your code. For more information on how to update existing guards, please head over to: https://github.com/guard/guard/wiki/Upgrade-guide-for-existing-guards-to-Guard-v1.1 EOS .gsub(/^\s*/, '') | Deprecation message for the `run_on_deletion` method | |
MODIFICATION_TASKS | = | [:run_on_modifications, :run_on_changes, :run_on_change] | ||
ADDITION_TASKS | = | [:run_on_additions, :run_on_changes, :run_on_change] | ||
REMOVAL_TASKS | = | [:run_on_removals, :run_on_changes, :run_on_deletion] |
Returns the symbol that has to be caught when running a supervised task.
@note If a Guard group is being run and it has the `:halt_on_fail`
option set, this method returns :no_catch as it will be caught at the group level.
@see .scoped_guards
@param [Guard::Guard] guard the Guard plugin to execute @return [Symbol] the symbol to catch
Runs the appropriate tasks on all registered guards based on the passed changes.
@param [Array<String>] modified the modified paths. @param [Array<String>] added the added paths. @param [Array<String>] removed the removed paths.
Run a Guard plugin task, but remove the Guard plugin 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