Class: Guard::Chef
Defined Under Namespace
Classes: Base
Instance Method Summary collapse
-
#initialize(watchers = [], options = {}) ⇒ Chef
constructor
A new instance of Chef.
-
#reload ⇒ Object
Called on Ctrl-Z signal This method should be mainly used for “reload” (really!) actions like reloading passenger/spork/bundler/…
-
#run_all ⇒ Object
Called on Ctrl-/ signal This method should be principally used for long action like running all specs/tests/…
-
#run_on_changes(paths) ⇒ Object
Called on file modifications and additions.
-
#run_on_removals(paths) ⇒ Object
warn a user that we don’t do anything to handle deleted files.
-
#start ⇒ Object
Called once when Guard starts Please override initialize method to init stuff.
-
#stop ⇒ Object
Called on Ctrl-C signal (when Guard quits).
Constructor Details
#initialize(watchers = [], options = {}) ⇒ Chef
Returns a new instance of Chef.
10 11 12 13 14 |
# File 'lib/guard/chef.rb', line 10 def initialize(watchers=[], ={}) super @base_dir = ::File.('../../../', __FILE__) # init stuff here, thx! end |
Instance Method Details
#reload ⇒ Object
Called on Ctrl-Z signal This method should be mainly used for “reload” (really!) actions like reloading passenger/spork/bundler/…
36 37 38 |
# File 'lib/guard/chef.rb', line 36 def reload true end |
#run_all ⇒ Object
Called on Ctrl-/ signal This method should be principally used for long action like running all specs/tests/…
42 43 44 |
# File 'lib/guard/chef.rb', line 42 def run_all true end |
#run_on_changes(paths) ⇒ Object
Called on file modifications and additions
47 48 49 50 51 52 53 54 |
# File 'lib/guard/chef.rb', line 47 def run_on_changes(paths) paths.each do |path| unless updated?(path) return false end end true end |
#run_on_removals(paths) ⇒ Object
warn a user that we don’t do anything to handle deleted files. does not call super, so guard action isn’t triggered
58 59 60 61 62 |
# File 'lib/guard/chef.rb', line 58 def run_on_removals(paths) paths.each do |path| warn "file #{path} removed -- it's up to you to remove it from the server if desired" end end |
#start ⇒ Object
Called once when Guard starts Please override initialize method to init stuff
25 26 27 |
# File 'lib/guard/chef.rb', line 25 def start true end |
#stop ⇒ Object
Called on Ctrl-C signal (when Guard quits)
30 31 32 |
# File 'lib/guard/chef.rb', line 30 def stop true end |