[][src]Function rosy::vm::load

pub unsafe fn load(file: impl Into<String>, wrap: bool)

Loads and executes the Ruby program file, without checking for exceptions.

If the filename does not resolve to an absolute path, the file is searched for in the library directories listed in $:.

If wrap is true, the loaded script will be executed under an anonymous module, protecting the calling program's global namespace. In no circumstance will any local variables in the loaded file be propagated to the loading environment.

Safety

Code executed from file may void the type safety of objects accessible from Rust. For example, if one calls push on Array<A> with an object of type B, then the inserted object will be treated as being of type A.

An exception may be raised by the code in file or by file being invalid.