Fixup rubygems: latest to work with Rubies < 2.3

This commit is contained in:
MSP-Greg
2023-12-28 13:20:54 +02:00
committed by Benoit Daloze
parent 961f85197f
commit 251b9047a8
4 changed files with 8 additions and 1 deletions
+1
View File
@@ -181,6 +181,7 @@ jobs:
- { ruby: '2.6', expected_rubygems_version: '3.4.22' } - { ruby: '2.6', expected_rubygems_version: '3.4.22' }
- { ruby: '2.5', expected_rubygems_version: '3.3.27' } - { ruby: '2.5', expected_rubygems_version: '3.3.27' }
- { ruby: '2.3', expected_rubygems_version: '3.3.27' } - { ruby: '2.3', expected_rubygems_version: '3.3.27' }
- { ruby: '2.0', expected_rubygems_version: '2.7.11' }
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- uses: ./ - uses: ./
+1 -1
View File
@@ -13,7 +13,7 @@ inputs:
The version of RubyGems to use. Either 'default' (the default), 'latest', or a version number (e.g., 3.3.5). The version of RubyGems to use. Either 'default' (the default), 'latest', or a version number (e.g., 3.3.5).
For 'default', no action is taken and the version of RubyGems that comes with Ruby by default is used. For 'default', no action is taken and the version of RubyGems that comes with Ruby by default is used.
For 'latest', `gem update --system` is run to update to the latest compatible RubyGems version. For 'latest', `gem update --system` is run to update to the latest compatible RubyGems version.
Ruby head/master builds and Ruby 2.2 and earlier will not be updated. Ruby head/master builds will not be updated.
Similarly, if a version number is given, `gem update --system <version>` is run to update to that version of RubyGems, as long as that version is newer than the one provided by default. Similarly, if a version number is given, `gem update --system <version>` is run to update to that version of RubyGems, as long as that version is newer than the one provided by default.
bundler: bundler:
description: | description: |
Generated Vendored
+3
View File
@@ -65133,6 +65133,9 @@ async function rubygemsLatest(gem, platform, engine, rubyVersion) {
await exec.exec(gem, ['update', '--system', '3.4.22']) await exec.exec(gem, ['update', '--system', '3.4.22'])
} else if (floatVersion >= 2.3) { } else if (floatVersion >= 2.3) {
await exec.exec(gem, ['update', '--system', '3.3.27']) await exec.exec(gem, ['update', '--system', '3.3.27'])
} else if (floatVersion >= 1.9) {
await exec.exec(`${gem} install rubygems-update -v 2.7.11 --no-document`)
await exec.exec('update_rubygems')
} else { } else {
console.log(`Cannot update RubyGems for Ruby version ${rubyVersion}`) console.log(`Cannot update RubyGems for Ruby version ${rubyVersion}`)
} }
+3
View File
@@ -45,6 +45,9 @@ async function rubygemsLatest(gem, platform, engine, rubyVersion) {
await exec.exec(gem, ['update', '--system', '3.4.22']) await exec.exec(gem, ['update', '--system', '3.4.22'])
} else if (floatVersion >= 2.3) { } else if (floatVersion >= 2.3) {
await exec.exec(gem, ['update', '--system', '3.3.27']) await exec.exec(gem, ['update', '--system', '3.3.27'])
} else if (floatVersion >= 1.9) {
await exec.exec(`${gem} install rubygems-update -v 2.7.11 --no-document`)
await exec.exec('update_rubygems')
} else { } else {
console.log(`Cannot update RubyGems for Ruby version ${rubyVersion}`) console.log(`Cannot update RubyGems for Ruby version ${rubyVersion}`)
} }