Skip to content

Commit f6f61ea

Browse files
committed
Fix checks for Bundler version to consider an exact version like 2.1.4
1 parent 084885e commit f6f61ea

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

dist/index.js

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

index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ async function installBundler(bundlerVersionInput, lockFile, platform, rubyPrefi
211211
throw new Error(`Cannot parse bundler input: ${bundlerVersion}`)
212212
}
213213

214-
if (engine === 'ruby' && rubyVersion.match(/^2\.[12]/)) {
214+
if (engine === 'ruby' && rubyVersion.match(/^2\.[012]/)) {
215215
console.log('Bundler 2 requires Ruby 2.3+, using Bundler 1 on Ruby <= 2.2')
216216
bundlerVersion = '1'
217217
} else if (engine === 'ruby' && rubyVersion.startsWith('2.3')) {
@@ -222,9 +222,9 @@ async function installBundler(bundlerVersionInput, lockFile, platform, rubyPrefi
222222
bundlerVersion = '1'
223223
}
224224

225-
if (common.isHeadVersion(rubyVersion) && common.isBundler2Default(engine, rubyVersion) && bundlerVersion === '2') {
225+
if (common.isHeadVersion(rubyVersion) && common.isBundler2Default(engine, rubyVersion) && bundlerVersion.startsWith('2')) {
226226
console.log(`Using Bundler 2 shipped with ${engine}-${rubyVersion}`)
227-
} else if (engine === 'truffleruby' && !common.isHeadVersion(rubyVersion) && bundlerVersion === '1') {
227+
} else if (engine === 'truffleruby' && !common.isHeadVersion(rubyVersion) && bundlerVersion.startsWith('1')) {
228228
console.log(`Using Bundler 1 shipped with ${engine}`)
229229
} else {
230230
const gem = path.join(rubyPrefix, 'bin', 'gem')

0 commit comments

Comments
 (0)