public Method

Kernel.load(...)

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 $:. 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.

Source Code

/*
*  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;
}
Comments

Have your say
Please use Textile formatting (click here for a cheat sheet). Use <code/> and <pre/> for code samples.
Click here to login with OpenID to to post comments.