dependabot-cargo 0.87.11 → 0.87.12
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/dependabot/cargo/update_checker/file_preparer.rb +38 -18
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b1cea58c29ba4b87e36c6f518c9a792b7412ca68ff0250adfb3e9c35816dcac4
|
4
|
+
data.tar.gz: a8acdca43d8971141e16c4ff7036f13fb62dcc4a2a292e6b85955f920443cba3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 984fbf1f7474f261cadbb2731b195315e2440c9958c9f3c916a964f1c443c190c6761341cdd239c865270ed0d32c47db0fbbb49a0c47160bd02971264e34eb50
|
7
|
+
data.tar.gz: 5fc854d29970ad99e774923bb7411440d24125293d57062b6a71b8a6c9789f26026bbf0027d29dc1ede2c2a22f08e7fc3cd06637024a9220b5804d22df0cb017
|
@@ -68,14 +68,16 @@ module Dependabot
|
|
68
68
|
parsed_manifest = TomlRB.parse(content)
|
69
69
|
|
70
70
|
Cargo::FileParser::DEPENDENCY_TYPES.each do |type|
|
71
|
-
|
71
|
+
dependency_names_for_type(parsed_manifest, type).each do |name|
|
72
|
+
req = parsed_manifest.dig(type, name)
|
72
73
|
|
73
|
-
|
74
|
+
updated_req = temporary_requirement_for_resolution(filename)
|
74
75
|
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
76
|
+
if req.is_a?(Hash)
|
77
|
+
parsed_manifest[type][name]["version"] = updated_req
|
78
|
+
else
|
79
|
+
parsed_manifest[type][name] = updated_req
|
80
|
+
end
|
79
81
|
end
|
80
82
|
end
|
81
83
|
|
@@ -86,18 +88,18 @@ module Dependabot
|
|
86
88
|
parsed_manifest = TomlRB.parse(content)
|
87
89
|
|
88
90
|
Cargo::FileParser::DEPENDENCY_TYPES.each do |type|
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
replacement_git_pin
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
91
|
+
dependency_names_for_type(parsed_manifest, type).each do |name|
|
92
|
+
req = parsed_manifest.dig(type, name)
|
93
|
+
next unless req.is_a?(Hash)
|
94
|
+
next unless [req["tag"], req["rev"]].compact.uniq.count == 1
|
95
|
+
|
96
|
+
if req["tag"]
|
97
|
+
parsed_manifest[type][name]["tag"] = replacement_git_pin
|
98
|
+
end
|
99
|
+
|
100
|
+
if req["rev"]
|
101
|
+
parsed_manifest[type][name]["rev"] = replacement_git_pin
|
102
|
+
end
|
101
103
|
end
|
102
104
|
end
|
103
105
|
|
@@ -172,6 +174,24 @@ module Dependabot
|
|
172
174
|
fetch("version")
|
173
175
|
end
|
174
176
|
|
177
|
+
def dependency_names_for_type(parsed_manifest, type)
|
178
|
+
names = []
|
179
|
+
parsed_manifest.fetch(type, {}).each do |nm, req|
|
180
|
+
next unless dependency.name == name_from_declaration(nm, req)
|
181
|
+
names << nm
|
182
|
+
end
|
183
|
+
names
|
184
|
+
end
|
185
|
+
|
186
|
+
def name_from_declaration(name, declaration)
|
187
|
+
return name if declaration.is_a?(String)
|
188
|
+
unless declaration.is_a?(Hash)
|
189
|
+
raise "Unexpected dependency declaration: #{declaration}"
|
190
|
+
end
|
191
|
+
|
192
|
+
declaration.fetch("package", name)
|
193
|
+
end
|
194
|
+
|
175
195
|
def manifest_files
|
176
196
|
@manifest_files ||=
|
177
197
|
dependency_files.select { |f| f.name.end_with?("Cargo.toml") }
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dependabot-cargo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.87.
|
4
|
+
version: 0.87.12
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dependabot
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.87.
|
19
|
+
version: 0.87.12
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - '='
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 0.87.
|
26
|
+
version: 0.87.12
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: byebug
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|