diff --git a/lib/sprockets-vendor_gems.rb b/lib/sprockets-vendor_gems.rb index c193225..9f986a9 100644 --- a/lib/sprockets-vendor_gems.rb +++ b/lib/sprockets-vendor_gems.rb @@ -2,22 +2,22 @@ require 'sprockets' require 'rubygems' module ::Sprockets - class << self - def find_gem_vendor_paths(options = {}) - for_types = [ options[:for] || [ 'javascripts', 'stylesheets' ] ].flatten + def self.find_gem_vendor_paths(options = {}) + options = { :paths => %w{vendor lib app} }.merge(options) - paths = [] + for_types = [ options[:for] || [ 'javascripts', 'stylesheets' ] ].flatten - Gem::Specification.each do |gemspec| - %w{vendor lib app}.product(for_types).each do |base_dir, type| - path = File.join(gemspec.gem_dir, base_dir, "assets", type.to_s) + paths = [] - paths << path if File.directory?(path) - end + Gem::Specification.each do |gemspec| + options[:paths].product(for_types).each do |base_dir, type| + path = File.join(gemspec.gem_dir, base_dir, "assets", type.to_s) + + paths << path if File.directory?(path) end - - paths end + + paths end class EnvironmentWithVendoredGems < Environment