[Ironruby-core] Code Review: Loader9

Tomas Matousek Tomas.Matousek at microsoft.com
Fri May 9 18:40:21 EDT 2008

tfpt review /shelveset:Loader9;REDMOND\tomat

DLR change:

Adds IsAbsolutePath to PlatformAdaptationLayer. On Windows the options are:

1)     "foo\bar"

2)     "\foo\bar"

3)     "X:foo\bar"

4)     "X:\foo\bar"

Of which only the last one is absolute. 1) is relative to the current directory, 2) and 3) are relative to the current drive.
One Unix all paths starting with "/" are absolute.

Ruby changes:

A new implementation of file loader in Ruby.

File loading works as follows:

Argument path is

1.       CLR long assembly name or qualified type name

-          Load .NET assembly or C# implemented Ruby library if the type of the library initializer is specified. The library initializer needs to derive from LibraryInitializer class and is called to load the library classes and modules.

-          The path is matched against pattern (<type-name>,)? <simple-assembly-name> (, <property-name>=<property-value>)+, property names are arbitrary identifiers and property values arbitrary strings not containing '=' or ','. Exact CLR property names are not matched.

2.       Absolute path
switch (extension):

*         .rb -> load

*         .dll

*   MRI: load dll

*   IR: not supported

*         None

*   MRI: try load path + .rb, path + .dll

*   IR: try load path, path + extension for all registered extensions in runtime (.rb, .py, .js, ...)

*         If multiple files match exist an ambiguous match exception is thrown.

3.       Relative path

*         For each dir in LoadPaths: Apply (2) on dir combined with path


-          Require checks $" variable for loaded files and appends the name of the loaded file with extension to it on success.

-          Load doesn't try to append extensions.

Adds Kernel#load_assembly(assembly, type) for loading assemblies and C# implemented Ruby libraries.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20080509/a482b1f1/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Loader9.diff
Type: application/octet-stream
Size: 49470 bytes
Desc: Loader9.diff
URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20080509/a482b1f1/attachment-0001.obj>

More information about the Ironruby-core mailing list