visualize_packs 0.5.13 → 0.5.14

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/visualize_packs.rb +20 -4
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fd8d04886b359c5fe0ee721ba30aa63a82cf15cbbd49f4f22aae9bb122d746da
4
- data.tar.gz: f3e546e753e571226f782fe8aa2ae9cbee845c3629964cd8eedaf1527fc77f90
3
+ metadata.gz: 23b734b878b51ec2da854f99e7f723b5cb00f59e1b2d0712b5ebcd8f0b05d638
4
+ data.tar.gz: f7ef0ac5c923a939067c6f0e8ed52dc899f80e60556a4d2469b453d14009e3be
5
5
  SHA512:
6
- metadata.gz: 23b4d5aeb2ac339bb16a731d66733b47dd4d3583adbd099064a3bcd2c2cd77d56ded62cd64128cf7e992108227f91fa32667622e461e42ed49dcee60cf16fc7d
7
- data.tar.gz: 3c07f47b89313c37d062550289ca28591a0d2a2023c7fb3f23f401a27710cad28eff6df42775108429af7193374088d0ad9c690599c64c2ad8b0352e921c076c
6
+ metadata.gz: 0e7f6b1d1ec02ad20d524c2bd3bdb84841c799f4a4782742afd0c1ae310fce4ba90d780ce8d8c98fb15be68ed2d085daf03eb70b6d70870af9bb5bda7b00d80e
7
+ data.tar.gz: da4fafcf7b5639a300d2242971d40b2cf0c5b19f05d39941ff6610a0bb99e0d4dc4ad47e93ed503472574e8284af352dc3ead275bfadb6b9c450cfbd0f712790
@@ -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
- result += packages.select{ |p| p.dependencies.any? { |d| match_packs?(d, focus_pack) }}.map { |pack| pack.name }
197
- result += packages.select{ |p| p.violations&.map(&:to_package_name)&.any? { |v| match_packs?(v, focus_pack) }}.map { |pack| pack.name }
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
- result += packages_by_name[p].dependencies
200
- result += packages_by_name[p].violations.map(&:to_package_name)
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|
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: visualize_packs
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.13
4
+ version: 0.5.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gusto Engineers