[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

comp.lang.ruby

Re: How to make Dir.glob method NOT case sensitive.

Kurt Euler

10/28/2004 9:27:00 PM

Eric-

Dumb question: What's "ri"?

BTW, from the online "pickax" book, I found this partial solution:

for f in
Dir.glob("m:/some_directory/**/{PCM_OP,pcm_op}*.{XML,xlm}")

Thanks.

-ke

-----Original Message-----
From: Eric Hodel [mailto:drbrain@segment7.net]
Sent: Thursday, October 28, 2004 2:22 PM
To: ruby-talk ML
Subject: Re: How to make Dir.glob method NOT case sensitive.



On Oct 28, 2004, at 2:08 PM, Kurt Euler wrote:

> All-
>
> Can anyone advise as to how to make the Dir.glob method NOT case
> sensitive.
>
> For example, in the following routine, I'd like to find all
> "PCM_OP*.XML" and "pcm_op*.xlm" occurances in the specified directory:

See Dir.glob and File.fnmatch in ri

> for f in Dir.glob("m:/some_directory/**/PCM_OP*.XML")
Dir.glob("m:/some_directory/**/PCM_OP*.XML",
File::FNM_CASEFOLD)
> next unless File.file?(f)
> count = count + 1
> puts File.dirname(f) + "/" + File.basename(f)
> end





1 Answer

Stephan Kämper

10/28/2004 10:08:00 PM

0

Kurt Euler wrote:

> Eric-
>
> Dumb question: What's "ri"?
>

"ri" is the I Ging. It has the answer to all questions (as long as
they're concerning Ruby).

ri Array

tells you what you can do with an Array.

ri select

shows you what modules/classes know about select

ri -c

tells you which classes ri knows.

It's a great tool, indeed. Thanks Dave.

Happy rubying

Stephan