aboutsummaryrefslogtreecommitdiffstats
path: root/actionview/lib
diff options
context:
space:
mode:
Diffstat (limited to 'actionview/lib')
-rw-r--r--actionview/lib/action_view/digestor.rb8
-rw-r--r--actionview/lib/action_view/tasks/dependencies.rake4
2 files changed, 6 insertions, 6 deletions
diff --git a/actionview/lib/action_view/digestor.rb b/actionview/lib/action_view/digestor.rb
index 08afa51135..bd86d5c088 100644
--- a/actionview/lib/action_view/digestor.rb
+++ b/actionview/lib/action_view/digestor.rb
@@ -49,8 +49,8 @@ module ActionView
if finder.disable_cache { finder.exists?(logical_name, [], partial) }
template = finder.disable_cache { finder.find(logical_name, [], partial) }
- if obj = seen[template.identifier]
- obj
+ if node = seen[template.identifier] # handle cycles in the tree
+ node
else
node = seen[template.identifier] = Node.create(name, logical_name, template, partial)
@@ -109,11 +109,11 @@ module ActionView
class Partial < Node; end
class Missing < Node
- def digest(_ = []); '' end
+ def digest(_ = []) '' end
end
class Injected < Node
- def digest(_ = []); name end
+ def digest(_ = []) name end
end
class NullLogger
diff --git a/actionview/lib/action_view/tasks/dependencies.rake b/actionview/lib/action_view/tasks/dependencies.rake
index 9932ff8b6d..045bdf5691 100644
--- a/actionview/lib/action_view/tasks/dependencies.rake
+++ b/actionview/lib/action_view/tasks/dependencies.rake
@@ -2,13 +2,13 @@ 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(CacheDigests.template_name, CacheDigests.finder).nested_dependencies
+ 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.new(CacheDigests.template_name, CacheDigests.finder).dependencies
+ puts JSON.pretty_generate ActionView::Digestor.tree(CacheDigests.template_name, CacheDigests.finder).children.map(&:name)
end
class CacheDigests