Skip to content

Commit 251b904

Browse files
MSP-Gregeregon
authored andcommitted
Fixup rubygems: latest to work with Rubies < 2.3
1 parent 961f851 commit 251b904

File tree

4 files changed

+8
-1
lines changed

4 files changed

+8
-1
lines changed

.github/workflows/test.yml

+1
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,7 @@ jobs:
181181
- { ruby: '2.6', expected_rubygems_version: '3.4.22' }
182182
- { ruby: '2.5', expected_rubygems_version: '3.3.27' }
183183
- { ruby: '2.3', expected_rubygems_version: '3.3.27' }
184+
- { ruby: '2.0', expected_rubygems_version: '2.7.11' }
184185
steps:
185186
- uses: actions/checkout@v4
186187
- uses: ./

action.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ inputs:
1313
The version of RubyGems to use. Either 'default' (the default), 'latest', or a version number (e.g., 3.3.5).
1414
For 'default', no action is taken and the version of RubyGems that comes with Ruby by default is used.
1515
For 'latest', `gem update --system` is run to update to the latest compatible RubyGems version.
16-
Ruby head/master builds and Ruby 2.2 and earlier will not be updated.
16+
Ruby head/master builds will not be updated.
1717
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.
1818
bundler:
1919
description: |

dist/index.js

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

rubygems.js

+3
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@ async function rubygemsLatest(gem, platform, engine, rubyVersion) {
4545
await exec.exec(gem, ['update', '--system', '3.4.22'])
4646
} else if (floatVersion >= 2.3) {
4747
await exec.exec(gem, ['update', '--system', '3.3.27'])
48+
} else if (floatVersion >= 1.9) {
49+
await exec.exec(`${gem} install rubygems-update -v 2.7.11 --no-document`)
50+
await exec.exec('update_rubygems')
4851
} else {
4952
console.log(`Cannot update RubyGems for Ruby version ${rubyVersion}`)
5053
}

0 commit comments

Comments
 (0)