Skip to content

Commit 2a4baaf

Browse files
rails-botgithub-actions[bot]Copilotrafaelfranca
authored
Add Ruby version: 4.0.4 (#126)
* Add Ruby versions: 4.0.4 [automated-ruby-update] * Record reproduction before Ruby doc fix Agent-Logs-Url: https://github.com/rails/devcontainer/sessions/1837d2fa-6c84-4e73-b77b-e98819020a0e Co-authored-by: rafaelfranca <47848+rafaelfranca@users.noreply.github.com> * Disable install docs during Ruby builds Agent-Logs-Url: https://github.com/rails/devcontainer/sessions/1837d2fa-6c84-4e73-b77b-e98819020a0e Co-authored-by: rafaelfranca <47848+rafaelfranca@users.noreply.github.com> * Limit Ruby doc workaround to 4.0.4 Agent-Logs-Url: https://github.com/rails/devcontainer/sessions/599a0756-c64a-4e66-9b09-97bf987809a4 Co-authored-by: rafaelfranca <47848+rafaelfranca@users.noreply.github.com> * Deduplicate Ruby doc workaround Agent-Logs-Url: https://github.com/rails/devcontainer/sessions/07591f78-fd4c-459b-a3dc-6bbed5e8fe5c Co-authored-by: rafaelfranca <47848+rafaelfranca@users.noreply.github.com> --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: rafaelfranca <47848+rafaelfranca@users.noreply.github.com> Co-authored-by: Rafael Mendonça França <rafael@rubyonrails.org>
1 parent 0ddf0ce commit 2a4baaf

7 files changed

Lines changed: 24 additions & 10 deletions

File tree

.github/ruby-versions.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
[
2+
"4.0.4",
23
"4.0.3",
34
"4.0.2",
45
"4.0.1",

features/src/ruby/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ When using `mise`, this feature keeps `ruby.compile=true` by default so Ruby is
5454

5555
| Options Id | Description | Type | Default Value |
5656
|-----|-----|-----|-----|
57-
| version | The version of ruby to be installed | string | 4.0.3 |
57+
| version | The version of ruby to be installed | string | 4.0.4 |
5858
| versionManager | The version manager to use for Ruby (mise or rbenv) | string | mise |
5959
| usePrecompiledRubies | Use precompiled Rubies with mise when available | boolean | false |
6060

features/src/ruby/devcontainer-feature.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"id": "ruby",
3-
"version": "2.2.1",
3+
"version": "2.2.2",
44
"name": "Ruby",
55
"description": "Installs Ruby and a version manager (mise or rbenv) along with libraries needed to build Ruby.",
66
"documentationURL": "https://github.com/rails/devcontainer/tree/main/features/src/ruby",
@@ -19,7 +19,7 @@
1919
"options": {
2020
"version": {
2121
"type": "string",
22-
"default": "4.0.3",
22+
"default": "4.0.4",
2323
"description": "The ruby version to be installed"
2424
},
2525
"versionManager": {

features/src/ruby/install.sh

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,13 +72,26 @@ setup_rbenv() {
7272
add_to_shell_init "$_user" 'eval "$(rbenv init -)"'
7373
}
7474

75+
run_ruby_install_command() {
76+
_user="$1"
77+
_version="$2"
78+
_command="$3"
79+
80+
_configure_opts=""
81+
if [ "$_version" = "4.0.4" ]; then
82+
_configure_opts="RUBY_CONFIGURE_OPTS='--disable-install-doc' "
83+
fi
84+
85+
su "$_user" -c "${_configure_opts}${_command}"
86+
}
87+
7588
# Function to install Ruby with rbenv
7689
install_ruby_rbenv() {
7790
_user="$1"
7891
_version="$2"
7992

80-
su "$_user" -c "/usr/local/share/rbenv/bin/rbenv install $_version"
81-
su "$_user" -c "/usr/local/share/rbenv/bin/rbenv global $_version"
93+
run_ruby_install_command "$_user" "$_version" "/usr/local/share/rbenv/bin/rbenv install \"$_version\""
94+
su "$_user" -c "/usr/local/share/rbenv/bin/rbenv global \"$_version\""
8295
}
8396

8497
# Function to setup mise
@@ -114,8 +127,8 @@ install_ruby_mise() {
114127
_home_dir="/home/$_user"
115128
fi
116129

117-
su "$_user" -c "$_home_dir/.local/bin/mise install ruby@$_version"
118-
su "$_user" -c "$_home_dir/.local/bin/mise use -g ruby@$_version"
130+
run_ruby_install_command "$_user" "$_version" "$_home_dir/.local/bin/mise install \"ruby@$_version\""
131+
su "$_user" -c "$_home_dir/.local/bin/mise use -g \"ruby@$_version\""
119132
su "$_user" -c "$_home_dir/.local/bin/mise settings add idiomatic_version_file_enable_tools ruby"
120133
}
121134

features/test/ruby/test.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@ check "mise init is sourced in the bashrc" bash -c "grep 'eval \"\$(~/.local/bin
99
check "mise is configured to compile Ruby from source by default" bash -c "mise settings | grep ruby.compile | grep true"
1010
check "mise idiomatic version file is enabled for ruby" bash -c "mise settings | grep idiomatic_version_file_enable_tools | grep ruby"
1111
check "Ruby is installed with YJIT" bash -c "RUBY_YJIT_ENABLE=1 ruby -v | grep +YJIT"
12-
check "Ruby version is set to 4.0.3" bash -c "mise use -g ruby | grep 4.0.3"
12+
check "Ruby version is set to 4.0.4" bash -c "mise use -g ruby | grep 4.0.4"
1313

1414
reportResults

features/test/ruby/with_precompiled_rubies.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@ check "mise is installed" bash -c "mise --version"
88
check "mise uses precompiled Rubies when enabled" bash -c "mise settings | grep ruby.compile | grep false"
99
check "mise idiomatic version file is enabled for ruby" bash -c "mise settings | grep idiomatic_version_file_enable_tools | grep ruby"
1010
check "Ruby is installed with YJIT" bash -c "RUBY_YJIT_ENABLE=1 ruby -v | grep +YJIT"
11-
check "Ruby version is set to 4.0.3" bash -c "mise use -g ruby | grep 4.0.3"
11+
check "Ruby version is set to 4.0.4" bash -c "mise use -g ruby | grep 4.0.4"
1212

1313
reportResults

features/test/ruby/with_rbenv.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@ check "rbenv is installed" bash -c "rbenv --version"
99
check "ruby-build is installed" bash -c "ls -l $HOME/.rbenv/plugins/ruby-build | grep '\-> /usr/local/share/ruby-build'"
1010
eval "$(rbenv init -)"
1111
check "Ruby is installed with YJIT" bash -c "RUBY_YJIT_ENABLE=1 ruby -v | grep +YJIT"
12-
check "Ruby version is set to 4.0.3" bash -c "rbenv global | grep 4.0.3"
12+
check "Ruby version is set to 4.0.4" bash -c "rbenv global | grep 4.0.4"
1313

1414
reportResults

0 commit comments

Comments
 (0)