lib/sinatra/assetpack/options.rb in sinatra-assetpack-0.2.5 vs lib/sinatra/assetpack/options.rb in sinatra-assetpack-0.2.6

- old
+ new

@@ -232,10 +232,10 @@ file.gsub!(/\.[a-f0-9]{32}$/, "") matches = Dir[File.join(expand_from(from), "#{file}.*")] # Fix for filenames with dots (can't do this with glob) - matches.select! { |f| f =~ /#{file}\.[^.]+$/ } + matches = matches.select { |f| f =~ /#{file}\.[^.]+$/ } # Sort static file match, weighting exact file extension matches matches.sort! do |f, _| (File.basename(f) == "#{file}#{extension}" || File.extname(f) == extension) ? -1 : 1 end