visualize_packs 0.5.13 → 0.5.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/visualize_packs.rb +20 -4
- 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: 23b734b878b51ec2da854f99e7f723b5cb00f59e1b2d0712b5ebcd8f0b05d638
|
4
|
+
data.tar.gz: f7ef0ac5c923a939067c6f0e8ed52dc899f80e60556a4d2469b453d14009e3be
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0e7f6b1d1ec02ad20d524c2bd3bdb84841c799f4a4782742afd0c1ae310fce4ba90d780ce8d8c98fb15be68ed2d085daf03eb70b6d70870af9bb5bda7b00d80e
|
7
|
+
data.tar.gz: da4fafcf7b5639a300d2242971d40b2cf0c5b19f05d39941ff6610a0bb99e0d4dc4ad47e93ed503472574e8284af352dc3ead275bfadb6b9c450cfbd0f712790
|
data/lib/visualize_packs.rb
CHANGED
@@ -193,11 +193,27 @@ module VisualizePacks
|
|
193
193
|
if !focus_pack.empty?
|
194
194
|
result = []
|
195
195
|
result += packages.map { |pack| pack.name }.select { |p| match_packs?(p, focus_pack) }
|
196
|
-
|
197
|
-
|
196
|
+
if options.show_dependencies
|
197
|
+
result += packages.select { |p| p.dependencies.any? { |d| match_packs?(d, focus_pack) }}.map { |pack| pack.name }
|
198
|
+
end
|
199
|
+
if options.show_todos && [nil, FocusPackEdgeDirection::In, FocusPackEdgeDirection::InOut].include?(options.show_only_edges_to_focus_pack)
|
200
|
+
result += packages.select do
|
201
|
+
|p| (p.violations || []).inject([]) do |res, todo|
|
202
|
+
res << todo.to_package_name if options.only_todo_types.empty? || options.only_todo_types.include?(todo.type)
|
203
|
+
res
|
204
|
+
end.any? { |v| match_packs?(v, focus_pack) }
|
205
|
+
end.map { |pack| pack.name }
|
206
|
+
end
|
198
207
|
packages.map { |pack| pack.name }.select { |p| match_packs?(p, focus_pack) }.each do |p|
|
199
|
-
|
200
|
-
|
208
|
+
if options.show_dependencies
|
209
|
+
result += packages_by_name[p].dependencies
|
210
|
+
end
|
211
|
+
if options.show_todos && [nil, FocusPackEdgeDirection::Out, FocusPackEdgeDirection::InOut].include?(options.show_only_edges_to_focus_pack)
|
212
|
+
result += (packages_by_name[p].violations || []).inject([]) do |res, todo|
|
213
|
+
res << todo.to_package_name if options.only_todo_types.empty? || options.only_todo_types.include?(todo.type)
|
214
|
+
res
|
215
|
+
end
|
216
|
+
end
|
201
217
|
end
|
202
218
|
result = result.uniq
|
203
219
|
parent_packs = result.inject([]) do |res, package_name|
|