artichoke_backend/extn/stdlib/shellwords/
mod.rs1use std::ffi::CStr;
2
3use crate::extn::prelude::*;
4
5const SHELLWORDS_CSTR: &CStr = c"Shellwords";
6static SHELLWORDS_RUBY_SOURCE: &[u8] = include_bytes!("vendor/shellwords.rb");
7
8pub fn init(interp: &mut Artichoke) -> InitializeResult<()> {
9 let spec = module::Spec::new(interp, "Shellwords", SHELLWORDS_CSTR, None)?;
10 interp.def_module::<Shellwords>(spec)?;
11 interp.def_rb_source_file("shellwords.rb", SHELLWORDS_RUBY_SOURCE)?;
12
13 Ok(())
14}
15
16#[derive(Debug, Clone, Copy)]
17pub struct Shellwords;