diff options
author | jonathan schatz <jon@vouch.com> | 2014-09-26 11:55:40 -0700 |
---|---|---|
committer | jonathan schatz <jon@vouch.com> | 2014-09-26 11:55:40 -0700 |
commit | 5eebf9575c1d76a54480c405ffd08d04f5a7f359 (patch) | |
tree | 95f43fb1c92925547cf3916d156608be1123deed /actionview | |
parent | 4af5899e25229961cbd3df9dfe80c2f46fa04f6c (diff) | |
download | rails-5eebf9575c1d76a54480c405ffd08d04f5a7f359.tar.gz rails-5eebf9575c1d76a54480c405ffd08d04f5a7f359.tar.bz2 rails-5eebf9575c1d76a54480c405ffd08d04f5a7f359.zip |
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 |