load(...)
public
Loads and executes the Ruby program in the file filename. If the
filename does not resolve to an absolute path, the file is searched for in
the library directories listed in $:. If the optional
wrap parameter 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.
Show source
/*
* call-seq:
* load(filename, wrap=false) => true
*
* Loads and executes the Ruby
* program in the file _filename_. If the filename does not
* resolve to an absolute path, the file is searched for in the library
* directories listed in <code>$:</code>. If the optional _wrap_
* parameter 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.
*/
static VALUE
rb_f_load(argc, argv)
int argc;
VALUE *argv;
{
VALUE fname, wrap;
rb_scan_args(argc, argv, "11", &fname, &wrap);
rb_load(fname, RTEST(wrap));
return Qtrue;
}