From 976f0d5725928f418d0ca992ec3516004a7b2465 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20Mendon=C3=A7a=20Fran=C3=A7a?= Date: Mon, 2 Feb 2026 16:42:58 +0000 Subject: [PATCH 1/2] Add Ruby 3.2.10 --- .github/ruby-versions.json | 63 +++++++++++++++++++------------------- 1 file changed, 32 insertions(+), 31 deletions(-) diff --git a/.github/ruby-versions.json b/.github/ruby-versions.json index f9a4c32..77569ab 100644 --- a/.github/ruby-versions.json +++ b/.github/ruby-versions.json @@ -1,33 +1,34 @@ [ - "4.0.0", - "3.4.8", - "3.4.7", - "3.4.6", - "3.4.5", - "3.4.4", - "3.4.3", - "3.4.2", - "3.4.1", - "3.4.0", - "3.3.10", - "3.3.9", - "3.3.8", - "3.3.7", - "3.3.6", - "3.3.5", - "3.3.4", - "3.3.3", - "3.3.2", - "3.3.1", - "3.3.0", - "3.2.9", - "3.2.8", - "3.2.7", - "3.2.6", - "3.2.5", - "3.2.4", - "3.2.3", - "3.2.2", - "3.2.1", - "3.2.0" + "4.0.0", + "3.4.8", + "3.4.7", + "3.4.6", + "3.4.5", + "3.4.4", + "3.4.3", + "3.4.2", + "3.4.1", + "3.4.0", + "3.3.10", + "3.3.9", + "3.3.8", + "3.3.7", + "3.3.6", + "3.3.5", + "3.3.4", + "3.3.3", + "3.3.2", + "3.3.1", + "3.3.0", + "3.2.10", + "3.2.9", + "3.2.8", + "3.2.7", + "3.2.6", + "3.2.5", + "3.2.4", + "3.2.3", + "3.2.2", + "3.2.1", + "3.2.0" ] From 0b686cc93ab2767a52d567c7ad5e81469117e058 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20Mendon=C3=A7a=20Fran=C3=A7a?= Date: Mon, 2 Feb 2026 16:48:37 +0000 Subject: [PATCH 2/2] Add Ruby 4.0.1 --- .github/ruby-versions.json | 65 +++++++++++---------- features/src/ruby/README.md | 2 +- features/src/ruby/devcontainer-feature.json | 4 +- features/test/ruby/test.sh | 2 +- features/test/ruby/with_rbenv.sh | 2 +- lib/add_ruby_version.rb | 3 +- test/add_ruby_version_test.rb | 6 ++ 7 files changed, 46 insertions(+), 38 deletions(-) diff --git a/.github/ruby-versions.json b/.github/ruby-versions.json index 77569ab..1da5c1d 100644 --- a/.github/ruby-versions.json +++ b/.github/ruby-versions.json @@ -1,34 +1,35 @@ [ - "4.0.0", - "3.4.8", - "3.4.7", - "3.4.6", - "3.4.5", - "3.4.4", - "3.4.3", - "3.4.2", - "3.4.1", - "3.4.0", - "3.3.10", - "3.3.9", - "3.3.8", - "3.3.7", - "3.3.6", - "3.3.5", - "3.3.4", - "3.3.3", - "3.3.2", - "3.3.1", - "3.3.0", - "3.2.10", - "3.2.9", - "3.2.8", - "3.2.7", - "3.2.6", - "3.2.5", - "3.2.4", - "3.2.3", - "3.2.2", - "3.2.1", - "3.2.0" + "4.0.1", + "4.0.0", + "3.4.8", + "3.4.7", + "3.4.6", + "3.4.5", + "3.4.4", + "3.4.3", + "3.4.2", + "3.4.1", + "3.4.0", + "3.3.10", + "3.3.9", + "3.3.8", + "3.3.7", + "3.3.6", + "3.3.5", + "3.3.4", + "3.3.3", + "3.3.2", + "3.3.1", + "3.3.0", + "3.2.10", + "3.2.9", + "3.2.8", + "3.2.7", + "3.2.6", + "3.2.5", + "3.2.4", + "3.2.3", + "3.2.2", + "3.2.1", + "3.2.0" ] diff --git a/features/src/ruby/README.md b/features/src/ruby/README.md index bdbce03..ddc5ae1 100644 --- a/features/src/ruby/README.md +++ b/features/src/ruby/README.md @@ -40,7 +40,7 @@ Installs Ruby and a version manager (mise or rbenv) along with the dependencies | Options Id | Description | Type | Default Value | |-----|-----|-----|-----| -| version | The version of ruby to be installed | string | 4.0.0 | +| version | The version of ruby to be installed | string | 4.0.1 | | versionManager | The version manager to use for Ruby (mise or rbenv) | string | mise | ## Customizations diff --git a/features/src/ruby/devcontainer-feature.json b/features/src/ruby/devcontainer-feature.json index dd4c11c..95c33e2 100644 --- a/features/src/ruby/devcontainer-feature.json +++ b/features/src/ruby/devcontainer-feature.json @@ -1,6 +1,6 @@ { "id": "ruby", - "version": "2.1.2", + "version": "2.1.3", "name": "Ruby", "description": "Installs Ruby and a version manager (mise or rbenv) along with libraries needed to build Ruby.", "documentationURL": "https://github.com/rails/devcontainer/tree/main/features/src/ruby", @@ -19,7 +19,7 @@ "options": { "version": { "type": "string", - "default": "4.0.0", + "default": "4.0.1", "description": "The ruby version to be installed" }, "versionManager": { diff --git a/features/test/ruby/test.sh b/features/test/ruby/test.sh index 542960f..ff6d126 100644 --- a/features/test/ruby/test.sh +++ b/features/test/ruby/test.sh @@ -8,6 +8,6 @@ check "mise is installed" bash -c "mise --version" check "mise init is sourced in the bashrc" bash -c "grep 'eval \"\$(~/.local/bin/mise activate bash)\"' $HOME/.bashrc" check "mise idiomatic version file is enabled for ruby" bash -c "mise settings | grep idiomatic_version_file_enable_tools | grep ruby" check "Ruby is installed with YJIT" bash -c "RUBY_YJIT_ENABLE=1 ruby -v | grep +YJIT" -check "Ruby version is set to 4.0.0" bash -c "mise use -g ruby | grep 4.0.0" +check "Ruby version is set to 4.0.1" bash -c "mise use -g ruby | grep 4.0.1" reportResults diff --git a/features/test/ruby/with_rbenv.sh b/features/test/ruby/with_rbenv.sh index fb2f0a7..22af2c7 100644 --- a/features/test/ruby/with_rbenv.sh +++ b/features/test/ruby/with_rbenv.sh @@ -9,6 +9,6 @@ check "rbenv is installed" bash -c "rbenv --version" check "ruby-build is installed" bash -c "ls -l $HOME/.rbenv/plugins/ruby-build | grep '\-> /usr/local/share/ruby-build'" eval "$(rbenv init -)" check "Ruby is installed with YJIT" bash -c "RUBY_YJIT_ENABLE=1 ruby -v | grep +YJIT" -check "Ruby version is set to 4.0.0" bash -c "rbenv global | grep 4.0.0" +check "Ruby version is set to 4.0.1" bash -c "rbenv global | grep 4.0.1" reportResults diff --git a/lib/add_ruby_version.rb b/lib/add_ruby_version.rb index 65bf48f..578dc72 100644 --- a/lib/add_ruby_version.rb +++ b/lib/add_ruby_version.rb @@ -180,7 +180,8 @@ def read_json(relative_path) end def write_json(relative_path, data) - File.write(path_for(relative_path), JSON.pretty_generate(data) + "\n") + json = JSON.pretty_generate(data, indent: " ") + File.write(path_for(relative_path), json + "\n") end def current_default_version diff --git a/test/add_ruby_version_test.rb b/test/add_ruby_version_test.rb index 3571d5b..4781b7e 100644 --- a/test/add_ruby_version_test.rb +++ b/test/add_ruby_version_test.rb @@ -91,6 +91,9 @@ def test_adds_version_to_json_file assert_includes versions, "3.4.0", "New version should be added to JSON" assert_includes versions, "3.3.0", "Existing versions should be preserved" assert_includes versions, "3.2.0", "Existing versions should be preserved" + + content = File.read(File.join(@temp_dir, ".github/ruby-versions.json")) + assert_match(/^ "3\.4\.0"/, content, "Should use 4-space indentation") end def test_sorts_versions_descending @@ -173,6 +176,9 @@ def test_bumps_feature_version_when_default_changes feature = read_feature_json assert_equal "2.0.1", feature["version"], "Feature version should be bumped when default changes" + + content = File.read(File.join(@temp_dir, "features/src/ruby/devcontainer-feature.json")) + assert_match(/^ "id"/, content, "Should use 4-space indentation") end def test_does_not_bump_feature_version_when_default_unchanged