dependabot-pub 0.392.0 → 0.393.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/dependabot/pub/helpers.rb +19 -22
  3. metadata +4 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9b39deceee9e7e4be52a1fb5ade31bdff9297df770a3b626b96dad32734d2e65
4
- data.tar.gz: 55f79fa60dfde8fa7600a6d1e74c1228476614ecd8813e5ef81a03c76c369c80
3
+ metadata.gz: 1b29eb5cf558e8d1223bbab5062f15246933e5e312be95c1ae2c2b9eefd0cb9e
4
+ data.tar.gz: 6af10c2f14fdd2e0dc5c324c3a1b0d3af14a82647189c2e92a85b55fcc8cce45
5
5
  SHA512:
6
- metadata.gz: 3264a592f1daa1440d650ff1f93992592793cd5235a02ff583f99746c5f1fcff63d69524e48ca7ae175a71c2400dda41f748b0f3ed2164cc20830aa9385a75aa
7
- data.tar.gz: 909ad21285948af17082a8b8ba14996bd20d04d1dc7d2d1ae14b43922903d4becb570d6536e8428fdd73b9d23483e1e6349173fcc7911aa5fa33f8a989930f96
6
+ metadata.gz: 70f8b94d4e648870323294ac1afd04452ccf05b8f755a2c15443e19b98f7138762ca8f3cea461dc11f20d821a6e0016c169036918a7f764513f2f6fe2bdd26df
7
+ data.tar.gz: 792a68fbdb3cbd1f4a63df868102bb3b86aa6c14746ce877cc32ec37287cf729684d854bef05e2936518596d5aa3f487696f87f2070ce6617d6f1546a623355b
@@ -344,17 +344,12 @@ module Dependabot
344
344
  .returns(Dependabot::Dependency)
345
345
  end
346
346
  def parse_updated_dependency(json, requirements_update_strategy)
347
- params = {
348
- name: json["name"],
349
- version: json["version"],
350
- package_manager: "pub",
351
- requirements: []
352
- }
347
+ requirements = []
353
348
  constraint_field = constraint_field_from_update_strategy(requirements_update_strategy)
354
349
 
355
350
  if json["kind"] != "transitive" && !json[constraint_field].nil?
356
351
  constraint = json[constraint_field]
357
- params[:requirements] << {
352
+ requirements << {
358
353
  requirement: constraint,
359
354
  groups: [json["kind"]],
360
355
  source: nil, # TODO: Expose some information about the source
@@ -362,23 +357,25 @@ module Dependabot
362
357
  }
363
358
  end
364
359
 
365
- if json["previousVersion"]
366
- params = {
367
- **params,
368
- previous_version: json["previousVersion"],
369
- previous_requirements: []
360
+ previous_requirements = []
361
+ if json["previousVersion"] && json["kind"] != "transitive" && !json["previousConstraint"].nil?
362
+ constraint = json["previousConstraint"]
363
+ previous_requirements << {
364
+ requirement: constraint,
365
+ groups: [json["kind"]],
366
+ source: nil, # TODO: Expose some information about the source
367
+ file: "pubspec.yaml"
370
368
  }
371
- if json["kind"] != "transitive" && !json["previousConstraint"].nil?
372
- constraint = json["previousConstraint"]
373
- params[:previous_requirements] << {
374
- requirement: constraint,
375
- groups: [json["kind"]],
376
- source: nil, # TODO: Expose some information about the source
377
- file: "pubspec.yaml"
378
- }
379
- end
380
369
  end
381
- Dependency.new(**T.unsafe(params))
370
+
371
+ Dependency.new(
372
+ name: json["name"],
373
+ version: json["version"],
374
+ package_manager: "pub",
375
+ requirements: requirements,
376
+ previous_version: json["previousVersion"],
377
+ previous_requirements: json["previousVersion"] ? previous_requirements : nil
378
+ )
382
379
  end
383
380
 
384
381
  # expects "auto" to already have been resolved to one of the other
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dependabot-pub
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.392.0
4
+ version: 0.393.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dependabot
@@ -15,14 +15,14 @@ dependencies:
15
15
  requirements:
16
16
  - - '='
17
17
  - !ruby/object:Gem::Version
18
- version: 0.392.0
18
+ version: 0.393.0
19
19
  type: :runtime
20
20
  prerelease: false
21
21
  version_requirements: !ruby/object:Gem::Requirement
22
22
  requirements:
23
23
  - - '='
24
24
  - !ruby/object:Gem::Version
25
- version: 0.392.0
25
+ version: 0.393.0
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: debug
28
28
  requirement: !ruby/object:Gem::Requirement
@@ -260,7 +260,7 @@ licenses:
260
260
  - MIT
261
261
  metadata:
262
262
  bug_tracker_uri: https://github.com/dependabot/dependabot-core/issues
263
- changelog_uri: https://github.com/dependabot/dependabot-core/releases/tag/v0.392.0
263
+ changelog_uri: https://github.com/dependabot/dependabot-core/releases/tag/v0.393.0
264
264
  rdoc_options: []
265
265
  require_paths:
266
266
  - lib