bibliothecary 8.3.4 → 8.3.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: 9bd6e1d72ef747c4e0a6070e71609c20e4f801de4e61f05cd53bc8b20d30fc53
4
- data.tar.gz: 0b0e70fde9855df7c3e18a6824b3d1b43ca83646128ee3972aed7eed1cf90df7
3
+ metadata.gz: f283979f0fd87432a9d26a07bea9f568276d25102f9b3e343e4304656bedc1fb
4
+ data.tar.gz: 7019277a0e5bcf8ea1b77d76889f7de9322121ec4b7abee44f2f83bfa8b09fe5
5
5
  SHA512:
6
- metadata.gz: e3766156e6f96ad25947cd3b5f5d5703e288720f996870e80993e3297df9fa9697793109a0e3d4a8affdc8e87839a7c67374bda098befcac47578c3d61b3a3ee
7
- data.tar.gz: 886ede7d0f5e7f91bc788a3cc7922be2cf9243deb3e5c8b45109b41a5bb0ed70e1d2d24049fd354ed230da1be9deb0b62cdbebc6e3db10a188fac7ae065a94b4
6
+ metadata.gz: e81204f529c0dd96cb75f43823a6440197474ddc06b37ddbd71eadcee710d4535f666d7ddfd59a670d96ff8592c22afc0b0c97e544cad2a3c661dd978df243bb
7
+ data.tar.gz: 3b972cbc604d1b1edd059c6a25a53f048eb1ce9554f541736188e1795da61bdf929acbc4999ddbbe3c54f4aad3941e6fc2ee2bf7107086959964d576451555bb
@@ -148,7 +148,6 @@ module Bibliothecary
148
148
 
149
149
  split = gradle_dep_match.captures[0]
150
150
 
151
-
152
151
  dep = line
153
152
  .split(split)[1].sub(/(\((c|n|\*)\))$/, "") # line ending legend: (c) means a dependency constraint, (n) means not resolved, or (*) means resolved previously, e.g. org.springframework.boot:spring-boot-starter-web:2.1.0.M3 (*)
154
153
  .sub(/ FAILED$/, "") # dependency could not be resolved (but still may have a version)
@@ -159,21 +158,28 @@ module Bibliothecary
159
158
  # \--- org.springframework.security:spring-security-test (n)
160
159
  next unless dep.length >= 3
161
160
 
162
- dep_name = if dep.count == 6
163
- # get name from renamed package resolution "org:name:version -> renamed_org:name:version"
164
- dep[-3..-2]
165
- else
166
- # get name from version conflict resolution ("org:name:version -> version") and no-resolution ("org:name:version")
167
- dep[0..1]
168
- end
169
-
170
- version = dep[-1]
171
- {
172
- name: dep_name.join(":"),
173
- requirement: version,
174
- type: type
175
- }
176
- end.compact.uniq {|item| [item[:name], item[:requirement], item[:type]]}
161
+ if dep.count == 6
162
+ # get name from renamed package resolution "org:name:version -> renamed_org:name:version"
163
+ {
164
+ original_name: dep[0,2].join(":"),
165
+ original_requirement: dep[2],
166
+ name: dep[-3..-2].join(":"),
167
+ requirement: dep[-1],
168
+ type: type
169
+ }
170
+ else
171
+ # get name from version conflict resolution ("org:name:version -> version") and no-resolution ("org:name:version")
172
+ {
173
+ name: dep[0..1].join(":"),
174
+ requirement: dep[-1],
175
+ type: type
176
+ }
177
+ end
178
+ end
179
+ .compact
180
+ # Prefer duplicate deps with the aliased ones first, so we don't lose the aliases in the next uniq step.
181
+ .sort_by { |dep| dep.key?(:original_name) || dep.key?(:original_requirement) ? 0 : 1 }
182
+ .uniq { |item| [item[:name], item[:requirement], item[:type]] }
177
183
  end
178
184
 
179
185
  def self.parse_maven_resolved(file_contents, options: {})
@@ -1,3 +1,3 @@
1
1
  module Bibliothecary
2
- VERSION = "8.3.4"
2
+ VERSION = "8.3.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.3.4
4
+ version: 8.3.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-07-05 00:00:00.000000000 Z
11
+ date: 2022-07-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: tomlrb