[Ironruby-core] Accessing classes defined in IronRuby.dll from within IronRuby (IronRuby 1.0RC1)

Jimmy Schementi Jimmy.Schementi at microsoft.com
Sun Jan 17 21:56:23 EST 2010

load_assembly 'IronRuby' will do the trick.

Doing require 'ironruby' will actually load the ironruby.rb in the ironruby library dir, but that file just warns that its not required to load that file, and doesn't load any assemblies. We should probably just get rid of that file, or make it actually load the assembly.


On Jan 17, 2010, at 6:45 PM, "Orion Edwards" <orion.edwards at gmail.com<mailto:orion.edwards at gmail.com>> wrote:

I'd like to use the IronRuby name mangling methods from within a script I'm writing, but it seems as though I can't access things that are defined in IronRuby.dll?

Reflector tells me that TryMangleName is a public static method on IronRuby.Runtime.RubyUtils, which is defined in IronRuby.dll.

I'm trying to access it like this:

> load_assembly 'IronRuby'
=> true
> System::AppDomain.current_domain.get_assemblies.each{|x| puts x}; nil
...(snip) ...
System, Version=, Culture=neutral, PublicKeyToken=b77a5c561934e089
IronRuby, Version=, Culture=neutral, PublicKeyToken=31bf3856ad364e35
Microsoft.Scripting, Version=, Culture=neutral, PublicKeyToken=31bf3856ad364e35
...(snip) ...
=> nil
> IronRuby::Runtime::RubyUtils.try_mangle_name("Foo")
NameError: uninitialized constant IronRuby::Runtime
> IronRuby::Runtime
NameError: uninitialized constant IronRuby::Runtime

Is IronRuby treating it's own dll's specially? If so, is there any way I can get at the name mangling function?

Thanks, Orion.
Ironruby-core mailing list
Ironruby-core at rubyforge.org<mailto:Ironruby-core at rubyforge.org>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20100118/5da81c89/attachment.html>

More information about the Ironruby-core mailing list