Created
March 28, 2012 16:48
-
-
Save jish/2228129 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'bundler' | |
| Bundler.setup(:assets) | |
| require 'rake-pipeline-web-filters' | |
| RequireFilter = Rake::Pipeline::Web::Filters::NeuterFilter | |
| REQUIRE_REGEX = %r{//= require (.*)} | |
| output 'public' | |
| load_paths = ['app/assets/javascripts', 'vendor/assets/javascripts'] | |
| outfiles = ['foo.js', 'application.js'] | |
| input load_paths, '*.js' do | |
| outfiles.each do |outfile| | |
| match outfile do | |
| filter RequireFilter, outfile, :require_regexp => REQUIRE_REGEX | |
| end | |
| end | |
| end |
Ah, I passed over NeuterFilter when I was looking rake-pipeline yesterday. Totally wasn't clear (from the name, at least) how I can use it for dependencies. Ended up specifying a manually ordered list to concat.
It does feel a little hacky though - how does this, for instance resolve deps in a manner that doesn't include the same files twice? (might already do that, i'm just curious)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Cool. We'll probably have to subclass
NeuterFilterto turn//= require_treeinto aDir.glob.