Class | Guard::Interactor |
In: |
lib/guard/interactor.rb
|
Parent: | Object |
The interactor triggers specific action from input read by a interactor implementation.
Currently the following actions are implemented:
It‘s also possible to scope `reload` and `run all` actions to only a specified group or a guard.
@example Reload backend group
backend reload reload backend
@example Reload rspec guard
spork reload reload spork
@example Run all jasmine specs
jasmine
@abstract
ACTIONS | = | { :help => %w[help h], :reload => %w[reload r], :stop => %w[exit e quit q], :pause => %w[pause p], :notification => %w[notification n], :show => %w[show s], :change => %w[change c] |
Tries to detect an optimal interactor for the current environment.
It returns the Readline implementation when:
Otherwise the plain gets interactor is returned.
@return [Interactor] an interactor implementation
Template method for checking if the Interactor is available in the current environment?
@param [Boolean] silent true if no error messages should be shown @return [Boolean] the availability status
Get an instance of the currently configured interactor implementation.
@return [Interactor] an interactor implementation
Extract the Guard or group scope and action from the input line. There‘s no strict order for scopes and actions.
@example `spork reload` will only reload rspec @example `jasmine` will only run all jasmine specs
@param [String] line the readline input @return [Array] the group or guard scope, the action and the rest