Reloading Guardfile on changes to files other than

2019-03-01 06:48发布

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?

标签: ruby guard
1条回答
姐就是有狂的资本
2楼-- · 2019-03-01 07:17

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).

查看更多
登录 后发表回答