dependabot-nuget 0.91.6 → 0.91.7

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f9db84ea5ab47e5b1ee3f4eb42f13a3f0115cb12b53720c97e27df4f6b9ab32e
4
- data.tar.gz: de8b30ba569f1c5fba0250d431a25b2c4a4d51896115695a0c7e41794f4f7ca6
3
+ metadata.gz: 7fbf46eabaa33dc7f172d57928caf76d3a99d4420441927aae3fff0afda31d1f
4
+ data.tar.gz: f872d841a9445c15bddbc18a9c06a5f4f1722e6fb0cc0a8e78d292707db86baf
5
5
  SHA512:
6
- metadata.gz: 4dbdd641cea70bf9d7c89b56ca97b29190d0d751b486c43fa12c2eed318ac1bb0b299508eadcbbd7e189decb36c24dabd1e63d04cb6956e0f4fd05d8f3f083d3
7
- data.tar.gz: 646ea9b7c91d51e778f6a8fdb1945baa429a7a071f63ee6f838435ae70f68c1ed9822ff0eead8ea8f7bad365f9b7d78ba33b7962f069e2a20e3f340501bce177
6
+ metadata.gz: c16fb958d1c0fab20e392e6e4a1acf2e00c430a7b31dc96562c3b3002a88c0888faf7f3e2c1047bc38bf18366d8f2e0662015cf11536ddafd91208f99f772479
7
+ data.tar.gz: 2c8aa1f8c79c65566c74c676cfd3b02349a430845b540112f963dfbfd929197496962edbb81dee0198aac1b68049fab82ffc41581c7ff52ea3893403c02cf0ca
@@ -6,17 +6,59 @@ require "rubygems_version_patch"
6
6
  # Dotnet pre-release versions use 1.0.1-rc1 syntax, which Gem::Version
7
7
  # converts into 1.0.1.pre.rc1. We override the `to_s` method to stop that
8
8
  # alteration.
9
+ # Dotnet also supports build versions, separated with a "+".
9
10
  module Dependabot
10
11
  module Nuget
11
12
  class Version < Gem::Version
13
+ attr_reader :build_info
14
+
15
+ VERSION_PATTERN = Gem::Version::VERSION_PATTERN + '(\+[0-9a-zA-Z\-.]+)?'
16
+
17
+ def self.correct?(version)
18
+ return false if version.nil?
19
+
20
+ version = version.to_s.split("+").first if version.to_s.include?("+")
21
+ super
22
+ end
23
+
12
24
  def initialize(version)
13
25
  @version_string = version.to_s
26
+
27
+ if version.to_s.include?("+")
28
+ version, @build_info = version.to_s.split("+")
29
+ end
30
+
14
31
  super
15
32
  end
16
33
 
17
34
  def to_s
18
35
  @version_string
19
36
  end
37
+
38
+ def inspect # :nodoc:
39
+ "#<#{self.class} #{@version_string}>"
40
+ end
41
+
42
+ def <=>(other)
43
+ version_comparison = super(other)
44
+ return version_comparison unless version_comparison.zero?
45
+
46
+ return build_info.nil? ? 0 : 1 unless other.is_a?(Nuget::Version)
47
+
48
+ # Build information comparison
49
+ lhsegments = build_info.to_s.split(".").map(&:downcase)
50
+ rhsegments = other.build_info.to_s.split(".").map(&:downcase)
51
+ limit = [lhsegments.count, rhsegments.count].min
52
+
53
+ lhs = ["1", *lhsegments.first(limit)].join(".")
54
+ rhs = ["1", *rhsegments.first(limit)].join(".")
55
+
56
+ local_comparison = Gem::Version.new(lhs) <=> Gem::Version.new(rhs)
57
+
58
+ return local_comparison unless local_comparison.zero?
59
+
60
+ lhsegments.count <=> rhsegments.count
61
+ end
20
62
  end
21
63
  end
22
64
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dependabot-nuget
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.91.6
4
+ version: 0.91.7
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.91.6
19
+ version: 0.91.7
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.91.6
26
+ version: 0.91.7
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: byebug
29
29
  requirement: !ruby/object:Gem::Requirement