diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2015-02-20 20:31:48 -0200 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2015-02-20 20:31:48 -0200 |
commit | 14a6e179282010c62f87311f168fcb6a04a8b5ee (patch) | |
tree | 0d8d72676ea6c7340ec85c1e85551539969e72ee /actionview | |
parent | 08cec83233c007efd69ef7f9d3b48cd408acafb4 (diff) | |
parent | 5eebf9575c1d76a54480c405ffd08d04f5a7f359 (diff) | |
download | rails-14a6e179282010c62f87311f168fcb6a04a8b5ee.tar.gz rails-14a6e179282010c62f87311f168fcb6a04a8b5ee.tar.bz2 rails-14a6e179282010c62f87311f168fcb6a04a8b5ee.zip |
Merge pull request #17069 from modosc/master
move cache_digests rake methods into their own namespace
Diffstat (limited to 'actionview')
-rw-r--r-- | actionview/lib/action_view/tasks/dependencies.rake | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/actionview/lib/action_view/tasks/dependencies.rake b/actionview/lib/action_view/tasks/dependencies.rake index b39f7d583b..f394c319c1 100644 --- a/actionview/lib/action_view/tasks/dependencies.rake +++ b/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 |