Skip to content

Commit

Permalink
Fix checks for head versions
Browse files Browse the repository at this point in the history
* Always use common.isHeadVersion().
  • Loading branch information
eregon committed May 15, 2020
1 parent 002b15e commit 23b9735
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ jobs:
matrix:
os: [ ubuntu, macos, windows ]
# Use various version syntax here for testing
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 ]
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 ]
include:
- { os: ubuntu, ruby: rubinius }
- { os: windows, ruby: mingw }
- { os: windows, ruby: mswin }
exclude:
- { os: windows, ruby: ruby-debug }
- { os: windows, ruby: debug }
- { os: windows, ruby: truffleruby }
- { os: windows, ruby: truffleruby-head }

Expand Down
4 changes: 2 additions & 2 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ function parseRubyEngineAndVersion(rubyVersion) {
}

let engine, version
if (rubyVersion.match(/^(\d+|head|mingw|mswin)/)) { // X.Y.Z => ruby-X.Y.Z
if (rubyVersion.match(/^(\d+)/) || common.isHeadVersion(rubyVersion)) { // X.Y.Z => ruby-X.Y.Z
engine = 'ruby'
version = rubyVersion
} else if (!rubyVersion.includes('-')) { // myruby -> myruby-stableVersion
Expand All @@ -86,7 +86,7 @@ function validateRubyEngineAndVersion(platform, engineVersions, engine, parsedVe
let version = parsedVersion
if (!engineVersions.includes(parsedVersion)) {
const latestToFirstVersion = engineVersions.slice().reverse()
const found = latestToFirstVersion.find(v => v !== 'head' && v.startsWith(parsedVersion))
const found = latestToFirstVersion.find(v => !common.isHeadVersion(v) && v.startsWith(parsedVersion))
if (found) {
version = found
} else {
Expand Down

0 comments on commit 23b9735

Please sign in to comment.