use anyhow::Result;
use super::{GeneratedFile, Mechanism, MechanismContext, StepResult};
pub struct RubyGem;
impl Mechanism for RubyGem {
fn id(&self) -> &'static str {
"ruby_gem"
}
fn description(&self) -> &'static str {
"Ruby gem wrapper (stub — downloads Release binary)"
}
fn stable(&self) -> bool {
false
}
fn generate(&self, ctx: &MechanismContext<'_>) -> Result<StepResult> {
let bin = &ctx.config.project.binary_name;
let base = format!(
"{}/ruby",
ctx.config.paths.packaging_dir.trim_end_matches('/')
);
Ok(StepResult {
files: vec![GeneratedFile {
relative_path: format!("{base}/README.md"),
contents: format!(
"# Ruby gem for `{bin}` (stub)\n\n\
Planned: gem that vendors/fetches the GitHub Release binary on install,\n\
similar to the npm postinstall and Hex Mix wrappers.\n\n\
Implement `RubyGem` in `sastri` when ready; keep Releases as source of truth.\n"
),
executable: false,
}],
notes: vec!["ruby_gem is a stub — no gemspec emitted yet.".into()],
})
}
}