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

Version Path
activeadmin_trumbowyg-1.1.0 lib/tasks/trumbowyg.rake
activeadmin_trumbowyg-1.0.0 lib/tasks/trumbowyg.rake
activeadmin_trumbowyg-0.2.16 lib/tasks/trumbowyg.rake
activeadmin_trumbowyg-0.2.14 lib/tasks/trumbowyg.rake
activeadmin_trumbowyg-0.2.12 lib/tasks/trumbowyg.rake
activeadmin_trumbowyg-0.2.10 lib/tasks/trumbowyg.rake
activeadmin_trumbowyg-0.2.8 lib/tasks/trumbowyg.rake
activeadmin_trumbowyg-0.2.6 lib/tasks/trumbowyg.rake
activeadmin_trumbowyg-0.2.4 lib/tasks/trumbowyg.rake