Skip to content

Commit 23b9735

Browse files
committed
Fix checks for head versions
* Always use common.isHeadVersion().
1 parent 002b15e commit 23b9735

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

.github/workflows/test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@ jobs:
1515
matrix:
1616
os: [ ubuntu, macos, windows ]
1717
# Use various version syntax here for testing
18-
ruby: [ 2.2, 2.3, 2.4, 2.5, 2.6.6, 2.7, ruby-head, ruby-debug, jruby-9.1, jruby, jruby-head, truffleruby, truffleruby-head ]
18+
ruby: [ 2.2, 2.3, 2.4, 2.5, 2.6.6, 2.7, ruby-head, debug, jruby-9.1, jruby, jruby-head, truffleruby, truffleruby-head ]
1919
include:
2020
- { os: ubuntu, ruby: rubinius }
2121
- { os: windows, ruby: mingw }
2222
- { os: windows, ruby: mswin }
2323
exclude:
24-
- { os: windows, ruby: ruby-debug }
24+
- { os: windows, ruby: debug }
2525
- { os: windows, ruby: truffleruby }
2626
- { os: windows, ruby: truffleruby-head }
2727

dist/index.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ function parseRubyEngineAndVersion(rubyVersion) {
6565
}
6666

6767
let engine, version
68-
if (rubyVersion.match(/^(\d+|head|mingw|mswin)/)) { // X.Y.Z => ruby-X.Y.Z
68+
if (rubyVersion.match(/^(\d+)/) || common.isHeadVersion(rubyVersion)) { // X.Y.Z => ruby-X.Y.Z
6969
engine = 'ruby'
7070
version = rubyVersion
7171
} else if (!rubyVersion.includes('-')) { // myruby -> myruby-stableVersion
@@ -86,7 +86,7 @@ function validateRubyEngineAndVersion(platform, engineVersions, engine, parsedVe
8686
let version = parsedVersion
8787
if (!engineVersions.includes(parsedVersion)) {
8888
const latestToFirstVersion = engineVersions.slice().reverse()
89-
const found = latestToFirstVersion.find(v => v !== 'head' && v.startsWith(parsedVersion))
89+
const found = latestToFirstVersion.find(v => !common.isHeadVersion(v) && v.startsWith(parsedVersion))
9090
if (found) {
9191
version = found
9292
} else {

0 commit comments

Comments
 (0)