ruby_file_to!() { /* proc-macro */ }
Expand description
Execute Ruby from a file and return a different type
§Arguments
type
- The return type of the ruby codeinput
- A&str
literal containing the file path
§Example
Contents of ./src/main.rs
use macro_ruby::ruby_file_to;
let my_int = ruby_file_to!("src/file.rb");
assert_eq!(my_str, 1000);
Contents of ./src/file.rb:
puts 500+500
§List of supported types
i8
, i16
, i32
, i64
, i128
, u8
, u16
, u32
u64
, u128
, usize
, f32
, f64
, char
, bool
§Note
If your type isn’t supported you may use ruby_file_ast!
;