Created
April 30, 2014 10:00
-
-
Save zvlex/b9b51b8d7f38064ec17f to your computer and use it in GitHub Desktop.
/lib/tasks/ckeditor.rake
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
config.autoload_paths += %W(#{config.root}/app/models/ckeditor) | |
config.assets.precompile += Ckeditor.assets | |
config.assets.precompile += %w(ckeditor/*) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'fileutils' | |
desc "Create nondigest versions of all ckeditor digest assets" | |
task "assets:precompile" do | |
fingerprint = /\-[0-9a-f]{32}\./ | |
for file in Dir["public/assets/ckeditor/**/*"] | |
next unless file =~ fingerprint | |
nondigest = file.sub fingerprint, '.' | |
FileUtils.cp file, nondigest, verbose: true | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment