Sha256: 8b85fc4811735dd7fc2fcf93903af9cb1a7d0a502284defef98d4fc7e3aa1b12
Contents?: true
Size: 672 Bytes
Versions: 9
Compression:
Stored size: 672 Bytes
Contents
# frozen_string_literal: true require 'fileutils' namespace :trumbowyg do desc 'Create nondigest versions of all trumbowyg digest assets' task nondigest: :environment do # include ActionView::Helpers::AssetUrlHelper # p font_path( 'active_admin-trumbowyg.svg' ) fingerprint = /-[0-9a-f]{32,64}\./ path = Rails.root.join( 'public/assets/active_admin-trumbowyg*' ) 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
9 entries across 9 versions & 1 rubygems