cpjolicoeur/guard-annotate — Issue #4: annotate run at reload despite :run_at_start => false
Author: LeahCim
Created: 2012-01-03 19:10:26+00:00
State: open

Craig, thanks for the quick reply to the other issue I raised (#3). I should have created a separate issue for the other half of that one, as it is conceptually separate, so here goes...

In the most recent code (GitHub), annotate is still run at reload (e.g. after pressing r in the guard console), which I think shouldn't happen. In my case, by pressing r I intend to reload Spork and RSpec, but still want annotate to only run at file change.

As per documentation at http://rubydoc.info/github/guard/guard/master/Guard/Guard:reload :

"Called when reload|r|z + enter is pressed. This method should be mainly used for "reload" (really!) actions like reloading passenger/spork/bundler/..."

The fix I can propose is changing (lib/guard/annotate.rb):

def reload
run_annotate
end

... to

def reload
run_annotate if options[:run_at_start]
end

Thanks again!
Michael