lib/sprockets/base.rb in sprockets-2.9.4 vs lib/sprockets/base.rb in sprockets-2.10.0

- old
+ new

@@ -127,17 +127,17 @@ # If a block is given, preform an iterable search if block_given? args = attributes_for(logical_path).search_paths + [options] @trail.find(*args) do |path| pathname = Pathname.new(path) - if pathname.basename.to_s == 'component.json' - component = json_decode(pathname.read) - case component['main'] + if %w( bower.json component.json ).include?(pathname.basename.to_s) + bower = json_decode(pathname.read) + case bower['main'] when String - yield pathname.dirname.join(component['main']) + yield pathname.dirname.join(bower['main']) when Array extname = File.extname(logical_path) - component['main'].each do |fn| + bower['main'].each do |fn| if extname == "" || extname == File.extname(fn) yield pathname.dirname.join(fn) end end end