dependabot-common 0.145.4 → 0.148.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: ddf544db22f6cd0f186d30314a7f739c307fd39c6d6154ba3e3695707c940479
4
- data.tar.gz: ea8f1f2404c68e01f90fa382b51994f9bc2d09ed31a01fe527a4acb69843406f
3
+ metadata.gz: 9e2dfebda37fda8f57a5b23574d9eac6906aef7c27fe59067ca7a9b7cac32c29
4
+ data.tar.gz: 5bfa25849873dba68c6e5b9ecc707fb1638a88f8e023f8d80c3648651ec48981
5
5
  SHA512:
6
- metadata.gz: 9467032f9bf7632a832e127f87755103b860725b05d18a6f6d198cd5b265e6f864e21c22d9aeab6bd1bab3328f44f94dfa2507b25a680beae7c3707968b5e0cf
7
- data.tar.gz: 7f53c347a240b6a4a71bf645c96bd63e6ca5791e11a57eb944f544d8d70b192e679ded0e9e97fdf4b28f4883a2e1a58cd9de232a607222d038d0e13faf73c168
6
+ metadata.gz: 8e608134523661f73b9f75f88f4e6e3d14261f92d5c746356566ea07c2efebd2571122f292af88579a1a5874a8b9b68cfdc84e3e6216afb7ccfe2f0736480ec1
7
+ data.tar.gz: b7b3f0e2163b8972214a52de596f3c0e6e0fd5e605804018e3be7d94ef73e9f85ee6c385b9840ba0999bb2edeb2955d0e2f952b6a700baf1cfa66e4b15e5bef9
@@ -87,13 +87,16 @@ module Dependabot
87
87
  end
88
88
 
89
89
  # rubocop:disable Metrics/PerceivedComplexity
90
+ # rubocop:disable Metrics/AbcSize
90
91
  def local_tag_for_latest_version
91
92
  tags =
92
93
  local_tags.
93
94
  select { |t| version_tag?(t.name) && matches_existing_prefix?(t.name) }
94
95
  filtered = tags.
95
96
  reject { |t| tag_included_in_ignore_requirements?(t) }
96
- raise Dependabot::AllVersionsIgnored if @raise_on_ignored && tags.any? && filtered.empty?
97
+ if @raise_on_ignored && filter_lower_versions(filtered).empty? && filter_lower_versions(tags).any?
98
+ raise Dependabot::AllVersionsIgnored
99
+ end
97
100
 
98
101
  tag = filtered.
99
102
  reject { |t| tag_is_prerelease?(t) && !wants_prerelease? }.
@@ -113,8 +116,29 @@ module Dependabot
113
116
  tag_sha: tag.tag_sha
114
117
  }
115
118
  end
119
+ # rubocop:enable Metrics/AbcSize
116
120
  # rubocop:enable Metrics/PerceivedComplexity
117
121
 
122
+ def current_version
123
+ return unless dependency.version && version_tag?(dependency.version)
124
+
125
+ version = dependency.version.match(VERSION_REGEX).named_captures.fetch("version")
126
+ version_class.new(version)
127
+ end
128
+
129
+ def filter_lower_versions(tags)
130
+ return tags unless current_version
131
+
132
+ versions = tags.map do |t|
133
+ version = t.name.match(VERSION_REGEX).named_captures.fetch("version")
134
+ version_class.new(version)
135
+ end
136
+
137
+ versions.select do |version|
138
+ version > current_version
139
+ end
140
+ end
141
+
118
142
  def local_tag_for_pinned_version
119
143
  return unless pinned?
120
144
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Dependabot
4
- VERSION = "0.145.4"
4
+ VERSION = "0.148.0"
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.145.4
4
+ version: 0.148.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-05-10 00:00:00.000000000 Z
11
+ date: 2021-05-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -298,14 +298,14 @@ dependencies:
298
298
  requirements:
299
299
  - - "~>"
300
300
  - !ruby/object:Gem::Version
301
- version: 1.14.0
301
+ version: 1.15.0
302
302
  type: :development
303
303
  prerelease: false
304
304
  version_requirements: !ruby/object:Gem::Requirement
305
305
  requirements:
306
306
  - - "~>"
307
307
  - !ruby/object:Gem::Version
308
- version: 1.14.0
308
+ version: 1.15.0
309
309
  - !ruby/object:Gem::Dependency
310
310
  name: simplecov
311
311
  requirement: !ruby/object:Gem::Requirement