Class: Guard::Frank
Instance Method Summary collapse
-
#initialize(watchers = [], options = {}) ⇒ Frank
constructor
Initialize a Guard.
-
#reload ⇒ Object
Called when ‘reload|r|z + enter` is pressed.
-
#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_changes(paths) ⇒ Object
Called on file(s) modifications that the Guard watches.
- #run_on_removals(paths) ⇒ Object
-
#start ⇒ Object
Call once when Guard starts.
-
#stop ⇒ Object
Called when ‘stop|quit|exit|s|q|e + enter` is pressed (when Guard quits).
Constructor Details
#initialize(watchers = [], options = {}) ⇒ Frank
Initialize a Guard.
12 13 14 15 16 17 |
# File 'lib/guard/frank.rb', line 12 def initialize(watchers = [], = {}) super @options = { :all_on_start => true, }.update() end |
Instance Method Details
#reload ⇒ Object
Called when ‘reload|r|z + enter` is pressed. This method should be mainly used for “reload” (really!) actions like reloading passenger/spork/bundler/…
38 39 |
# File 'lib/guard/frank.rb', line 38 def reload end |
#run_all ⇒ Object
Called when just ‘enter` is pressed This method should be principally used for long action like running all specs/tests/…
44 45 46 |
# File 'lib/guard/frank.rb', line 44 def run_all run("features") end |
#run_on_changes(paths) ⇒ Object
Called on file(s) modifications that the Guard watches.
51 52 53 |
# File 'lib/guard/frank.rb', line 51 def run_on_changes(paths) run(paths) end |
#run_on_removals(paths) ⇒ Object
55 56 57 |
# File 'lib/guard/frank.rb', line 55 def run_on_removals(paths) super end |
#start ⇒ Object
Call once when Guard starts. Please override initialize method to init stuff.
21 22 23 24 25 26 27 28 |
# File 'lib/guard/frank.rb', line 21 def start @runner = Runner.new @options if @runner.nil? @raise [:task_has_failed] end notify_start run_all if @options[:all_on_start] end |
#stop ⇒ Object
Called when ‘stop|quit|exit|s|q|e + enter` is pressed (when Guard quits).
32 33 |
# File 'lib/guard/frank.rb', line 32 def stop end |