A recent inquiry on the Ruby.NET list brought up the question as to
whether or not the ability to reference ruby libs as embedded resources
is
supported or will be supported via IronRuby. e.g.,
A recent inquiry on the Ruby.NET list brought up the question as to
whether or not the ability to reference ruby libs as embedded resources
is supported or will be supported via IronRuby. e.g.,
require ‘res://assembly.dll/foo/bar’
Yes/No/Maybe? Reasons For/Against/Agnostic?
Is the embedded resource a Ruby file or something else?
What is the feature used for?
A recent inquiry on the Ruby.NET list brought up the question as to
whether or not the ability to reference ruby libs as embedded resources
is supported or will be supported via IronRuby. e.g.,
require ‘res://assembly.dll/foo/bar’
Is the embedded resource a Ruby file or something else?
What is the feature used for?
I imagine the idea is to make deployment more robust by putting the
Ruby source somewhere that a user can’t screw up.
for anything beyond experimentation) via creating an assembly who’s only
they plan to provide support for embedded resources, and if so, the
namespace ResourceLib
Ruby.String(m_encoding.GetString((byte[])manager.GetObject(stdLibName)));
I imagine the idea is to make deployment more robust by putting the
Ruby source somewhere that a user can’t screw up.
At least, that’s what I’d want it for…
Right, but if you have a DLL already, you can just host IronRuby from C#
and feed it Ruby code however you want to.
I guess I’d be hesitant to change the meaning of “require”. The way we
have it now (require ‘mscorlib’) is nice because it’s not changing the
behavior. If you really wanted to you could write mscorlib.rb and run
your code on another Ruby implementation.
On Fri, 08 Feb 2008 19:09:25 -0700, John M. [email protected]
wrote:
Right, but if you have a DLL already, you can just host IronRuby from C#
and feed it Ruby code however you want to.
True. So would that then be the prefered way to go about providing
support?
I guess I’d be hesitant to change the meaning of “require”. The way we
have it now (require ‘mscorlib’) is nice because it’s not changing the
behavior. If you really wanted to you could write mscorlib.rb and run
your code on another Ruby implementation.
Oh, I’m not suggesting changing the meaning, just adding a handler for
the
‘res’ protocol that would locate the source file via an assembly rather
than the file system. To me, anyway, I don’t see any difference between
what,
On Fri, 08 Feb 2008 20:11:27 -0700, Michael L. [email protected] wrote:
heck if it’s that needed, someone can write resrequire
Assuming this would be seen as standard practice for implementing core
language extensions, this would probably make the most sense, avoiding
any
compromise and ensuring that there’s a simple escape hatch to fallback
to
require if the resrequire method isn’t supported or if the requested
embedded resource is unavailable.
My /personal/ view is that IronRuby should be Ruby first and .NET
second. Anything that’s done outside of “normal” behaviour should be
implemented outside of the core implementation. I’d almost go as far
as to say that the current method of loading .NET assemblies is
pushing it, but that’s an extreme view.
So yes, if we’re doing something specific to this platform it should
be implemented ontop of the core language not in it. It would be up
to the person writing the code that uses resrequire (or urirequire) to
perform the graceful fallback.
On Fri, 08 Feb 2008 20:57:58 -0700, Michael L. [email protected] wrote:
So yes, if we’re doing something specific to this platform it should
be implemented ontop of the core language not in it. It would be up
to the person writing the code that uses resrequire (or urirequire) to
perform the graceful fallback.
That makes complete sense and I can’t help but agree.