use std::process::Command;
use crate::{helper::{get_criterion_env_var, make_spec_tempfile}, runner::CommunicatingBenchmark, BenchSpec};
const HARNESS: &str = include_str!("harness.rb.in");
const SOURCE_EXTENSION: &str = ".rb";
pub fn spawn(spec: BenchSpec) -> CommunicatingBenchmark {
let bench_file = make_spec_tempfile(self::SOURCE_EXTENSION, HARNESS, &spec);
let ruby_path = get_criterion_env_var("RUBY", "ruby");
let mut command = Command::new(ruby_path);
command.arg(&bench_file);
CommunicatingBenchmark::start("Ruby", command, Some(bench_file))
}