File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -150,7 +150,11 @@ module Shards
150
150
end
151
151
152
152
def self.prerelease ?(str)
153
- str.each_char.any?(& .ascii_letter?)
153
+ str.each_char do |char |
154
+ return true if char.ascii_letter?
155
+ break if char == '+'
156
+ end
157
+ false
154
158
end
155
159
156
160
protected def self.without_prereleases (versions )
Original file line number Diff line number Diff line change @@ -10,6 +10,10 @@ module Shards
10
10
assert Versions .prerelease?(" 1.0.alpha" )
11
11
assert Versions .prerelease?(" 1.0.0-rc1" )
12
12
assert Versions .prerelease?(" 1.0.0-pre.1.2.x.y" )
13
+
14
+ assert Versions .prerelease?(" 1.0.0-pre+20190129" )
15
+ refute Versions .prerelease?(" 1.0+20190129" )
16
+ refute Versions .prerelease?(" 1.0+build1" )
13
17
end
14
18
15
19
def test_compare
You can’t perform that action at this time.
0 commit comments