dependency-trees 0.0.5 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/dependency-trees.gemspec +1 -1
- data/lib/dependency_tree.rb +2 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 306bbf35003e904fb5156364e9625c07bae045abd2ee825ad89fde856f5e7bbd
|
4
|
+
data.tar.gz: a1aaa658e42e1a5941063caa63d57f957bfcbdf25ae26c8a57d614039ee8ede4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cc015c81d4beb8e20319be7c9a8122bee81957a2aa1a222269ee405b6480a74ebb5781424cd8b06fd7fea14c6c1f670fee06c946bb8014f446a06f071c8f0cbf
|
7
|
+
data.tar.gz: 0ab25cfb697d24724f83e96936186bf931b65c1b06b7708608d332f07186a691cae68980feb132153bf372703eb7ffdc706ba2b3071b75473edc42f97755b9e9
|
data/dependency-trees.gemspec
CHANGED
data/lib/dependency_tree.rb
CHANGED
@@ -35,7 +35,7 @@ module DependencyTree
|
|
35
35
|
|
36
36
|
new_array = array.map do |subtree|
|
37
37
|
next subtree.root_duplicate_summary if subtree[:duplicate]
|
38
|
-
next subtree if subtree.class != Tree || subtree.size >
|
38
|
+
next subtree if subtree.class != Tree || subtree.size > 3
|
39
39
|
|
40
40
|
subtree.root_summary
|
41
41
|
end
|
@@ -119,6 +119,7 @@ module DependencyTree
|
|
119
119
|
result = shoud_go_deeper ? get_associations_for_tree(depth, hash_for_duplication_check) : Tree.new
|
120
120
|
result[:id] = id
|
121
121
|
result[:instance] = self
|
122
|
+
result[:class] = self.class.to_s.underscore
|
122
123
|
result[:duplicate] = true if is_duplicate
|
123
124
|
result
|
124
125
|
end
|
@@ -135,7 +136,6 @@ module DependencyTree
|
|
135
136
|
self.send(association.name).sort_by(&:id).map do |associated_object|
|
136
137
|
result[symbol] = [] if result[symbol].nil?
|
137
138
|
result[symbol] << associated_object.dependency_tree(depth - 1, hash_for_duplication_check)
|
138
|
-
result[:class] = association.klass.name.underscore.to_sym
|
139
139
|
end
|
140
140
|
end
|
141
141
|
|