Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion src/plugins/core/ruby_windows.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ use crate::toolset::{ToolVersion, Toolset};
use crate::ui::progress_report::SingleReport;
use crate::{file, github, plugins};
use async_trait::async_trait;
use eyre::Result;
use eyre::{Result, bail};
use itertools::Itertools;
use versions::Versioning;
use xx::regex;
Expand Down Expand Up @@ -205,6 +205,13 @@ impl Backend for RubyPlugin {
ctx: &InstallContext,
mut tv: ToolVersion,
) -> eyre::Result<ToolVersion> {
if !super::ruby_common::is_mri_version(&tv.version) {
bail!(
"Ruby engine '{}' is not supported on Windows.\n\
Only standard MRI Ruby versions can be installed via RubyInstaller2.",
Comment on lines +210 to +211

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The indentation on the second line of this multi-line string literal will be included in the error message, which is likely not intended. This will cause the second line of the error message to be indented with several spaces. It's better to put the string on a single line or remove the indentation on the continued line to fix the output format.

                "Ruby engine '{}' is not supported on Windows.\nOnly standard MRI Ruby versions can be installed via RubyInstaller2.",

tv.version
);
}
Comment on lines +208 to +214

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No unit test for the new rejection behavior

There is no test that verifies a non-MRI version string (e.g. jruby-9.4.0.0, truffleruby-23) produces the expected bail error. Consider adding a small unit test for install_version_ that mocks a non-MRI ToolVersion and asserts the error message contains "is not supported on Windows". This would guard against regressions to the early-exit path and make the intent explicit.

Fix in Claude Code

let tarball = self.download(&tv, ctx.pr.as_ref()).await?;
self.verify_checksum(ctx, &mut tv, &tarball)?;
self.install(ctx, &tv, &tarball).await?;
Expand Down
Loading