Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mruby
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
mruby
Commits
73bb144e
Commit
73bb144e
authored
Apr 19, 2019
by
Rob
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes the twiddle wakka comparison algorithm to support passing only a major number
parent
05f65d2d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
+6
-4
lib/mruby/gem.rb
lib/mruby/gem.rb
+6
-4
No files found.
lib/mruby/gem.rb
View file @
73bb144e
...
...
@@ -267,16 +267,18 @@ module MRuby
# ~> compare algorithm
#
# Example:
# ~> 2 means >= 2.0.0 and < 3.0.0
# ~> 2.2 means >= 2.2.0 and < 3.0.0
# ~> 2.2.
0 means >= 2.2.0
and < 2.3.0
# ~> 2.2.
2 means >= 2.2.2
and < 2.3.0
def
twiddle_wakka_ok?
(
other
)
gr_or_eql
=
(
self
<=>
other
)
>=
0
still_m
inor
=
(
self
<=>
other
.
skip
_minor
)
<
0
gr_or_eql
and
still_minor
still_m
ajor_or_minor
=
(
self
<=>
other
.
skip_major_or
_minor
)
<
0
gr_or_eql
and
still_m
ajor_or_m
inor
end
def
skip_minor
def
skip_m
ajor_or_m
inor
a
=
@ary
.
dup
a
<<
0
if
a
.
size
==
1
# ~> 2 can also be represented as ~> 2.0
a
.
slice!
(
-
1
)
a
[
-
1
]
=
a
[
-
1
].
succ
a
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment