[Ironruby-core] Support For Referencing Ruby Libs As Embedded Resources?
Michael Letterle
michael.letterle at gmail.com
Sat Feb 9 08:00:13 EST 2008
For what it's worth, this /is/ possible today:
require 'mscorlib'
def resrequire(assembly, resource)
assem = System::Reflection::Assembly.LoadFile assembly
stream = assem.GetManifestResourceStream(resource)
streamreader = System::IO::StreamReader.new stream
filetext = streamreader.ReadToEnd
file = File.new resource, 'w'
file.write filetext
file.close
require resource
File.delete resource
end
I think I'd rather use eval then create a file, but we don't have that yet ;)
On Feb 9, 2008 12:45 AM, M. David Peterson <m.david at xmlhacker.com> wrote:
> On Fri, 08 Feb 2008 20:57:58 -0700, Michael Letterle
> <michael.letterle at gmail.com> 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. :)
>
> --
>
> /M:D
>
> M. David Peterson
> Co-Founder & Chief Architect, 3rd&Urban, LLC
> Email: m.david at 3rdandUrban.com | m.david at amp.fm
> Mobile: (206) 418-9027
> http://3rdandUrban.com | http://amp.fm |
> http://www.oreillynet.com/pub/au/2354
> _______________________________________________
> Ironruby-core mailing list
> Ironruby-core at rubyforge.org
> http://rubyforge.org/mailman/listinfo/ironruby-core
>
--
Michael Letterle
[Polymath Programmer]
http://michaeldotnet.blogspot.com
More information about the Ironruby-core
mailing list