bibliothecary 8.3.2 → 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: cf83ce2eee3ff72c5c46565c445c66fd9ed78d0a57986feb80437a43f2c948f3
4
- data.tar.gz: 4177c6b7a5b270c4f07128f88b16308e30b2f3f75e50b3367bc1c379576f349a
3
+ metadata.gz: f283979f0fd87432a9d26a07bea9f568276d25102f9b3e343e4304656bedc1fb
4
+ data.tar.gz: 7019277a0e5bcf8ea1b77d76889f7de9322121ec4b7abee44f2f83bfa8b09fe5
5
5
  SHA512:
6
- metadata.gz: 6a3883e9ef9b6713b4f2607283f939c2e0c6523eeefbaac30471d23dafc67506d1a56e032bc7e02f1f7a60d8e10eebe58930325a6df8689d2d66978988cb6bd6
7
- data.tar.gz: 1cd8c5e10724a994155a1585f60453c36161b17774c0a1838e48a47d711728df0ee40de88c18780328c715e8af4cbd09c69684a0f5e989e715a05489f14d5803
6
+ metadata.gz: e81204f529c0dd96cb75f43823a6440197474ddc06b37ddbd71eadcee710d4535f666d7ddfd59a670d96ff8592c22afc0b0c97e544cad2a3c661dd978df243bb
7
+ data.tar.gz: 3b972cbc604d1b1edd059c6a25a53f048eb1ce9554f541736188e1795da61bdf929acbc4999ddbbe3c54f4aad3941e6fc2ee2bf7107086959964d576451555bb
data/README.md CHANGED
@@ -164,7 +164,7 @@ All available config options are in: https://github.com/librariesio/bibliothecar
164
164
 
165
165
  After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
166
166
 
167
- To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
167
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, bump and commit the version number in `version.rb` in the `main` branch, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
168
168
 
169
169
  ## Contributing
170
170
 
@@ -150,7 +150,7 @@ module Bibliothecary
150
150
  def self.parse_go_resolved(file_contents, options: {})
151
151
  JSON.parse(file_contents)
152
152
  .select { |dep| dep["Main"] != "true" }
153
- .map { |dep| { name: dep["Path"], requirement: dep["Version"], type: 'runtime' } }
153
+ .map { |dep| { name: dep["Path"], requirement: dep["Version"], type: dep.fetch("Scope") { "runtime" } } }
154
154
  end
155
155
 
156
156
  def self.map_dependencies(manifest, attr_name, dep_attr_name, version_attr_name, type)
@@ -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,13 +158,28 @@ module Bibliothecary
159
158
  # \--- org.springframework.security:spring-security-test (n)
160
159
  next unless dep.length >= 3
161
160
 
162
- version = dep[-1]
163
- {
164
- name: dep[0..1].join(":"),
165
- requirement: version,
166
- type: type
167
- }
168
- 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]] }
169
183
  end
170
184
 
171
185
  def self.parse_maven_resolved(file_contents, options: {})
@@ -1,3 +1,3 @@
1
1
  module Bibliothecary
2
- VERSION = "8.3.2"
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.2
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-05-26 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