Better dedigest assets including fonts

This commit is contained in:
2015-06-01 11:52:17 +02:00
parent bb5dd05f94
commit 03434fd0c0
2 changed files with 9 additions and 7 deletions
+8 -6
View File
@@ -1,8 +1,10 @@
task dedigest_assets: :environment do
extensions = %w[jpg png js css gif]
Dir.glob(Rails.root.join('public/assets/**', "*.{#{extensions.join(',')}}")).each do |asset_path|
next unless asset_path =~ /-[a-f0-9]{32,64}\.(#{extensions.join('|')})\Z/
dedigest_path = asset_path.sub(/-[a-f0-9]{32,64}/, '')
`cp '#{asset_path}' '#{dedigest_path}' 2>/dev/null`
namespace :assets do
task dedigest: :environment do
extensions = %w[jpg png js css gif eot svg woff2 woff ttf]
Dir.glob(Rails.root.join('public/assets/**', "*.{#{extensions.join(',')}}")).each do |asset_path|
next unless asset_path =~ /-[a-f0-9]{32,64}\.(#{extensions.join('|')})\Z/
dedigest_path = asset_path.sub(/-[a-f0-9]{32,64}/, '')
`cp '#{asset_path}' '#{dedigest_path}' 2>/dev/null`
end
end
end