Class: Guard::Middleman
Instance Method Summary collapse
- #bundler? ⇒ Boolean
-
#initialize(watchers = [], options = {}) ⇒ Middleman
constructor
A new instance of Middleman.
-
#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_change(paths) ⇒ Object
Called on file(s) modifications.
-
#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 = {}) ⇒ Middleman
Returns a new instance of Middleman.
7 8 9 10 11 12 13 |
# File 'lib/guard/middleman.rb', line 7 def initialize(watchers=[], ={}) super # init stuff here, thx! @options = Thor::CoreExt::HashWithIndifferentAccess.new( {:bundler => File.exist?("#{Dir.pwd}/Gemfile")}.merge() ) end |
Instance Method Details
#bundler? ⇒ Boolean
15 16 17 |
# File 'lib/guard/middleman.rb', line 15 def bundler? @options[:bundler] end |
#reload ⇒ Object
Called on Ctrl-Z signal This method should be mainly used for “reload” (really!) actions like reloading passenger/spork/bundler/…
39 40 41 |
# File 'lib/guard/middleman.rb', line 39 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/…
45 46 47 |
# File 'lib/guard/middleman.rb', line 45 def run_all system(build_command) end |
#run_on_change(paths) ⇒ Object
Called on file(s) modifications
50 51 52 |
# File 'lib/guard/middleman.rb', line 50 def run_on_change(paths) system(build_command) end |
#start ⇒ Object
Called once when Guard starts Please override initialize method to init stuff
28 29 30 |
# File 'lib/guard/middleman.rb', line 28 def start true end |
#stop ⇒ Object
Called on Ctrl-C signal (when Guard quits)
33 34 35 |
# File 'lib/guard/middleman.rb', line 33 def stop true end |