File tree 4 files changed +22
-14
lines changed 4 files changed +22
-14
lines changed Original file line number Diff line number Diff line change @@ -248,13 +248,15 @@ function auto_install_git()
248
248
}
249
249
250
250
#
251
- # Installs ruby 3 , if it's not installed.
251
+ # Installs ruby >= 3.1 , if it's not installed.
252
252
#
253
253
function auto_install_ruby()
254
254
{
255
- # check if ruby-3.x is already installed
256
- if [[ ! " $ruby_version " == " 3." * ]]; then
257
- log " Installing ruby 3.x ..."
255
+ # check if ruby >= 3.1 is already installed
256
+ if [[ -z " $ruby_version " ]] ||
257
+ [[ " $ruby_version " == " 2." * ]] ||
258
+ [[ " $ruby_version " == " 3.0." * ]]; then
259
+ log " Installing ruby >= 3.1 ..."
258
260
case " $package_manager " in
259
261
brew) homebrew_install_ruby ;;
260
262
dnf|yum) install_packages ruby-devel ruby-bundled-gems ;;
Original file line number Diff line number Diff line change @@ -200,13 +200,15 @@ function install_packages()
200
200
}
201
201
202
202
#
203
- # Installs ruby 3 , if it's not installed.
203
+ # Installs ruby >= 3.1 , if it's not installed.
204
204
#
205
205
function auto_install_ruby()
206
206
{
207
- # check if ruby-3.x is already installed
208
- if [[ ! " $ruby_version " == " 3." * ]]; then
209
- log " Installing ruby 3.x ..."
207
+ # check if ruby >= 3.1 is already installed
208
+ if [[ -z " $ruby_version " ]] ||
209
+ [[ " $ruby_version " == " 2." * ]] ||
210
+ [[ " $ruby_version " == " 3.0." * ]]; then
211
+ log " Installing ruby >= 3.1 ..."
210
212
case " $package_manager " in
211
213
brew) homebrew_install_ruby ;;
212
214
dnf|yum) install_packages ruby-devel ruby-bundled-gems ;;
Original file line number Diff line number Diff line change @@ -27,10 +27,12 @@ function test_awk_installed()
27
27
assertCommandInstalled " did not successfully install awk" ' awk'
28
28
}
29
29
30
- function test_ruby_3_x_installed ()
30
+ function test_at_least_ruby_3_1_installed ()
31
31
{
32
- # check if ruby-3.x is already installed
33
- if [[ " $test_ruby_version " == " 3." * ]]; then
32
+ # check if ruby >= 3.1.x is already installed
33
+ if [[ -n " $ruby_version " ]] &&
34
+ [[ " $ruby_version " != " 2." * ]] &&
35
+ [[ " $ruby_version " != " 3.0." * ]]; then
34
36
return
35
37
fi
36
38
Original file line number Diff line number Diff line change @@ -17,10 +17,12 @@ function test_make_installed()
17
17
assertCommandInstalled " did not successfully install make" ' make'
18
18
}
19
19
20
- function test_ruby_3_x_installed ()
20
+ function test_at_least_ruby_3_1_installed ()
21
21
{
22
- # check if ruby-3.x is already installed
23
- if [[ " $test_ruby_version " == " 3." * ]]; then
22
+ # check if ruby >= 3.1 is already installed
23
+ if [[ -n " $ruby_version " ]] &&
24
+ [[ " $ruby_version " != " 2." * ]] &&
25
+ [[ " $ruby_version " != " 3.0." * ]]; then
24
26
return
25
27
fi
26
28
You can’t perform that action at this time.
0 commit comments