aboutsummaryrefslogtreecommitdiffstats
path: root/actionview/lib
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2014-06-10 11:26:57 -0300
committerRafael Mendonça França <rafaelmfranca@gmail.com>2014-06-10 11:26:57 -0300
commitbe5d648a16436370568382b10cbb7a2ad716cf01 (patch)
tree028300be0ec2377ae53841a6e36a9effa5a60b99 /actionview/lib
parentbfb8b139aaeecd3aaadb99c3f483c1420e59c384 (diff)
parentf62ec6cb2de4a06779a06794be79669313563be3 (diff)
downloadrails-be5d648a16436370568382b10cbb7a2ad716cf01.tar.gz
rails-be5d648a16436370568382b10cbb7a2ad716cf01.tar.bz2
rails-be5d648a16436370568382b10cbb7a2ad716cf01.zip
Merge pull request #15605 from mekishizufu/fix_cache_digests_rake_tasks
Fix cache_digest rake tasks
Diffstat (limited to 'actionview/lib')
-rw-r--r--actionview/lib/action_view/tasks/dependencies.rake16
1 files changed, 10 insertions, 6 deletions
diff --git a/actionview/lib/action_view/tasks/dependencies.rake b/actionview/lib/action_view/tasks/dependencies.rake
index 1b9426c0e5..b39f7d583b 100644
--- a/actionview/lib/action_view/tasks/dependencies.rake
+++ b/actionview/lib/action_view/tasks/dependencies.rake
@@ -2,16 +2,20 @@ 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?
- template, format = ENV['TEMPLATE'].split(".")
- format ||= :html
- puts JSON.pretty_generate ActionView::Digestor.new(template, format, ApplicationController.new.lookup_context).nested_dependencies
+ 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?
- template, format = ENV['TEMPLATE'].split(".")
- format ||= :html
- puts JSON.pretty_generate ActionView::Digestor.new(template, format, ApplicationController.new.lookup_context).dependencies
+ 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