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 +4 -4
- data/lib/bibliothecary/parsers/go.rb +17 -2
- data/lib/bibliothecary/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 57b89f5321f44b47f940c8fe8be9e50e2007ad4176fd002744f1f44a2bd9cbe7
|
4
|
+
data.tar.gz: 742a28fbf8a17708e64736bf49039347af391db3b1ad4c62355df83f45459d5f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
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)
|
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.
|
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-
|
11
|
+
date: 2024-01-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: tomlrb
|