bertramdev/asset-pipeline — pull request #99 by brian428 (2014-05-27 05:44:31+00:00)
Title: Add ability to define multiple dependent files in a single directive...

...using a comma-delimited string.

Just a bit of background: I'm creating a plugin that will resolve dependencies in Sencha Ext JS applications. Sencha defines its own requires syntax, several ways to specify required classes, and uses class names rather than file names. So a simple regex to match the directive won't suffice. My plugin parses the JS files, determines the required files by matching the class names to file names, and adds them into the tree inside the asset file's directiveForLine().

However, I can't specify the additional files using "require_tree", since it doesn't allow control over the order. And the current way the directive handling works, each individual file directive *must* be specified on its own line. So there's no way to force more than one file to be added to the tree.

This small change allows a directive to specify multiple files, in order, to be included. The syntax is simple "//= require file1,file2,file3".

I also added a test to ensure that it works without breaking anything else.

Let me know if you have any questions. Thanks for the great work on this plugin!