# Code Review: Loader9

**URL:** <https://www.ruby-forum.com/t/code-review-loader9/137205>\
**Category:** IronRuby\
**Created:** [May 10, 2008, 12:43am UTC](https://www.ruby-forum.com/t/code-review-loader9/137205 "2008-05-10T00:43:08Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![grujildo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/94ad74/32.png) [@grujildo](https://www.ruby-forum.com/u/grujildo)\
**Post date:** [May 10, 2008, 12:43am UTC](https://www.ruby-forum.com/t/code-review-loader9/137205/1 "2008-05-10T00:43:08Z")

</div>

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>,)? 

```

(, =)+, property  
names are arbitrary identifiers and property values arbitrary strings  
not containing ‘=’ or ‘,’. Exact CLR property names are not matched.

1. 

```
  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.

1. 

```
  Relative path

```

- 

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

```

Notes:

- 

```
     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.

Tomas
