Skip to content

Commit 0997e21

Browse files
committed
Fix check for TruffleRuby < 21.0 and Bundler 1
1 parent 0c7e9c4 commit 0997e21

File tree

3 files changed

+13
-4
lines changed

3 files changed

+13
-4
lines changed

bundler.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,8 @@ export async function installBundler(bundlerVersionInput, lockFile, platform, ru
8686
// Avoid installing a newer Bundler version for head versions as it might not work.
8787
// For releases, even if they ship with Bundler 2 we install the latest Bundler.
8888
console.log(`Using Bundler 2 shipped with ${engine}-${rubyVersion}`)
89-
} else if (engine === 'truffleruby' && !common.isHeadVersion(rubyVersion) && bundlerVersion.startsWith('1')) {
90-
console.log(`Using Bundler 1 shipped with ${engine}`)
89+
} else if (engine === 'truffleruby' && common.isBundler1Default(engine, rubyVersion) && bundlerVersion.startsWith('1')) {
90+
console.log(`Using Bundler 1 shipped with ${engine}-${rubyVersion}`)
9191
} else {
9292
const gem = path.join(rubyPrefix, 'bin', 'gem')
9393
const bundlerVersionConstraint = bundlerVersion.match(/^\d+\.\d+\.\d+/) ? bundlerVersion : `~> ${bundlerVersion}`

common.js

+4
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,10 @@ export function isStableVersion(rubyVersion) {
5555
return /^\d+(\.\d+)*$/.test(rubyVersion)
5656
}
5757

58+
export function isBundler1Default(engine, rubyVersion) {
59+
return !isBundler2Default(engine, rubyVersion)
60+
}
61+
5862
export function isBundler2Default(engine, rubyVersion) {
5963
if (engine === 'ruby') {
6064
return isHeadVersion(rubyVersion) || floatVersion(rubyVersion) >= 2.7

dist/index.js

+7-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)