Reloading Guardfile on changes to files other than the Guardfile

让人想犯罪 __ 提交于 2019-12-02 14:27:44

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!