guard / guard-bundler

Guard::Bundler automatically install/update your gem bundle when needed
https://rubygems.org/gems/guard-bundler
MIT License
117 stars 22 forks source link

watch Gemfile.lock too #30

Closed timoschilling closed 8 years ago

timoschilling commented 9 years ago

Even the Gemfile.lock should be watched to trigger bundle on updates from repo changes

e2 commented 9 years ago

I don't think this is a good idea, since running bundle can change the Gemfile.lock file again, resulting in bundler running multiple times.

This is because Gemfile.lock is mostly an 'output file'. (Though, when it changes, you'll likely want the Rails app reloaded instead, etc.)

If you're changing the Gemfile.lock as a result of a branch checkout in a Rails project, it's better to setup git hooks to touch the Gemfile automatically.

What's your use case for this?

e2 commented 9 years ago

Oh, and it's best to restart Guard when the repo changes - so you may prefer to run guard-bundler on startup anyway.