[Ironruby-core] Should Kernel.require accept Assembly instances?
orion.edwards at gmail.com
Mon Aug 9 16:45:42 EDT 2010
I'm looking through the MSDN docs for assembly loading, and it seems as
though you can either load an assembly from a path, or from a byte array.
Both of these methods return an Assembly object.
There doesn't appear to be any other way to actually get an Assembly object
other than by loading it, as the constructor is protected (assembly is
abstract), and the only classes that I can see in the framework that derive
from it are the internal RuntimeAssembly class (which is used for everything
pretty much), and System.Reflection.Emit.AssemblyBuilder.
As far as I can infer, the only way to actual get an assembly object is to
load the assembly, so if you're asking how you can load an assembly given an
Assembly object... it's already loaded.
Am I missing something?
On Tue, Aug 10, 2010 at 4:49 AM, Charles Strahan <
charles.c.strahan at gmail.com> wrote:
> Those are valid points. Perhaps #load_assembly could accept an assembly
> Sent from my iPhone
> On Aug 7, 2010, at 5:16 PM, Orion Edwards <orion.edwards at gmail.com> wrote:
> What's the advantage to extending require?
>> Presumably you're currently using the .NET Assembly.Load or
>> Assembly.LoadFrom methods to do this? (And if you're compiling code in
>> memory, you'll certainly be making heavy use of the .NET reflection API's
>> already anyway)
>> Require is a standard part of core ruby, and is meant to take paths.
>> While it's obvious to overload it to accept paths to dll's as well as rb
>> files, overloading it to take non-path things (such as .NET assembly
>> objects) seems like it's diverging a bit too far away from it's normal (ie:
>> MRI ruby) use, and more into the realms of specific .NET extensions...
>> On 7/08/2010, at 10:08 AM, Charles Strahan wrote:
>> What would you all think of having the ability to require a given
>>> Assembly? I think this could be useful when compiling code in memory, in
>>> which case there isn't a path to give Kernel.require.
>>> If this is something we could all use, I'll open a ticket for it.
>>> Ironruby-core mailing list
>>> Ironruby-core at rubyforge.org
>> Ironruby-core mailing list
>> Ironruby-core at rubyforge.org
> Ironruby-core mailing list
> Ironruby-core at rubyforge.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Ironruby-core