sem_version 2.0.0 → 2.0.1
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 +6 -14
- data/lib/sem_version.rb +7 -7
- metadata +9 -9
checksums.yaml
CHANGED
@@ -1,15 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
metadata.gz: !binary |-
|
9
|
-
MmIxMGM1ODRkNTUxM2Q2MDAxNGUwOGEwMDlhNWU0MmQ1ODM5NGQ3YjU4ZmVm
|
10
|
-
ZDJmNDVkN2JkNzc1ZDdlZGYyN2U5MjI2YzVlODU5MzU3YmYxY2YwZDgwZDcw
|
11
|
-
ZTUwNDkwODc0OTRiMDMxNDdlNWU2YjMyNjc4NGU2MDk3YTY3NmM=
|
12
|
-
data.tar.gz: !binary |-
|
13
|
-
ZjI3ZGUxZDc5Y2NiNzBmNjkxNTRiN2JlZWYyYTI5NGRmOGI1OTMxYzVkYWYz
|
14
|
-
YTA4MjZhYTY4MjIxMzIwZjc2NGZhNjhiNTNmYzJmNWEzZTNkNWM2NDU5ZGQ2
|
15
|
-
MWM4NDA3NzRmMzM1MzJkNzI0MWUwMDIwYzc0NDc3YzNhYTJkZWQ=
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: c25d7c643f41f83d589c59739ecc0b4945e0336a
|
4
|
+
data.tar.gz: 033ff26d8a9ba13eb9cea4f06aedf0bbbb705f1e
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 23084d1e65bcc51841a783bebb6d6d1cb7409ace21459cd3ed7cf8b369085a3fd65ac644426e384d98aabe24865baba3cf7bb181796e6163120d1b6052908ad1
|
7
|
+
data.tar.gz: 188aa886dc296f09ed6279cb902aeaef198a8bb39f8c41b1719091463d6e7cca3783fe42ad174b2d9a68b4132b1ced6d0dbf7ef95495fa6734780996d7dc253e
|
data/lib/sem_version.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
class SemVersion
|
2
2
|
include Comparable
|
3
3
|
|
4
|
-
VERSION = '2.0.
|
4
|
+
VERSION = '2.0.1'
|
5
5
|
|
6
6
|
# Pattern allows min and patch to be skipped. We have to do extra checking if we want them
|
7
7
|
SEMVER_REGEX = /^(\d+)(?:\.(\d+)(?:\.(\d+)(?:-([\dA-Za-z\-]+(?:\.[\dA-Za-z\-]+)*))?(?:\+([\dA-Za-z\-]+(?:\.[\dA-Za-z\-]+)*))?)?)?$/
|
@@ -104,17 +104,17 @@ class SemVersion
|
|
104
104
|
end
|
105
105
|
|
106
106
|
def major=(val)
|
107
|
-
raise ArgumentError, "#{val} is not a valid major version (must be an integer >= 0)" unless val.is_a?(
|
107
|
+
raise ArgumentError, "#{val} is not a valid major version (must be an integer >= 0)" unless val.is_a?(Integer) && val >= 0
|
108
108
|
@major = val
|
109
109
|
end
|
110
110
|
|
111
111
|
def minor=(val)
|
112
|
-
raise ArgumentError, "#{val} is not a valid minor version (must be an integer >= 0)" unless val.is_a?(
|
112
|
+
raise ArgumentError, "#{val} is not a valid minor version (must be an integer >= 0)" unless val.is_a?(Integer) && val >= 0
|
113
113
|
@minor = val
|
114
114
|
end
|
115
115
|
|
116
116
|
def patch=(val)
|
117
|
-
raise ArgumentError, "#{val} is not a valid patch version (must be an integer >= 0)" unless val.is_a?(
|
117
|
+
raise ArgumentError, "#{val} is not a valid patch version (must be an integer >= 0)" unless val.is_a?(Integer) && val >= 0
|
118
118
|
@patch = val
|
119
119
|
end
|
120
120
|
|
@@ -182,9 +182,9 @@ class SemVersion
|
|
182
182
|
|
183
183
|
def validate
|
184
184
|
# Validates the instance variables. Different approach to validating a raw string
|
185
|
-
raise ArgumentError, "Invalid version (major is not an int >= 0)" unless @major.is_a?(
|
186
|
-
raise ArgumentError, "Invalid version (minor is not an int >= 0)" unless @minor.is_a?(
|
187
|
-
raise ArgumentError, "Invalid version (patch is not an int >= 0)" unless @patch.is_a?(
|
185
|
+
raise ArgumentError, "Invalid version (major is not an int >= 0)" unless @major.is_a?(Integer) && @major >= 0
|
186
|
+
raise ArgumentError, "Invalid version (minor is not an int >= 0)" unless @minor.is_a?(Integer) && @minor >= 0
|
187
|
+
raise ArgumentError, "Invalid version (patch is not an int >= 0)" unless @patch.is_a?(Integer) && @patch >= 0
|
188
188
|
unless @pre.nil? || (@pre.is_a?(String) && @pre =~ PRE_METADATA_REGEX)
|
189
189
|
raise ArgumentError, "Invalid version (pre must be nil, or a string following http://semver.org contraints)"
|
190
190
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sem_version
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Antony Male
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-06-25 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Semantic Version parsing, comparison, and constraint checking utility
|
14
14
|
(e.g. ~> 1.2), as specified by http://semver.org/
|
@@ -17,10 +17,10 @@ executables: []
|
|
17
17
|
extensions: []
|
18
18
|
extra_rdoc_files: []
|
19
19
|
files:
|
20
|
-
- lib/sem_version/core_ext.rb
|
21
|
-
- lib/sem_version.rb
|
22
|
-
- README.md
|
23
20
|
- LICENSE
|
21
|
+
- README.md
|
22
|
+
- lib/sem_version.rb
|
23
|
+
- lib/sem_version/core_ext.rb
|
24
24
|
homepage: https://github.com/canton7/sem_version
|
25
25
|
licenses:
|
26
26
|
- MIT
|
@@ -31,19 +31,19 @@ require_paths:
|
|
31
31
|
- lib
|
32
32
|
required_ruby_version: !ruby/object:Gem::Requirement
|
33
33
|
requirements:
|
34
|
-
- -
|
34
|
+
- - ">="
|
35
35
|
- !ruby/object:Gem::Version
|
36
36
|
version: 1.9.2
|
37
37
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
38
38
|
requirements:
|
39
|
-
- -
|
39
|
+
- - ">="
|
40
40
|
- !ruby/object:Gem::Version
|
41
41
|
version: '0'
|
42
42
|
requirements: []
|
43
43
|
rubyforge_project:
|
44
|
-
rubygems_version: 2.
|
44
|
+
rubygems_version: 2.4.5.2
|
45
45
|
signing_key:
|
46
46
|
specification_version: 4
|
47
|
-
summary:
|
47
|
+
summary: 'SemVersion: Semantic version parsing and comparison, and constraint checking.
|
48
48
|
See http://semver.org/'
|
49
49
|
test_files: []
|