lib/sinatra/assetpack/options.rb in sinatra-assetpack-0.1.7 vs lib/sinatra/assetpack/options.rb in sinatra-assetpack-0.2.0
- old
+ new
@@ -250,10 +250,10 @@
file = requested_file
extension = File.extname(requested_file)
# Remove extension
file.gsub!(/#{extension}$/, "")
# Remove cache-buster (/js/app.28389 => /js/app)
- file.gsub!(/\.[0-9]+$/, "")
+ file.gsub!(/\.[a-f0-9]{32}$/, "")
matches = Dir[File.join(app.root, from, "#{file}.*")]
# Fix for filenames with dots (can't do this with glob)
matches.select! { |f| f =~ /#{file}\.[^.]+$/ }