[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

.rb file includes c-extension of same name?

Bill Kelly

3/20/2006 2:40:00 AM

Hi,

I have foo.rb and foo.so, the C-extension part of the module.

Inside foo.rb, I can put, require 'foo.so', and it works fine,
allowing other modules to say require 'foo', and have the .rb
be loaded, which in turn loads the C-extension.

I'm wondering if there's a recommended platform-independent
way to do this? For instance, on OS X, C-extensions end in
".bundle" not ".so".

I wouldn't mind even saying require "foo.#{DLEXT}", if there
were such a thing available from ruby.

Is there a recommended way to have a .rb file require a
C-extension file of the same name in a platform-independent
way? Or is the preferred solution to alter the name of one
of the two files?


Thanks,

Bill




11 Answers

Ara.T.Howard

3/20/2006 5:24:00 AM

0

Bill Kelly

3/20/2006 5:40:00 AM

0

From: <ara.t.howard@noaa.gov>
>
> harp:~ > ruby -r yaml -r rbconfig -e' y Config::CONFIG '|egrep DLEXT
> DLEXT2: ""
> DLEXT: so

Aha! TYVM. I'd been grepping the C source. . . .


Regards,

Bill




George Ogata

3/20/2006 10:15:00 AM

0

"Bill Kelly" <billk@cts.com> writes:

> Hi,
>
> I have foo.rb and foo.so, the C-extension part of the module.
>
> Inside foo.rb, I can put, require 'foo.so', and it works fine,
> allowing other modules to say require 'foo', and have the .rb
> be loaded, which in turn loads the C-extension.
>
> I'm wondering if there's a recommended platform-independent
> way to do this? For instance, on OS X, C-extensions end in
> ".bundle" not ".so".
>
> I wouldn't mind even saying require "foo.#{DLEXT}", if there
> were such a thing available from ruby.
>
> Is there a recommended way to have a .rb file require a
> C-extension file of the same name in a platform-independent
> way? Or is the preferred solution to alter the name of one
> of the two files?
>
>
> Thanks,
>
> Bill

An alternative: call the C bit "foo_ext.so" (say) and then in "foo.rb"
just do "require 'foo_ext'"?

Tim Hunter

3/20/2006 12:18:00 PM

0

Bill Kelly wrote:
> Hi,
>
> I have foo.rb and foo.so, the C-extension part of the module.
>
> Inside foo.rb, I can put, require 'foo.so', and it works fine,
> allowing other modules to say require 'foo', and have the .rb
> be loaded, which in turn loads the C-extension.
>
> I'm wondering if there's a recommended platform-independent
> way to do this? For instance, on OS X, C-extensions end in
> ".bundle" not ".so".
>
> I wouldn't mind even saying require "foo.#{DLEXT}", if there
> were such a thing available from ruby.
>
> Is there a recommended way to have a .rb file require a C-extension file
> of the same name in a platform-independent
> way? Or is the preferred solution to alter the name of one
> of the two files?
>
>
> Thanks,
>
> Bill
>
>
>
>
You can just always use ".so". Ruby is clever enough to figure out what
".so" really means on the current platform.

Gerard

12/21/2010 8:41:00 PM

0

Abbeddrose Bierce wrote:
> On Tue, 21 Dec 2010 14:23:26 -0600, "Matthew B. Tepper"
> <oy?@earthlink.net> wrote:
>
> > does not construct logical arguments to support his
> > opinions.
>
>
> Chrain brains do not have the facilities to understand my arguments
>

Is this your "argument" for never using arguments?


uncle dave

12/21/2010 11:06:00 PM

0

On Dec 21, 11:02 am, Abbeddrose Bierce <ansermetn...@hotmail.com>
wrote:
> On Tue, 21 Dec 2010 17:59:16 +0100, "Gerard"
>
> <g_nospam_hendrik...@hotmail.com> wrote:
> >OTOH the essence of his post is exactly the same as ever: HE is a Genius & a
> >Giant who has Changed the World.
>
> Don't like  it Gerard. Guess what, Tuff Shit
>
> Abbedd

How is it that you talk so tough to others? I've invited you to make
your remark happen to me, and you run like the scalded dog you are.
Why can't you meet force with force? Because you're weak and
trembling at the signs of a real confrontation? Don't like the way I
treat you? Tough shit.
Uncle Dave your friend

uncle dave

12/21/2010 11:07:00 PM

0

On Dec 21, 10:59 am, "Gerard" <g_nospam_hendrik...@hotmail.com> wrote:
> Jenn wrote:
> > In article
> > <70f5f76e-2e39-4ebb-967c-c40517a42...@s5g2000yqm.googlegroups.com>,
> >  herman <her...@yahoo.com> wrote:
>
> > > On 21 d c, 05:43, Abbeddrose Bierce <ansermetn...@hotmail.com>
> > > wrote:
>
> > > > Plonk
>
> > > > Disrespectful cunt
>
> > > > Your accomplishments better than mine?
>
> > > > Sicko
>
> > > > I pity your students
>
> > > > Abbedd
>
> > > This is how you respond to the first person in years who says
> > > something friendly to you (i.e. that a lot of sax players like your
> > > MPs)?
>
> > Indeed.  I have no problem at all with most of his posts.  I disagree
> > with many of them, but he has a right to his opinions.  The only thing
> > that bothers me is his egotistical ranting about his childish view of
> > his importance in the music world.
>
> As for his "opnions": he already started a "thread" about your CV on your
> website.
> Maybe you'll have a problem with that.
> OTOH the essence of his post is exactly the same as ever: HE is a Genius & a
> Giant who has Changed the World.

Where is that thread? Bullying someone who might be like, a
professional? Hard to believe of our rabbi.
Uncle Dave

ansermetniac

12/21/2010 11:09:00 PM

0

On Tue, 21 Dec 2010 15:05:55 -0800 (PST), uncle dave
<david.forsman@sbcglobal.net> wrote:

>On Dec 21, 11:02?am, Abbeddrose Bierce <ansermetn...@hotmail.com>
>wrote:
>> On Tue, 21 Dec 2010 17:59:16 +0100, "Gerard"
>>
>> <g_nospam_hendrik...@hotmail.com> wrote:
>> >OTOH the essence of his post is exactly the same as ever: HE is a Genius & a
>> >Giant who has Changed the World.
>>
>> Don't like ?it Gerard. Guess what, Tuff Shit
>>
>> Abbedd
>
>How is it that you talk so tough to others? I've invited you to make
>your remark happen to me, and you run like the scalded dog you are.
>Why can't you meet force with force? Because you're weak and
>trembling at the signs of a real confrontation? Don't like the way I
>treat you? Tough shit.
>Uncle Dave your friend


I don't prey on the mentally ill

Abbedd

Yaackov Ben Ephraim

12/21/2010 11:11:00 PM

0

On Tue, 21 Dec 2010 15:07:24 -0800 (PST), uncle dave
<david.forsman@sbcglobal.net> wrote:

>On Dec 21, 10:59?am, "Gerard" <g_nospam_hendrik...@hotmail.com> wrote:
>> Jenn wrote:
>> > In article
>> > <70f5f76e-2e39-4ebb-967c-c40517a42...@s5g2000yqm.googlegroups.com>,
>> > ?herman <her...@yahoo.com> wrote:
>>
>> > > On 21 d c, 05:43, Abbeddrose Bierce <ansermetn...@hotmail.com>
>> > > wrote:
>>
>> > > > Plonk
>>
>> > > > Disrespectful cunt
>>
>> > > > Your accomplishments better than mine?
>>
>> > > > Sicko
>>
>> > > > I pity your students
>>
>> > > > Abbedd
>>
>> > > This is how you respond to the first person in years who says
>> > > something friendly to you (i.e. that a lot of sax players like your
>> > > MPs)?
>>
>> > Indeed. ?I have no problem at all with most of his posts. ?I disagree
>> > with many of them, but he has a right to his opinions. ?The only thing
>> > that bothers me is his egotistical ranting about his childish view of
>> > his importance in the music world.
>>
>> As for his "opnions": he already started a "thread" about your CV on your
>> website.
>> Maybe you'll have a problem with that.
>> OTOH the essence of his post is exactly the same as ever: HE is a Genius & a
>> Giant who has Changed the World.
>
>Where is that thread? Bullying someone who might be like, a
>professional? Hard to believe of our rabbi.
>Uncle Dave

Beware the G.K.s

Yaackov ben Ephraim
Famous Jewish Philosopher

uncle dave

12/21/2010 11:14:00 PM

0

On Dec 21, 5:11 pm, Yaackov Ben Ephraim <y...@hotmail.com> wrote:
> On Tue, 21 Dec 2010 15:07:24 -0800 (PST), uncle dave
>
>
>
> <david.fors...@sbcglobal.net> wrote:
> >On Dec 21, 10:59 am, "Gerard" <g_nospam_hendrik...@hotmail.com> wrote:
> >> Jenn wrote:
> >> > In article
> >> > <70f5f76e-2e39-4ebb-967c-c40517a42...@s5g2000yqm.googlegroups.com>,
> >> > herman <her...@yahoo.com> wrote:
>
> >> > > On 21 d c, 05:43, Abbeddrose Bierce <ansermetn...@hotmail.com>
> >> > > wrote:
>
> >> > > > Plonk
>
> >> > > > Disrespectful cunt
>
> >> > > > Your accomplishments better than mine?
>
> >> > > > Sicko
>
> >> > > > I pity your students
>
> >> > > > Abbedd
>
> >> > > This is how you respond to the first person in years who says
> >> > > something friendly to you (i.e. that a lot of sax players like your
> >> > > MPs)?
>
> >> > Indeed. I have no problem at all with most of his posts. I disagree
> >> > with many of them, but he has a right to his opinions. The only thing
> >> > that bothers me is his egotistical ranting about his childish view of
> >> > his importance in the music world.
>
> >> As for his "opnions": he already started a "thread" about your CV on your
> >> website.
> >> Maybe you'll have a problem with that.
> >> OTOH the essence of his post is exactly the same as ever: HE is a Genius & a
> >> Giant who has Changed the World.
>
> >Where is that thread?  Bullying someone who might be like, a
> >professional?  Hard to believe of our rabbi.
> >Uncle Dave
>
> Beware the G.K.s
>
> Yaackov ben Ephraim
> Famous Jewish Philosopher

What a fool. Coining a new moniker for that? Wasted time. Spend it
examining yourself and your life, not on this lame tripe.