From: Hagbard Celine on
Brian Candler wrote:
> I wish 'load' would simply return the anonymous module it has created,
> but there are nasty workarounds.

Exactly this behavior I would have loved and needed. What a bummer that
there are just workarounds which are indeed nasty. I guess I have to
live with it. Thanks for your help.
--
Posted via http://www.ruby-forum.com/.

From: Hagbard Celine on
Rein Henrichs wrote:
> Properly written Rubby libraries namespace their classes and modules.
> If you own the code you're requiring, fix it. If not, find an
> alternative to the code in question (which I find suspect based on this
> lack of namespacing) or perhaps you may find some luck with Kernel#load.

I happen to be in control of the loaded modules but I think you didn't
understand my problem correctly. If I use namespace guards (what I
actually do at the moment) the loaded modules remain in existence and
pollute my namespace. So, namespace guards don't really help me.

@Joel:
The `Script' library seems to fit my needs quite perfectly. Thank you
for the hint.
--
Posted via http://www.ruby-forum.com/.

From: Dreamcat Four on
Joel VanderWerf wrote:
> However, you don't get easy access to the anonymous module. If you want
> that, I have a little library that may be helpful:
>
> http://redshift.sourceforge.net/script/

This is great, but seems to blows up when requiring other files

http://github.com/dreamcat4/plist4r/blob/master/lib/plist4r/backend/c_f_property_list.rb#L8

http://gist.github.com/471434

I noticed that there is a redefinition of require in script.rb. Is that
method meant to be handling that?

http://redshift.sourceforge.net/script/doc/classes/Script.html#M000003


Best regards

dreamcat4
dreamcat4(a)gmail.com
--
Posted via http://www.ruby-forum.com/.

From: Joel VanderWerf on
Dreamcat Four wrote:
> Joel VanderWerf wrote:
>> However, you don't get easy access to the anonymous module. If you want
>> that, I have a little library that may be helpful:
>>
>> http://redshift.sourceforge.net/script/
>
> This is great, but seems to blows up when requiring other files
>
> http://github.com/dreamcat4/plist4r/blob/master/lib/plist4r/backend/c_f_property_list.rb#L8
>
> http://gist.github.com/471434

Is it possible to simplify the example a bit? I can't tell where the
missing const is actually defined.

> I noticed that there is a redefinition of require in script.rb. Is that
> method meant to be handling that?
>
> http://redshift.sourceforge.net/script/doc/classes/Script.html#M000003

There's an example of using require with script in examples/program2.rb.
Maybe that helps?

Sorry not to be more helpful...

From: Dreamcat Four on
Thanks for replying,
Will try to come back soon with an example for reproducing this.

Joel VanderWerf wrote:
> Dreamcat Four wrote:
>> http://gist.github.com/471434
> Is it possible to simplify the example a bit? I can't tell where the
> missing const is actually defined.
>
>> I noticed that there is a redefinition of require in script.rb. Is that
>> method meant to be handling that?
>>
>> http://redshift.sourceforge.net/script/doc/classes/Script.html#M000003
>
> There's an example of using require with script in examples/program2.rb.
> Maybe that helps?
>
> Sorry not to be more helpful...

--
Posted via http://www.ruby-forum.com/.