Created
January 24, 2015 15:26
-
-
Save jiripospisil/dba978af301764097efd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/actionview/lib/action_view/digestor.rb b/actionview/lib/action_view/digestor.rb | |
index 1f10378..c864571 100644 | |
--- a/actionview/lib/action_view/digestor.rb | |
+++ b/actionview/lib/action_view/digestor.rb | |
@@ -73,11 +73,15 @@ module ActionView | |
[] # File doesn't exist, so no dependencies | |
end | |
- def nested_dependencies | |
- dependencies.collect do |dependency| | |
- dependencies = PartialDigestor.new(name: dependency, finder: finder).nested_dependencies | |
- dependencies.any? ? { dependency => dependencies } : dependency | |
- end | |
+ def nested_dependencies(processed = Set.new) | |
+ dependencies.collect { |dependency| | |
+ unless processed.include?(dependency) | |
+ digestor = PartialDigestor.new(name: dependency, finder: finder) | |
+ nested = digestor.nested_dependencies(processed + [dependency]) | |
+ | |
+ nested.any? ? { dependency => nested } : dependency | |
+ end | |
+ }.compact | |
end | |
private |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment