From 961f85197f92e4842e3cb92a4f97bd8e010cdbaf Mon Sep 17 00:00:00 2001 From: Benoit Daloze Date: Wed, 27 Dec 2023 20:24:51 +0100 Subject: [PATCH] Rename workflow and variable for clarity --- .github/workflows/test.yml | 2 +- dist/index.js | 18 +++++++++--------- rubygems.js | 18 +++++++++--------- 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 69ce76889..824965526 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -169,7 +169,7 @@ jobs: - run: ruby -v testLatestRubygemsVersion: - name: "Ruby ${{ matrix.ruby }}: latest upgrades RubyGems" + name: "Test rubygems: latest on Ruby ${{ matrix.ruby }}" runs-on: ubuntu-latest strategy: fail-fast: false diff --git a/dist/index.js b/dist/index.js index 8d7387324..337f1d069 100644 --- a/dist/index.js +++ b/dist/index.js @@ -65091,7 +65091,7 @@ const path = __nccwpck_require__(1017) const exec = __nccwpck_require__(1514) const semver = __nccwpck_require__(1383) -async function rubygemsUpdate(rubygemsVersionInput, rubyPrefix, platform, engine, version) { +async function rubygemsUpdate(rubygemsVersionInput, rubyPrefix, platform, engine, rubyVersion) { const gem = path.join(rubyPrefix, 'bin', 'gem') let gemVersion = '' @@ -65107,7 +65107,7 @@ async function rubygemsUpdate(rubygemsVersionInput, rubyPrefix, platform, engine if (rubygemsVersionInput === 'latest') { console.log('Updating RubyGems to latest version') - await rubygemsLatest(gem, platform, engine, version) + await rubygemsLatest(gem, platform, engine, rubyVersion) } else if (semver.gt(rubygemsVersionInput, gemVersion)) { console.log(`Updating RubyGems to ${rubygemsVersionInput}`) await exec.exec(gem, ['update', '--system', rubygemsVersionInput]) @@ -65122,19 +65122,19 @@ async function rubygemsUpdate(rubygemsVersionInput, rubyPrefix, platform, engine // running 'gem update --system', so we have to force a compatible version of // rubygems-update. See https://github.com/ruby/setup-ruby/pull/551 and // https://github.com/rubygems/rubygems/issues/7329 -async function rubygemsLatest(gem, platform, engine, version) { +async function rubygemsLatest(gem, platform, engine, rubyVersion) { if (engine === 'ruby') { - const rubyFloatVersion = common.floatVersion(version) - if (common.isHeadVersion(version)) { + const floatVersion = common.floatVersion(rubyVersion) + if (common.isHeadVersion(rubyVersion)) { console.log('Ruby master builds use included RubyGems') - } else if (rubyFloatVersion >= 3.0) { + } else if (floatVersion >= 3.0) { await exec.exec(gem, ['update', '--system']) - } else if (rubyFloatVersion >= 2.6) { + } else if (floatVersion >= 2.6) { await exec.exec(gem, ['update', '--system', '3.4.22']) - } else if (rubyFloatVersion >= 2.3) { + } else if (floatVersion >= 2.3) { await exec.exec(gem, ['update', '--system', '3.3.27']) } else { - console.log(`Cannot update RubyGems for Ruby version ${version}`) + console.log(`Cannot update RubyGems for Ruby version ${rubyVersion}`) } } else { // non MRI Rubies (TruffleRuby and JRuby) diff --git a/rubygems.js b/rubygems.js index 6d41e248a..16094d50e 100644 --- a/rubygems.js +++ b/rubygems.js @@ -3,7 +3,7 @@ const path = require('path') const exec = require('@actions/exec') const semver = require('semver') -export async function rubygemsUpdate(rubygemsVersionInput, rubyPrefix, platform, engine, version) { +export async function rubygemsUpdate(rubygemsVersionInput, rubyPrefix, platform, engine, rubyVersion) { const gem = path.join(rubyPrefix, 'bin', 'gem') let gemVersion = '' @@ -19,7 +19,7 @@ export async function rubygemsUpdate(rubygemsVersionInput, rubyPrefix, platform, if (rubygemsVersionInput === 'latest') { console.log('Updating RubyGems to latest version') - await rubygemsLatest(gem, platform, engine, version) + await rubygemsLatest(gem, platform, engine, rubyVersion) } else if (semver.gt(rubygemsVersionInput, gemVersion)) { console.log(`Updating RubyGems to ${rubygemsVersionInput}`) await exec.exec(gem, ['update', '--system', rubygemsVersionInput]) @@ -34,19 +34,19 @@ export async function rubygemsUpdate(rubygemsVersionInput, rubyPrefix, platform, // running 'gem update --system', so we have to force a compatible version of // rubygems-update. See https://github.com/ruby/setup-ruby/pull/551 and // https://github.com/rubygems/rubygems/issues/7329 -async function rubygemsLatest(gem, platform, engine, version) { +async function rubygemsLatest(gem, platform, engine, rubyVersion) { if (engine === 'ruby') { - const rubyFloatVersion = common.floatVersion(version) - if (common.isHeadVersion(version)) { + const floatVersion = common.floatVersion(rubyVersion) + if (common.isHeadVersion(rubyVersion)) { console.log('Ruby master builds use included RubyGems') - } else if (rubyFloatVersion >= 3.0) { + } else if (floatVersion >= 3.0) { await exec.exec(gem, ['update', '--system']) - } else if (rubyFloatVersion >= 2.6) { + } else if (floatVersion >= 2.6) { await exec.exec(gem, ['update', '--system', '3.4.22']) - } else if (rubyFloatVersion >= 2.3) { + } else if (floatVersion >= 2.3) { await exec.exec(gem, ['update', '--system', '3.3.27']) } else { - console.log(`Cannot update RubyGems for Ruby version ${version}`) + console.log(`Cannot update RubyGems for Ruby version ${rubyVersion}`) } } else { // non MRI Rubies (TruffleRuby and JRuby)