Class: Guard::Bdd
- Defined in:
- lib/guard/bdd.rb,
lib/guard/bdd/state_machine.rb
Defined Under Namespace
Classes: StateMachine
Constant Summary collapse
- VERSION =
'0.0.1'
Instance Method Summary collapse
-
#initialize(watchers = [], options = {}) ⇒ Bdd
constructor
Initialize a Guard.
-
#run_all ⇒ Object
Called when just ‘enter` is pressed This method should be principally used for long action like running all specs/tests/…
-
#run_on_change(paths) ⇒ Object
Called on file(s) modifications that the Guard watches.
-
#run_on_deletion(paths) ⇒ Object
Called on file(s) deletions that the Guard watches.
-
#start ⇒ Object
Call once when Guard starts.
Constructor Details
#initialize(watchers = [], options = {}) ⇒ Bdd
Initialize a Guard.
12 13 14 15 16 17 18 19 20 21 |
# File 'lib/guard/bdd.rb', line 12 def initialize(watchers = [], = {}) super = { :acceptance_paths => ['spec/acceptance'], :feature_paths => ['features'], :integration_paths => ['spec/integration'], :unit_paths => ['spec/unit'] }.merge() @state_machine = StateMachine.new() end |
Instance Method Details
#run_all ⇒ Object
Called when just ‘enter` is pressed This method should be principally used for long action like running all specs/tests/…
34 35 36 |
# File 'lib/guard/bdd.rb', line 34 def run_all @state_machine.run_all end |
#run_on_change(paths) ⇒ Object
Called on file(s) modifications that the Guard watches.
41 42 43 44 |
# File 'lib/guard/bdd.rb', line 41 def run_on_change(paths) @state_machine.changed_paths = paths @state_machine.run_on_change end |
#run_on_deletion(paths) ⇒ Object
Called on file(s) deletions that the Guard watches.
49 50 51 |
# File 'lib/guard/bdd.rb', line 49 def run_on_deletion(paths) @state_machine.remove(paths) end |
#start ⇒ Object
Call once when Guard starts. Please override initialize method to init stuff.
26 27 28 |
# File 'lib/guard/bdd.rb', line 26 def start @state_machine.startup end |