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!
Add a 'rakep watch' command that rebuilds the output whenever the inp…
…uts or the Assetfile changes
rakep watch: use invoke_clean rather than invoke so we don't miss cha…
rakep watch: log pipeline errors rather than letting them terminate t…
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.
rakep watch: Only do an invoke_clean if files are added/deleted, or i…
…f the Assetfile changes.
@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.