问题
Currently, Guard::Setuper reloads just the Guardfile when it changes.
I'm loading some additional code into my guard file (via require
), and I'd like to also reload when some of those required files change.
I guess I'm really just looking for a plugin, but that seems like I'd be trying resurrect guard-ego. Is there a better way of accomplishing this?
回答1:
You could probably try something like this in your Guardfile (using guard-shell):
guard :shell do
watch(%r{path/to/your/required/files}) { Guard.evaluator.reevaluate_guardfile }
end
@Zach: Up-to-date documentation is at http://guardgem.org (usage) and http://rubydoc.info/github/guard/guard/master/frames (technical).
来源:https://stackoverflow.com/questions/22511991/reloading-guardfile-on-changes-to-files-other-than-the-guardfile