lib/sprockets/bower.rb in sprockets-3.7.5 vs lib/sprockets/bower.rb in sprockets-4.0.0.beta1

- old
+ new

@@ -15,20 +15,22 @@ # Returns candiate filenames. def resolve_alternates(load_path, logical_path) candidates, deps = super # bower.json can only be nested one level deep - if !logical_path.index('/') + if !logical_path.index('/'.freeze) dirname = File.join(load_path, logical_path) if directory?(dirname) filenames = POSSIBLE_BOWER_JSONS.map { |basename| File.join(dirname, basename) } filename = filenames.detect { |fn| self.file?(fn) } if filename deps << build_file_digest_uri(filename) read_bower_main(dirname, filename) do |path| - candidates << path + if file?(path) + candidates << path + end end end end end