Skip to content

Commit

Permalink
fix(ruby): remove ruby/gem tests (jdx#4130)
Browse files Browse the repository at this point in the history
These do not play nice with some security software and they have always seemed to cause more trouble than they're worth
  • Loading branch information
jdx authored Jan 17, 2025
1 parent 2768e1f commit de703d8
Showing 1 changed file with 0 additions and 39 deletions.
39 changes: 0 additions & 39 deletions src/plugins/core/ruby.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}
Expand Down Expand Up @@ -197,39 +193,6 @@ impl RubyPlugin {
Ok(())
}

fn test_ruby(
&self,
config: &Config,
tv: &ToolVersion,
pr: &Box<dyn SingleReport>,
) -> 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<dyn SingleReport>,
) -> 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<String> {
let output = cmd!(self.ruby_build_bin(), "--version").read()?;
let re = regex!(r"^ruby-build ([0-9.]+)");
Expand Down Expand Up @@ -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:#}");
}
Expand Down

0 comments on commit de703d8

Please sign in to comment.