From de703d8baa436d3a2adc79a22d63837e40055501 Mon Sep 17 00:00:00 2001 From: jdx <216188+jdx@users.noreply.github.com> Date: Thu, 16 Jan 2025 19:03:54 -0600 Subject: [PATCH] fix(ruby): remove ruby/gem tests (#4130) These do not play nice with some security software and they have always seemed to cause more trouble than they're worth --- src/plugins/core/ruby.rs | 39 --------------------------------------- 1 file changed, 39 deletions(-) diff --git a/src/plugins/core/ruby.rs b/src/plugins/core/ruby.rs index a7672452bd..5764b673d9 100644 --- a/src/plugins/core/ruby.rs +++ b/src/plugins/core/ruby.rs @@ -158,10 +158,6 @@ impl RubyPlugin { Ok(updated_at < DAILY) } - fn ruby_path(&self, tv: &ToolVersion) -> PathBuf { - tv.install_path().join("bin/ruby") - } - fn gem_path(&self, tv: &ToolVersion) -> PathBuf { tv.install_path().join("bin/gem") } @@ -197,39 +193,6 @@ impl RubyPlugin { Ok(()) } - fn test_ruby( - &self, - config: &Config, - tv: &ToolVersion, - pr: &Box, - ) -> Result<()> { - pr.set_message("ruby -v".into()); - CmdLineRunner::new(self.ruby_path(tv)) - .with_pr(pr) - .arg("-v") - .envs(config.env()?) - .execute() - } - - fn test_gem( - &self, - config: &Config, - tv: &ToolVersion, - pr: &Box, - ) -> Result<()> { - if !regex!(r#"^\d"#).is_match(&self.tool_name()) { - // don't expect gem for artichoke - return Ok(()); - } - pr.set_message("gem -v".into()); - CmdLineRunner::new(self.gem_path(tv)) - .with_pr(pr) - .arg("-v") - .envs(config.env()?) - .env(&*PATH_KEY, plugins::core::path_env_with_tv_path(tv)?) - .execute() - } - fn ruby_build_version(&self) -> Result { let output = cmd!(self.ruby_build_bin(), "--version").read()?; let re = regex!(r"^ruby-build ([0-9.]+)"); @@ -389,9 +352,7 @@ impl Backend for RubyPlugin { let config = Config::get(); self.install_cmd(&config, &tv, &ctx.pr)?.execute()?; - self.test_ruby(&config, &tv, &ctx.pr)?; self.install_rubygems_hook(&tv)?; - self.test_gem(&config, &tv, &ctx.pr)?; if let Err(err) = self.install_default_gems(&config, &tv, &ctx.pr) { warn!("failed to install default ruby gems {err:#}"); }