Sha256: c4346ade7ce547746d1b219fb4e8f4f9c440d9c01f6e783e2967607de26372be
Contents?: true
Size: 562 Bytes
Versions: 8
Compression:
Stored size: 562 Bytes
Contents
# frozen_string_literal: true require 'fileutils' namespace :ckeditor do desc 'Create nondigest versions of all ckeditor digest assets' task nondigest: :environment do fingerprint = /\-[0-9a-f]{32,64}\./ path = Rails.root.join("public#{Ckeditor.base_path}**/*") Dir[path].each do |file| next unless file =~ fingerprint nondigest = file.sub fingerprint, '.' if !File.exist?(nondigest) || File.mtime(file) > File.mtime(nondigest) FileUtils.cp file, nondigest, verbose: true, preserve: true end end end end
Version data entries
8 entries across 8 versions & 2 rubygems