Add a new input to optionally update RubyGems

This commit is contained in:
David Rodríguez
2022-01-23 11:55:32 +01:00
committed by Benoit Daloze
parent 180e1d1f1c
commit c3f0cb18af
5 changed files with 77 additions and 0 deletions
+7
View File
@@ -3,12 +3,14 @@ const fs = require('fs')
const path = require('path')
const core = require('@actions/core')
const common = require('./common')
const rubygems = require('./rubygems')
const bundler = require('./bundler')
const windows = common.windows
const inputDefaults = {
'ruby-version': 'default',
'rubygems': 'default',
'bundler': 'default',
'bundler-cache': 'true',
'working-directory': '.',
@@ -60,6 +62,11 @@ export async function setupRuby(options = {}) {
const rubyPrefix = await installer.install(platform, engine, version)
if (inputs['rubygems'] !== 'default') {
await common.measure('Updating RubyGems', async () =>
rubygems.rubygemsUpdate(inputs['rubygems'], rubyPrefix))
}
// When setup-ruby is used by other actions, this allows code in them to run
// before 'bundle install'. Installed dependencies may require additional
// libraries & headers, build tools, etc.