mirror of
https://github.com/ruby/setup-ruby.git
synced 2026-09-13 06:34:19 +02:00
Rename workflow and variable for clarity
This commit is contained in:
@@ -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
|
||||
|
||||
+9
-9
@@ -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)
|
||||
|
||||
+9
-9
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user