@@ -3,7 +3,7 @@ const path = require('path')
33const exec = require ( '@actions/exec' )
44const semver = require ( 'semver' )
55
6- export async function rubygemsUpdate ( rubygemsVersionInput , rubyPrefix , platform , engine , version ) {
6+ export async function rubygemsUpdate ( rubygemsVersionInput , rubyPrefix , platform , engine , rubyVersion ) {
77 const gem = path . join ( rubyPrefix , 'bin' , 'gem' )
88
99 let gemVersion = ''
@@ -19,7 +19,7 @@ export async function rubygemsUpdate(rubygemsVersionInput, rubyPrefix, platform,
1919
2020 if ( rubygemsVersionInput === 'latest' ) {
2121 console . log ( 'Updating RubyGems to latest version' )
22- await rubygemsLatest ( gem , platform , engine , version )
22+ await rubygemsLatest ( gem , platform , engine , rubyVersion )
2323 } else if ( semver . gt ( rubygemsVersionInput , gemVersion ) ) {
2424 console . log ( `Updating RubyGems to ${ rubygemsVersionInput } ` )
2525 await exec . exec ( gem , [ 'update' , '--system' , rubygemsVersionInput ] )
@@ -34,19 +34,19 @@ export async function rubygemsUpdate(rubygemsVersionInput, rubyPrefix, platform,
3434// running 'gem update --system', so we have to force a compatible version of
3535// rubygems-update. See https://github.com/ruby/setup-ruby/pull/551 and
3636// https://github.com/rubygems/rubygems/issues/7329
37- async function rubygemsLatest ( gem , platform , engine , version ) {
37+ async function rubygemsLatest ( gem , platform , engine , rubyVersion ) {
3838 if ( engine === 'ruby' ) {
39- const rubyFloatVersion = common . floatVersion ( version )
40- if ( common . isHeadVersion ( version ) ) {
39+ const floatVersion = common . floatVersion ( rubyVersion )
40+ if ( common . isHeadVersion ( rubyVersion ) ) {
4141 console . log ( 'Ruby master builds use included RubyGems' )
42- } else if ( rubyFloatVersion >= 3.0 ) {
42+ } else if ( floatVersion >= 3.0 ) {
4343 await exec . exec ( gem , [ 'update' , '--system' ] )
44- } else if ( rubyFloatVersion >= 2.6 ) {
44+ } else if ( floatVersion >= 2.6 ) {
4545 await exec . exec ( gem , [ 'update' , '--system' , '3.4.22' ] )
46- } else if ( rubyFloatVersion >= 2.3 ) {
46+ } else if ( floatVersion >= 2.3 ) {
4747 await exec . exec ( gem , [ 'update' , '--system' , '3.3.27' ] )
4848 } else {
49- console . log ( `Cannot update RubyGems for Ruby version ${ version } ` )
49+ console . log ( `Cannot update RubyGems for Ruby version ${ rubyVersion } ` )
5050 }
5151 } else {
5252 // non MRI Rubies (TruffleRuby and JRuby)
0 commit comments