ruby is a small compatibility and runtime module for translating Ruby
programs to V. It is not a Ruby interpreter.
The module currently provides:
- a dynamic
Valuetype for boundaries that have not yet been converted to concrete V types; - conversion between
Valueand dynamically typed JSON; - filesystem, environment, clock, and process helpers used by translated code;
- an explicit
unimplemented_fnboundary for incomplete translations.
Install it directly from GitHub:
v install --git https://github.com/vlang/rubyThen import it as a normal V module:
import ruby
pub fn translated_name(args ...ruby.Value) ruby.Value {
if args.len == 0 {
return ruby.object_value('NilClass', 'nil')
}
return ruby.string_value(args[0].as_string())
}Run the module tests with:
v test .BSD-2-Clause