From f819f20601a6d559a7e87e2a46f1fb3d363e0812 Mon Sep 17 00:00:00 2001 From: Dharam Gollapudi Date: Wed, 9 Mar 2016 12:06:19 -0800 Subject: Rename dependencies.rake to cache_digests.rake As the tasks are related to cache_digests and as they are already namespaced under cache_digests, renaming to cache_digests.rake makes it to know where to find these tasks. --- .../lib/action_view/tasks/cache_digests.rake | 23 ++++++++++++++++++++++ actionview/lib/action_view/tasks/dependencies.rake | 23 ---------------------- 2 files changed, 23 insertions(+), 23 deletions(-) create mode 100644 actionview/lib/action_view/tasks/cache_digests.rake delete mode 100644 actionview/lib/action_view/tasks/dependencies.rake (limited to 'actionview/lib') diff --git a/actionview/lib/action_view/tasks/cache_digests.rake b/actionview/lib/action_view/tasks/cache_digests.rake new file mode 100644 index 0000000000..045bdf5691 --- /dev/null +++ b/actionview/lib/action_view/tasks/cache_digests.rake @@ -0,0 +1,23 @@ +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 diff --git a/actionview/lib/action_view/tasks/dependencies.rake b/actionview/lib/action_view/tasks/dependencies.rake deleted file mode 100644 index 045bdf5691..0000000000 --- a/actionview/lib/action_view/tasks/dependencies.rake +++ /dev/null @@ -1,23 +0,0 @@ -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 -- cgit v1.2.3