Sha256: f6b894aeb10668d16a8118b88ce2ba096289648bc2fb5edb8d10dee89b37ed7b

Contents?: true

Size: 948 Bytes

Versions: 31

Compression:

Stored size: 948 Bytes

Contents

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

31 entries across 31 versions & 4 rubygems

Version Path
actionview-5.0.7.2 lib/action_view/tasks/cache_digests.rake
actionview-5.0.7.1 lib/action_view/tasks/cache_digests.rake
actionview-5.0.7 lib/action_view/tasks/cache_digests.rake
actionview-5.0.6 lib/action_view/tasks/cache_digests.rake
actionview-5.0.6.rc1 lib/action_view/tasks/cache_digests.rake
actionview-5.0.5 lib/action_view/tasks/cache_digests.rake
actionview-5.0.5.rc2 lib/action_view/tasks/cache_digests.rake
actionview-5.0.5.rc1 lib/action_view/tasks/cache_digests.rake
actionview-5.0.4 lib/action_view/tasks/cache_digests.rake
actionview-5.0.4.rc1 lib/action_view/tasks/cache_digests.rake
actionview-5.0.3 lib/action_view/tasks/cache_digests.rake
enju_leaf-1.2.1 vendor/bundle/ruby/2.3/gems/actionview-5.0.2/lib/action_view/tasks/cache_digests.rake
actionview-5.0.2 lib/action_view/tasks/cache_digests.rake
actionview-5.0.2.rc1 lib/action_view/tasks/cache_digests.rake
autocompl-0.2.2 test/dummy/vendor/bundle/ruby/2.3.0/gems/actionview-5.0.1/lib/action_view/tasks/cache_digests.rake
autocompl-0.2.1 test/dummy/vendor/bundle/ruby/2.3.0/gems/actionview-5.0.1/lib/action_view/tasks/cache_digests.rake
autocompl-0.2.0 test/dummy/vendor/bundle/ruby/2.3.0/gems/actionview-5.0.1/lib/action_view/tasks/cache_digests.rake
autocompl-0.1.2 test/dummy/vendor/bundle/ruby/2.3.0/gems/actionview-5.0.1/lib/action_view/tasks/cache_digests.rake
autocompl-0.1.1 test/dummy/vendor/bundle/ruby/2.3.0/gems/actionview-5.0.1/lib/action_view/tasks/cache_digests.rake
autocompl-0.1.0 test/dummy/vendor/bundle/ruby/2.3.0/gems/actionview-5.0.1/lib/action_view/tasks/cache_digests.rake