Permalink
Browse files

Merge pull request #17069 from modosc/master

move cache_digests rake methods into their own namespace
  • Loading branch information...
rafaelfranca committed Feb 20, 2015
1 parent cbe4708 commit ac26bd1d8093841addb868b5d24ef4e3021ab25c
Showing with 9 additions and 7 deletions.
  1. +9 −7 actionview/lib/action_view/tasks/dependencies.rake
@@ -2,20 +2,22 @@ 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
puts JSON.pretty_generate ActionView::Digestor.new(name: CacheDigests.template_name, finder: CacheDigests.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
puts JSON.pretty_generate ActionView::Digestor.new(name: CacheDigests.template_name, finder: CacheDigests.finder).dependencies
end
def template_name
ENV['TEMPLATE'].split('.', 2).first
end
class CacheDigests
def self.template_name
ENV['TEMPLATE'].split('.', 2).first
end
def finder
ApplicationController.new.lookup_context
def self.finder
ApplicationController.new.lookup_context
end
end
end

0 comments on commit ac26bd1

Please sign in to comment.