[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

comp.lang.ruby

Re: Facets 0.6.3

Ryan Leavengood

4/18/2005 6:50:00 PM

B. K. Oxley (binkley) wrote:
>
> Can you not teach require to translate the file names? (I'm too new to
> Ruby to know the answer to that. I know I can do it in Perl.)

Yes that is easy, but I think doing that definitely crosses the
over-engineered barrier.

How about rename [].rb to brackets.rb? Other cases could be treated
similarly (==.rb becomes equals.rb, <=>.rb becomes compare.rb, etc.)

For the other cases (foo?, foo!) I say just drop the punctuation in the
filename.

Ryan


6 Answers

B. K. Oxley (binkley)

4/18/2005 6:53:00 PM

0

Ryan Leavengood wrote:
> For the other cases (foo?, foo!) I say just drop the punctuation in the
> filename.

What happens when you have both foo? and foo! -- how do you tell them
apart for the require?


Cheers,
--binkley


james_b

4/18/2005 9:57:00 PM

0

Ryan Leavengood wrote:
> B. K. Oxley (binkley) wrote:
>
>>Can you not teach require to translate the file names? (I'm too new to
>>Ruby to know the answer to that. I know I can do it in Perl.)
>
>
> Yes that is easy, but I think doing that definitely crosses the
> over-engineered barrier.
>
> How about rename [].rb to brackets.rb? Other cases could be treated
> similarly (==.rb becomes equals.rb, <=>.rb becomes compare.rb, etc.)
>
> For the other cases (foo?, foo!) I say just drop the punctuation in the
> filename.

Or CGI-encode the name, as is done with the ri yaml data file names.

James


Trans

4/19/2005 1:46:00 AM

0

> Or CGI-encode the name, as is done with the ri yaml data file names.

An interesting idea, James, but I fear without the filsystem or Ruby's
require method understanding these, it would be way too
un-user-friendly --having to type:

require "%26%26.rb"

or what have you.

BTW, why do the ri yaml files all end in '-i' ?

Thanks,
T.

Trans

4/19/2005 4:46:00 AM

0

> BTW, why do the ri yaml files all end in '-i' ?

Never mind. I figured it out. It stands for "instance".

Thanks,
T.

james_b

4/19/2005 5:24:00 AM

0

Trans wrote:
>>Or CGI-encode the name, as is done with the ri yaml data file names.
>
>
> An interesting idea, James, but I fear without the filsystem or Ruby's
> require method understanding these, it would be way too
> un-user-friendly --having to type:
>
> require "%26%26.rb"

If one is already calling
require 'facets'

could not Facets munge 'require' so that it does a CGI.unescape behind
the scenes, so one could just call

require '!!'




>
> or what have you.
>
> BTW, why do the ri yaml files all end in '-i' ?

There are class files and instance files.


James


Trans

4/19/2005 3:41:00 PM

0


James Britt wrote:
> If one is already calling
> require 'facets'
>
> could not Facets munge 'require' so that it does a CGI.unescape
behind
> the scenes, so one could just call
>
> require '!!'

Actaully two things here:

1) Since RubyGems already munges #require, I'm not so keen on adding a
second munge layer. Do you think Matz would find CGI encoding suitable
for a general RCR on require?

2) But more importantly, one does not require 'facets' b/c Facets is
an _atomic library_, which means that everything is broken down into
fine grain peices. So instead one would do something like

require 'facet/string/singularize'

Of course, there are premade groupings one can use too, but there is no
one particular file that is always required.


> > BTW, why do the ri yaml files all end in '-i' ?
>
> There are class files and instance files.

Yep, that makes sense.

Thanks,
T.