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-6.1.7.4 lib/action_view/tasks/cache_digests.rake
scrapbook-0.3.1 vendor/ruby/2.7.0/gems/actionview-7.0.2.3/lib/action_view/tasks/cache_digests.rake
scrapbook-0.3.1 vendor/ruby/2.7.0/gems/actionview-6.1.6.1/lib/action_view/tasks/cache_digests.rake
scrapbook-0.3.1 vendor/ruby/2.7.0/gems/actionview-7.0.3.1/lib/action_view/tasks/cache_digests.rake
actionview-7.0.5 lib/action_view/tasks/cache_digests.rake
actionview-7.0.4.3 lib/action_view/tasks/cache_digests.rake
actionview-6.1.7.3 lib/action_view/tasks/cache_digests.rake
actionview-6.1.7.2 lib/action_view/tasks/cache_digests.rake
actionview-7.0.4.2 lib/action_view/tasks/cache_digests.rake
actionview-7.0.4.1 lib/action_view/tasks/cache_digests.rake
actionview-6.1.7.1 lib/action_view/tasks/cache_digests.rake
actionview-6.0.6.1 lib/action_view/tasks/cache_digests.rake
actionview-7.0.4 lib/action_view/tasks/cache_digests.rake
actionview-6.1.7 lib/action_view/tasks/cache_digests.rake
actionview-6.0.6 lib/action_view/tasks/cache_digests.rake
actionview-7.0.3.1 lib/action_view/tasks/cache_digests.rake
actionview-6.1.6.1 lib/action_view/tasks/cache_digests.rake
actionview-6.0.5.1 lib/action_view/tasks/cache_digests.rake
actionview-5.2.8.1 lib/action_view/tasks/cache_digests.rake
actionview-5.2.8 lib/action_view/tasks/cache_digests.rake