rubyist / guard-rake

guard-rake runs a rake task when files change
MIT License
94 stars 32 forks source link

Run different task depending on changed file #15

Open jmuheim opened 12 years ago

jmuheim commented 12 years ago

I like your gem, but it's seems very limiting that only one specific rake task can be run after changing several files.

It would be nicer to have something like this:

guard 'rake' do
  watch('db/seeds.rb') { 'db:seed' }
end
jmuheim commented 12 years ago

Okay, I just found out that it's possible to have many of these rake guards living next to each other:

guard 'rake' do
  watch('db/seeds.rb') { 'db:seed' }
end

guard 'rake' do
  watch('bla.rb') { 'bla' }
end

Maybe you could point this out in the documentation. And still, somehow this feels more natural to me:

guard 'rake' do
  watch('db/seeds.rb') { 'db:seed' }
end

But maybe it's an (unwritten?) law that the block after watch(...) always only must return a path to a file...?