diff options
| author | Zakaria BOUZIANE | 2015-05-27 15:58:47 +0200 |
|---|---|---|
| committer | Zakaria BOUZIANE | 2015-05-27 15:58:47 +0200 |
| commit | 5d19b9fc098149e90916379acef1f2f51dbbefd4 (patch) | |
| tree | aae4c90bfc494aa309699db63b1975c415a7bb27 /lib/tasks | |
| parent | e14e415df3850e4e09abb72ad6c228ef56778c08 (diff) | |
| download | chouette-core-5d19b9fc098149e90916379acef1f2f51dbbefd4.tar.bz2 | |
Generating non fingerprinted assets
Diffstat (limited to 'lib/tasks')
| -rw-r--r-- | lib/tasks/assets_nondigest.rake | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/tasks/assets_nondigest.rake b/lib/tasks/assets_nondigest.rake new file mode 100644 index 000000000..d5a87c051 --- /dev/null +++ b/lib/tasks/assets_nondigest.rake @@ -0,0 +1,14 @@ +# https://gist.github.com/eric1234/5692456 + +require 'fileutils' + +desc "Create nondigest versions of all digest assets" +task "assets:precompile" do + fingerprint = /\-[0-9a-f]{32}\./ + for file in Dir["public/assets/**/*"] + next unless file =~ fingerprint + nondigest = file.sub fingerprint, '.' + FileUtils.cp file, nondigest, verbose: true + end +end + |
