mirror of
https://github.com/ruby/setup-ruby.git
synced 2026-09-13 22:44:20 +02:00
Add a new input to optionally update RubyGems
This commit is contained in:
committed by
Benoit Daloze
parent
180e1d1f1c
commit
c3f0cb18af
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user