bibliothecary 8.2.4 → 8.2.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 631a4574650b4e69a1aec283acf4c0d1fb8338a1c4b767500b3b613c51357d7c
4
- data.tar.gz: 1f280d94aacce63d88302f767561d9e9f05e8d3381cd4a618cff5f04cc73511f
3
+ metadata.gz: 6f7fbf7ad34eaff5fc178a7befb091ec010341f3d5ad2a2b468c84c7fa3c3741
4
+ data.tar.gz: 7fd04a9d3d2e28e79cec97b15cd7983f558a8fa4351bc0d1819cdce74ad65a8c
5
5
  SHA512:
6
- metadata.gz: d5e68b0a9fe18880ce752f45e66ba68a31834ce35356e025f892eadb409c613c3d3d57b19fedb65362e0977393757c8a0d7fa521f5e8c3ebbe90dd1aa96b1f86
7
- data.tar.gz: 0ce08bdc863f9e82ed831d99b6132c043d6da012c297f81f5a0a801e847143b5a60a4545d2ce177a1deeaa7e62ed3a50010268b396d34c3f9794d04dccfbd365
6
+ metadata.gz: 5a6488a468d0369e391329359622334d177fd7bcb6694efee45b25f8b5c0cd77145fd517606a7550744b5d17725440b98dc5b8b2f00801183498ac7dbfb9bfc4
7
+ data.tar.gz: 627e705c0201a891941bce2e2765cc9cd651473c49368270db4d0360fba6f15e3b645909bbe1052aebd2c5e24472ebfb07c7c90e68e87bf1558c40840c595c1d
@@ -22,6 +22,12 @@ module Bibliothecary
22
22
  first_matching_mapping_details(info)
23
23
  .fetch(:can_have_lockfile, true)
24
24
  end
25
+
26
+ def groupable?(info)
27
+ # More package managers are groupable than ungroupable, but the methods
28
+ # to get this information should be positive.
29
+ !first_matching_mapping_details(info).fetch(:ungroupable, false)
30
+ end
25
31
  end
26
32
  end
27
33
  end
@@ -49,5 +49,9 @@ module Bibliothecary
49
49
 
50
50
  @package_manager = nil
51
51
  end
52
+
53
+ def groupable?
54
+ @package_manager&.groupable?(self)
55
+ end
52
56
  end
53
57
  end
@@ -98,11 +98,13 @@ module Bibliothecary
98
98
  {
99
99
  match_filename('cyclonedx.json') => {
100
100
  kind: 'lockfile',
101
- parser: :parse_cyclonedx_json
101
+ parser: :parse_cyclonedx_json,
102
+ ungroupable: true
102
103
  },
103
104
  match_filename('cyclonedx.xml') => {
104
105
  kind: 'lockfile',
105
- parser: :parse_cyclonedx_xml
106
+ parser: :parse_cyclonedx_xml,
107
+ ungroupable: true
106
108
  }
107
109
  }
108
110
  end
@@ -10,6 +10,7 @@ module Bibliothecary
10
10
  {
11
11
  match_filename('dependencies.csv') => {
12
12
  kind: 'lockfile',
13
+ ungroupable: true,
13
14
  parser: :parse_dependencies_csv
14
15
  }
15
16
  }
@@ -12,7 +12,14 @@ module Bibliothecary
12
12
 
13
13
  file_infos_by_directory = file_infos.group_by { |info| File.dirname(info.relative_path) }
14
14
  file_infos_by_directory.values.each do |file_infos_for_path|
15
- file_infos_by_directory_by_package_manager = file_infos_for_path.group_by { |info| info.package_manager}
15
+ groupable, ungroupable = file_infos_for_path.partition(&:groupable?)
16
+
17
+ # add ungroupable ones as separate RFIs
18
+ ungroupable.each do |file_info|
19
+ returns.append(RelatedFilesInfo.new([file_info]))
20
+ end
21
+
22
+ file_infos_by_directory_by_package_manager = groupable.group_by { |info| info.package_manager}
16
23
 
17
24
  file_infos_by_directory_by_package_manager.values.each do |file_infos_in_directory_for_package_manager|
18
25
  returns.append(RelatedFilesInfo.new(file_infos_in_directory_for_package_manager))
@@ -1,3 +1,3 @@
1
1
  module Bibliothecary
2
- VERSION = "8.2.4"
2
+ VERSION = "8.2.5"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bibliothecary
3
3
  version: !ruby/object:Gem::Version
4
- version: 8.2.4
4
+ version: 8.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Nesbitt
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-05-06 00:00:00.000000000 Z
11
+ date: 2022-05-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: tomlrb