Permalink
Browse files

Fix fingerprint with path with multiple extensions

  • Loading branch information...
1 parent dc4e578 commit 4ba5b32764a9073671df5e77355df6ed2bb3d3c9 @josh josh committed Oct 24, 2011
Showing with 3 additions and 1 deletion.
  1. +1 −1 lib/sprockets/asset_attributes.rb
  2. +2 −0 test/test_asset_attributes.rb
@@ -120,7 +120,7 @@ def content_type
# # => "0aa2105d29558f3eb790d411d7d8fb66"
#
def path_fingerprint
- pathname.basename(extensions.join).to_s =~ /-([0-9a-f]{7,40})$/ ? $1 : nil
+ pathname.basename(extensions.last).to_s =~ /-([0-9a-f]{7,40})$/ ? $1 : nil
end
# Injects digest fingerprint into path.
@@ -111,6 +111,8 @@ class TestAssetAttributes < Sprockets::TestCase
assert_equal nil, pathname("foo.js").path_fingerprint
assert_equal "0aa2105d29558f3eb790d411d7d8fb66",
pathname("foo-0aa2105d29558f3eb790d411d7d8fb66.js").path_fingerprint
+ assert_equal "0aa2105d29558f3eb790d411d7d8fb66",
+ pathname("foo.bar-0aa2105d29558f3eb790d411d7d8fb66.js").path_fingerprint
end
test "inject path fingerprint" do

0 comments on commit 4ba5b32

Please sign in to comment.