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

Easy way to add gems' assets as input directories #61

Open jamesarosen opened 12 years ago

jamesarosen commented 12 years ago

For example, I'd like to be able to have a project with bootstrap-sass in the Gemfile and easily be able to add its vendor/assets/* folders to the input paths. It doesn't have to be as auto-magical as Rails+Sprockets (where anything in lib/assets/* is added to Sprockets's path), but it would be nice to have a shorter version of

Dir.glob(Pathname.new(Gem.loaded_specs["bootstrap-sass"].gem_dir).join('vendor/assets/*').to_s).each do |path|
  input path
end
jamesarosen commented 12 years ago

Even this doesn't really emulate what Sprockets does, though. The problem is that if I add all of those directories as input directories, all of the files inside them will end up in my (concatenated) output. In Sprockets (and Ruby, and Java, ...), only those that get required are included.

mulderp commented 12 years ago

As an intermediary step and for debugging, maybe it would be helpful to dry-run assets compilation where the paths and compilation rules can be investigated?

joefiorini commented 11 years ago

This seems like something that should be handled by the filter itself, not the pipeline, no? For example, I'd want those extra asset folders to be on the load path when I run Sass or Minispade, but not generally considered inputs.