dependabot-gradle 0.142.1 → 0.143.0

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: a5b6fa770d8e9599a20a080b3e22415f6a0e209e24966ef047e6b9e6ed6c9ef4
4
- data.tar.gz: b6c8a40691d1676ae740596ff973875345306e59650faeb222f8fe1671c466b7
3
+ metadata.gz: db6059748f0c1f692f360fda9e80311ccafc6fd84ad878183c4c4316f48a4d7e
4
+ data.tar.gz: 1b5ea811c9ef709285f5dbde439aa4b913cec9af04c1bf15297f5079b89a47ce
5
5
  SHA512:
6
- metadata.gz: e3b7a3d703fe107086bdf6277654cf13d2adfa1ea33414977d2f1a97d6eac5499b9982b5d0a9a5e2bf9b81644a09fb8f98ebd8c3543314eb0f3c4b580c7875b3
7
- data.tar.gz: 94e957eb4160eb1a20f9faeef7ef5f58e4d1adb4d6d2982878a2662247ffb17747aaa73e307121a9af3c4acebea6a624d2c644161f483a797910a90bd0f9d601
6
+ metadata.gz: cf4462b6930947c632b12aeb6b8fd06a7906e2c4afc88ef6c5ae56cd2cd2ea82c6572723242f487f8febc26a7698561697a7f064ebbefdd1395fd185d23b771b
7
+ data.tar.gz: ae774d6872823ad22a079104c94c8f8fe4d2fde67c446e040d82a11004d85138977ed62afa10090ea08a8670342307a717c09410a26797eb26b752e2ce3b8c73
@@ -1,6 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require "dependabot/utils"
4
+ require "dependabot/maven/requirement"
4
5
  require "dependabot/gradle/version"
5
6
 
6
7
  module Dependabot
@@ -32,7 +33,14 @@ module Dependabot
32
33
 
33
34
  def initialize(*requirements)
34
35
  requirements = requirements.flatten.flat_map do |req_string|
35
- convert_java_constraint_to_ruby_constraint(req_string)
36
+ # NOTE: Support ruby-style version requirements that are created from
37
+ # PR ignore conditions
38
+ version_reqs = req_string.split(",").map(&:strip)
39
+ if version_reqs.all? { |s| Gem::Requirement::PATTERN.match?(s) }
40
+ version_reqs
41
+ else
42
+ convert_java_constraint_to_ruby_constraint(req_string)
43
+ end
36
44
  end
37
45
 
38
46
  super(requirements)
@@ -46,7 +54,9 @@ module Dependabot
46
54
  private
47
55
 
48
56
  def self.split_java_requirement(req_string)
49
- req_string.split(/(?<=\]|\)),/).flat_map do |str|
57
+ return [req_string] unless req_string.match?(Maven::Requirement::OR_SYNTAX)
58
+
59
+ req_string.split(Maven::Requirement::OR_SYNTAX).flat_map do |str|
50
60
  next str if str.start_with?("(", "[")
51
61
 
52
62
  exacts, *rest = str.split(/,(?=\[|\()/)
@@ -17,8 +17,6 @@ module Dependabot
17
17
  KOTLIN_PLUGIN_REPO_PREFIX = "org.jetbrains.kotlin"
18
18
  TYPE_SUFFICES = %w(jre android java).freeze
19
19
 
20
- GRADLE_RANGE_REGEX = /[\(\[].*,.*[\)\]]/.freeze
21
-
22
20
  def initialize(dependency:, dependency_files:, credentials:,
23
21
  ignored_versions:, raise_on_ignored: false,
24
22
  security_advisories:)
@@ -99,10 +97,10 @@ module Dependabot
99
97
  filtered = possible_versions
100
98
 
101
99
  ignored_versions.each do |req|
102
- ignore_req = Gradle::Requirement.new(parse_requirement_string(req))
100
+ ignore_requirements = Gradle::Requirement.requirements_array(req)
103
101
  filtered =
104
102
  filtered.
105
- reject { |v| ignore_req.satisfied_by?(v.fetch(:version)) }
103
+ reject { |v| ignore_requirements.any? { |r| r.satisfied_by?(v.fetch(:version)) } }
106
104
  end
107
105
 
108
106
  raise AllVersionsIgnored if @raise_on_ignored && filtered.empty? && possible_versions.any?
@@ -128,12 +126,6 @@ module Dependabot
128
126
  end
129
127
  end
130
128
 
131
- def parse_requirement_string(string)
132
- return string if string.match?(GRADLE_RANGE_REGEX)
133
-
134
- string.split(",").map(&:strip)
135
- end
136
-
137
129
  def wants_prerelease?
138
130
  return false unless dependency.version
139
131
  return false unless version_class.correct?(dependency.version)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dependabot-gradle
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.142.1
4
+ version: 0.143.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dependabot
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-04-16 00:00:00.000000000 Z
11
+ date: 2021-04-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dependabot-common
@@ -16,28 +16,28 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 0.142.1
19
+ version: 0.143.0
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.142.1
26
+ version: 0.143.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: dependabot-maven
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - '='
32
32
  - !ruby/object:Gem::Version
33
- version: 0.142.1
33
+ version: 0.143.0
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - '='
39
39
  - !ruby/object:Gem::Version
40
- version: 0.142.1
40
+ version: 0.143.0
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: byebug
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -114,14 +114,14 @@ dependencies:
114
114
  requirements:
115
115
  - - "~>"
116
116
  - !ruby/object:Gem::Version
117
- version: 1.12.0
117
+ version: 1.13.0
118
118
  type: :development
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
122
  - - "~>"
123
123
  - !ruby/object:Gem::Version
124
- version: 1.12.0
124
+ version: 1.13.0
125
125
  - !ruby/object:Gem::Dependency
126
126
  name: simplecov
127
127
  requirement: !ruby/object:Gem::Requirement