bibliothecary 8.7.5 → 8.7.6

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: 3fbd83e689755fcae99771b12a88ce74a9c31c22d60b11b40fcb552987628f45
4
- data.tar.gz: deb85d3948752fd0a3142bb41d5cd07bde78b4604b95a77eb652b2d7a6d2634b
3
+ metadata.gz: 57b89f5321f44b47f940c8fe8be9e50e2007ad4176fd002744f1f44a2bd9cbe7
4
+ data.tar.gz: 742a28fbf8a17708e64736bf49039347af391db3b1ad4c62355df83f45459d5f
5
5
  SHA512:
6
- metadata.gz: f72d8392eae9835fa51ce423d76f2664592e666964dbf921d25b03d0edef6c5f79adb64e3527c89a2f0ecc9c88958e51de223c93b405a70d28e1a1ca73626dcf
7
- data.tar.gz: d9928f3e5181293c015bbf72985bd7baf50f5126655e96cbb5d64d0abbe88c0a061b37a672ce7ea06869d6c1aedcec68fa02ea89fc7a4bc0ba45e32ad692b35d
6
+ metadata.gz: 7a86455347539c89417c398c19e99ff8cd4ea84d52057c4e67f991f6ac518083db567a733b83cc4044dbb326d4a7322dde9514b3a486ed1c7825bc6cf2fdad7c
7
+ data.tar.gz: a3c33ebc60114b4c9627d8dfd205d0579e32efd706c01fc84f00606d378db05c103f50655eb68c8b2f6383d0b50c9fcf7370a65d16d18c0dd1a9dd74241bbf45
@@ -129,8 +129,12 @@ module Bibliothecary
129
129
 
130
130
  deps = categorized_deps["require"]
131
131
  .map do |dep|
132
- # A "replace" directive doesn't add the dep to the module graph unless the original dep is also in a "require" directive,
132
+ # NOTE: A "replace" directive doesn't add the dep to the module graph unless the original dep is also in a "require" directive,
133
133
  # so we need to track down replacements here and use those instead of the originals, if present.
134
+ #
135
+ # NOTE: The "replace" directive doesn't actually change the version reported from Go (e.g. "go mod graph"), it only changes
136
+ # the *source code*. So by replacing the deps here, we're giving more honest results than you'd get when asking go
137
+ # about the versions used.
134
138
  replaced_dep = categorized_deps["replace"]
135
139
  .find do |replacement_dep|
136
140
  replacement_dep[:original_name] == dep[:name] &&
@@ -187,7 +191,18 @@ module Bibliothecary
187
191
  def self.parse_go_resolved(file_contents, options: {}) # rubocop:disable Lint/UnusedMethodArgument
188
192
  JSON.parse(file_contents)
189
193
  .select { |dep| dep["Main"] != "true" }
190
- .map { |dep| { name: dep["Path"], requirement: dep["Version"], type: dep.fetch("Scope") { "runtime" } } }
194
+ .map do |dep|
195
+ if dep["Replace"].is_a?(String) && dep["Replace"] != "<nil>" && dep["Replace"] != ""
196
+ # NOTE: The "replace" directive doesn't actually change the version reported from Go (e.g. "go mod graph"), it only changes
197
+ # the *source code*. So by replacing the deps here, we're giving more honest results than you'd get when asking go
198
+ # about the versions used.
199
+ name, requirement = dep["Replace"].split(" ", 2)
200
+ requirement = "*" if requirement.to_s.strip == ""
201
+ { name: name, requirement: requirement, original_name: dep["Path"], original_requirement: dep["Version"], type: dep.fetch("Scope") { "runtime" } }
202
+ else
203
+ { name: dep["Path"], requirement: dep["Version"], type: dep.fetch("Scope") { "runtime" } }
204
+ end
205
+ end
191
206
  end
192
207
 
193
208
  def self.map_dependencies(manifest, attr_name, dep_attr_name, version_attr_name, type)
@@ -1,3 +1,3 @@
1
1
  module Bibliothecary
2
- VERSION = "8.7.5"
2
+ VERSION = "8.7.6"
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.7.5
4
+ version: 8.7.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Nesbitt
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-01-08 00:00:00.000000000 Z
11
+ date: 2024-01-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: tomlrb