Skip to content

Commit

Permalink
Fixup rubygems: latest to work with Rubies < 2.3
Browse files Browse the repository at this point in the history
  • Loading branch information
MSP-Greg authored and eregon committed Dec 28, 2023
1 parent 961f851 commit 251b904
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ jobs:
- { ruby: '2.6', expected_rubygems_version: '3.4.22' }
- { ruby: '2.5', 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:
- uses: actions/checkout@v4
- uses: ./
Expand Down
2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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).
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.
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.
bundler:
description: |
Expand Down
3 changes: 3 additions & 0 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions rubygems.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ async function rubygemsLatest(gem, platform, engine, rubyVersion) {
await exec.exec(gem, ['update', '--system', '3.4.22'])
} else if (floatVersion >= 2.3) {
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 {
console.log(`Cannot update RubyGems for Ruby version ${rubyVersion}`)
}
Expand Down

0 comments on commit 251b904

Please sign in to comment.