rakep watch #64

wants to merge 4 commits into


None yet

3 participants


Greetings. I was very happy to find the rake pipeline project - thanks!

I wanted to be able to have it automatically update my output for cases when I need to use the output files directly (rather than going through rakep server). I saw that someone else had also requested this feature ( #36 ) so I went ahead and implemented "rakep watch" using the the FSSM gem. It watches for changes in your input directories and the Assetfile itself, and just does an invoke_clean to rebuild everything when any changes are detected.

Please let me know if you have any feedback. And thanks again!

@wagenet wagenet referenced this pull request Mar 8, 2012

rakep 'watch' option #36


You can get away with doing an invoke (not invoke_clean) if no files were created. invoke_clean will also rebuild the rake tasks, which is only needed if new files were created or files were deleted.


You'd also need to invoke_clean when the Assetfile changes to regenerate the tmp directory.


@wycats This is how I was planning on implementing rakep watch, but I know you had some doubts. Is this okay to pull, or do you have something else in mind?


We should make the server use the same underlying infrastructure.

Also, if files only CHANGED, but not files were created or deleted, it's fine to invoke without invoke_clean. The purpose of invoke_clean is to also rebuild the rake tasks, which won't be necessary unless new inputs exist.


Right, that's what happens here. On update, it only does invoke_clean if it's the Assetfile that changed, otherwise it does invoke.


@wycats - Sure, I'll take a look at making the server use the same underlying infrastructure. Just so I'm clear, I think you're saying I should take out the invoke_clean that happens on every server request in the middleware, and instead have FSSM running in the background whenever the server is running, to update the output automatically, so the server just has to serve up the file. Is that correct?


I had some time to work with this again, and found that the FSSM gem was deprecated in favor of the listen gem. I have modified my code to work with the listen gem instead, which I'll open as a separate pull request momentarily. The new pull request will also take the server into account.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment