livingsocial / rake-pipeline

An extension to Rake for dealing with a directory of inputs, a number of filters, and a directory of outputs
MIT License
276 stars 38 forks source link

Rakep Watch, using Listen gem #75

Closed melindaweathers closed 12 years ago

melindaweathers commented 12 years ago

This is a new attempt at the rakep watch functionality, using the Listen gem instead of FSSM for file monitoring. In addition, as requested on my previous pull request, I have modified the server to not worry about rebuilding the outputs. Instead, "rakep server" starts up a non-blocking watcher to rebuild the outputs as needed.

There are a couple questions I had, the first of which is actually a todo in the code:

  1. The Listen gem uses regex filters, instead of globs, to filter the set of files that it watches. However, the Pipeline inputs are defined to take only globs. I see the Matcher now has a private method to turn a glob into a regex. I would like to expose that so it can be used by the Watcher on the pipeline input glob as well, perhaps by moving it into a new module. Does that sound reasonable?
  2. I deleted a few specs from the Middleware, since the Middleware is no longer responsible for rebuilding the output. I could add these back as integration specs if there is interest. It would probably need to involve some "sleep" to give time for the Watcher to rebuild the files in a separate thread, which seems a little clunky.

Please let me know your thoughts on these two items, and any other general thoughts, and I will be happy to finish it up. Thanks!

melindaweathers commented 12 years ago

Oh shoot, just after submitting this, I realized how far out of date my branch is. Sorry. Let me rebase and submit a new branch.