Sha256: f1f38482c16dd337b061cb69223989710ab0d69a7a1d110c9bb1c236d142aa06

Contents?: true

Size: 973 Bytes

Versions: 248

Compression:

Stored size: 973 Bytes

Contents

# frozen_string_literal: true

namespace :cache_digests do
  desc "Lookup nested dependencies for TEMPLATE (like messages/show or comments/_comment.html)"
  task nested_dependencies: :environment do
    abort "You must provide TEMPLATE for the task to run" unless ENV["TEMPLATE"].present?
    puts JSON.pretty_generate ActionView::Digestor.tree(CacheDigests.template_name, CacheDigests.finder).children.map(&:to_dep_map)
  end

  desc "Lookup first-level dependencies for TEMPLATE (like messages/show or comments/_comment.html)"
  task dependencies: :environment do
    abort "You must provide TEMPLATE for the task to run" unless ENV["TEMPLATE"].present?
    puts JSON.pretty_generate ActionView::Digestor.tree(CacheDigests.template_name, CacheDigests.finder).children.map(&:name)
  end

  class CacheDigests
    def self.template_name
      ENV["TEMPLATE"].split(".", 2).first
    end

    def self.finder
      ApplicationController.new.lookup_context
    end
  end
end

Version data entries

248 entries across 235 versions & 16 rubygems

Version Path
actionview-8.0.0 lib/action_view/tasks/cache_digests.rake
actionview-7.2.2 lib/action_view/tasks/cache_digests.rake
actionview-7.1.5 lib/action_view/tasks/cache_digests.rake
actionview-8.0.0.rc2 lib/action_view/tasks/cache_digests.rake
actionview-7.2.1.2 lib/action_view/tasks/cache_digests.rake
actionview-7.1.4.2 lib/action_view/tasks/cache_digests.rake
actionview-7.0.8.6 lib/action_view/tasks/cache_digests.rake
actionview-6.1.7.10 lib/action_view/tasks/cache_digests.rake
actionview-8.0.0.rc1 lib/action_view/tasks/cache_digests.rake
actionview-6.1.7.9 lib/action_view/tasks/cache_digests.rake
actionview-7.2.1.1 lib/action_view/tasks/cache_digests.rake
actionview-7.1.4.1 lib/action_view/tasks/cache_digests.rake
actionview-7.0.8.5 lib/action_view/tasks/cache_digests.rake
actionview-8.0.0.beta1 lib/action_view/tasks/cache_digests.rake
omg-actionview-8.0.0.alpha9 lib/action_view/tasks/cache_digests.rake
omg-actionview-8.0.0.alpha8 lib/action_view/tasks/cache_digests.rake
omg-actionview-8.0.0.alpha7 lib/action_view/tasks/cache_digests.rake
omg-actionview-8.0.0.alpha4 lib/action_view/tasks/cache_digests.rake
omg-actionview-8.0.0.alpha3 lib/action_view/tasks/cache_digests.rake
omg-actionview-8.0.0.alpha2 lib/action_view/tasks/cache_digests.rake