dependabot-common 0.143.5 → 0.143.6

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: 519d829e63edf21602f5031e532dbccce99323676b624ff130e089b6f3ec44ef
4
- data.tar.gz: 3fb4986daa15f8d92a5af167473d3b32ed3132699fa4f2c85ebf2060632f55e7
3
+ metadata.gz: c507c27ae833e3fe63860d4dc1540e660a1552174fd9144e10234bb74f94407f
4
+ data.tar.gz: 459365a8dafc748237967f3090a10e0d6f7be7f2ecbf9b9b3726a475973eb4d7
5
5
  SHA512:
6
- metadata.gz: dd23c91a75da2f3a93719a031c42d259dee57c7b7f489a044c3480dee8cfb5f55a48a19a961a90064d6939710574d3ef0531755d685bbff7457475306969b16e
7
- data.tar.gz: c1b8bbdadea4755383f7585752d1bcedd1f875475e31b452ffb8e74578fac2152b250bf071840361bd958eb9240b5adcb0671e04a915fc2baf86b0297f382585
6
+ metadata.gz: 12870c6cddfb8447569d35e08e769c492aef0d05cc9d74e81ea80497b8e487d3ce6e763fa21073abc3ac8f88b72938b753a0acef80574c5ec0c954082b2e5514
7
+ data.tar.gz: dba3dab805156d4f6eb84fd7122861e8b9f5c4df06aad5146bc974c2e8e9cff06a3594061b6bed6bc3a3017b829b3c900f820abb78591cb09c60efe571cd53f5
@@ -47,53 +47,44 @@ module Dependabot
47
47
  end
48
48
 
49
49
  def ignore_patch(version)
50
- parts = version.split(".")
51
- return [] unless parts.size > 2
50
+ return [] unless rubygems_compatible?(version)
52
51
 
53
- lower_parts = parts.first(2) + ["a"]
54
- upper_parts = parts.first(2)
55
- upper_parts[1] = upper_parts[1].to_i + 1
56
- lower_bound = ">= #{lower_parts.join('.')}"
52
+ parts = version.split(".")
53
+ version_parts = parts.fill(0, parts.length...2)
54
+ upper_parts = version_parts.first(1) + [version_parts[1].to_i + 1]
55
+ lower_bound = "> #{version}"
57
56
  upper_bound = "< #{upper_parts.join('.')}"
57
+
58
58
  ["#{lower_bound}, #{upper_bound}"]
59
59
  end
60
60
 
61
61
  def ignore_minor(version)
62
- parts = version.split(".")
63
- return [] if parts.size < 2
64
-
65
- if Gem::Version.correct?(version)
66
- lower_parts = parts.first(2) + ["a"]
67
- upper_parts = parts.first(1)
68
- lower_parts[1] = lower_parts[1].to_i + 1
69
- upper_parts[0] = upper_parts[0].to_i + 1
70
- else
71
- lower_parts = parts.first(1) + ["a"]
72
- upper_parts = parts.first(1)
73
- begin
74
- upper_parts[0] = Integer(upper_parts[0]) + 1
75
- rescue ArgumentError
76
- upper_parts.push(999_999)
77
- end
78
- end
62
+ return [] unless rubygems_compatible?(version)
79
63
 
64
+ parts = version.split(".")
65
+ version_parts = parts.fill(0, parts.length...2)
66
+ lower_parts = version_parts.first(1) + [version_parts[1].to_i + 1] + ["a"]
67
+ upper_parts = version_parts.first(0) + [version_parts[0].to_i + 1]
80
68
  lower_bound = ">= #{lower_parts.join('.')}"
81
69
  upper_bound = "< #{upper_parts.join('.')}"
70
+
82
71
  ["#{lower_bound}, #{upper_bound}"]
83
72
  end
84
73
 
85
74
  def ignore_major(version)
86
- parts = version.split(".")
87
- return [] unless parts.size > 1
75
+ return [] unless rubygems_compatible?(version)
88
76
 
89
- lower_parts = parts.first(1) + ["a"]
90
- upper_parts = parts.first(1)
91
- lower_parts[0] = lower_parts[0].to_i + 1
92
- upper_parts[0] = upper_parts[0].to_i + 2
77
+ version_parts = version.split(".")
78
+ lower_parts = [version_parts[0].to_i + 1] + ["a"]
93
79
  lower_bound = ">= #{lower_parts.join('.')}"
94
- upper_bound = "< #{upper_parts.join('.')}"
95
80
 
96
- ["#{lower_bound}, #{upper_bound}"]
81
+ [lower_bound]
82
+ end
83
+
84
+ def rubygems_compatible?(version)
85
+ return false if version.nil? || version.empty?
86
+
87
+ Gem::Version.correct?(version)
97
88
  end
98
89
  end
99
90
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Dependabot
4
- VERSION = "0.143.5"
4
+ VERSION = "0.143.6"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dependabot-common
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.143.5
4
+ version: 0.143.6
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-29 00:00:00.000000000 Z
11
+ date: 2021-04-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport