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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b5f2a002b4c408178e04d09c6ea0adda0a402aa5265c66448ea1d7a37c120ab4
4
- data.tar.gz: 4167a8d2db7f522f82d6e391902c0142f82aa43ae8f481dc71ab76170d660715
3
+ metadata.gz: b1cea58c29ba4b87e36c6f518c9a792b7412ca68ff0250adfb3e9c35816dcac4
4
+ data.tar.gz: a8acdca43d8971141e16c4ff7036f13fb62dcc4a2a292e6b85955f920443cba3
5
5
  SHA512:
6
- metadata.gz: 60b95620931b1c5a84b7b4af8007ba9f9f754bcb5170584eb756b955bbb7763ecf5981bcae3eac4a5bdbaca3c7daf82f9e30f5f3f916de5c93397ecd97145de8
7
- data.tar.gz: 0fc8cb5034a8a30fb0fcd964629dbc24714e5c11e0a1012948703c2faea67a73f8bc41e7aed42f893c37dd31a16effed0fba910f76bff90f9d8d8e75c894365f
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
- next unless (req = parsed_manifest.dig(type, dependency.name))
71
+ dependency_names_for_type(parsed_manifest, type).each do |name|
72
+ req = parsed_manifest.dig(type, name)
72
73
 
73
- updated_req = temporary_requirement_for_resolution(filename)
74
+ updated_req = temporary_requirement_for_resolution(filename)
74
75
 
75
- if req.is_a?(Hash)
76
- parsed_manifest[type][dependency.name]["version"] = updated_req
77
- else
78
- parsed_manifest[type][dependency.name] = updated_req
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
- next unless (req = parsed_manifest.dig(type, dependency.name))
90
- next unless req.is_a?(Hash)
91
- next unless [req["tag"], req["rev"]].compact.uniq.count == 1
92
-
93
- if req["tag"]
94
- parsed_manifest[type][dependency.name]["tag"] =
95
- replacement_git_pin
96
- end
97
-
98
- if req["rev"]
99
- parsed_manifest[type][dependency.name]["rev"] =
100
- replacement_git_pin
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.11
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.11
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.11
26
+ version: 0.87.12
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: byebug
29
29
  requirement: !ruby/object:Gem::Requirement