mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
f62ec6cb2d
Bring cache_digests:* rake tasks up-to-date with the API changes introduced in
637bb726ca
21 lines
858 B
Ruby
21 lines
858 B
Ruby
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.new(name: template_name, finder: finder).nested_dependencies
|
|
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.new(name: template_name, finder: finder).dependencies
|
|
end
|
|
|
|
def template_name
|
|
ENV['TEMPLATE'].split('.', 2).first
|
|
end
|
|
|
|
def finder
|
|
ApplicationController.new.lookup_context
|
|
end
|
|
end
|