[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

comp.lang.ruby

FileUtils.cp

Michael P. Soulier

9/23/2006 12:20:00 PM

Hey,

It's great to see that FileUtils has Unix friendly methods, so it feels like
working in the shell. However, I'd prefer to just type cp and not
FileUtils.cp. Is there a way to import those methods into Kernel so I don't
have to qualify them all?

Thanks,
Mike
--
Michael P. Soulier <msoulier@digitaltorque.ca>
"Any intelligent fool can make things bigger and more complex... It
takes a touch of genius - and a lot of courage to move in the opposite
direction." --Albert Einstein
4 Answers

Vincent Fourmond

9/23/2006 12:24:00 PM

0


Hello !

> It's great to see that FileUtils has Unix friendly methods, so it feels like
> working in the shell. However, I'd prefer to just type cp and not
> FileUtils.cp. Is there a way to import those methods into Kernel so I don't
> have to qualify them all?

include FileUtils

Vince

Michael P. Soulier

9/24/2006 1:28:00 AM

0

On 23/09/06 Vincent Fourmond said:

> include FileUtils

Ah, perfect. I didn't realize that it was a module.

Mike
--
Michael P. Soulier <msoulier@digitaltorque.ca>
"Any intelligent fool can make things bigger and more complex... It
takes a touch of genius - and a lot of courage to move in the opposite
direction." --Albert Einstein

Vincent Fourmond

9/24/2006 2:00:00 AM

0

Michael P. Soulier wrote:
>> include FileUtils
>
> Ah, perfect. I didn't realize that it was a module.

Try

ri FileUtils

It does say it is a module... And anyway, it is a good reflex to look
at what ri is saying when you'd like to know something ;-) !

Vince


e

9/24/2006 2:26:00 AM

0

Michael P. Soulier wrote:
> Hey,
>
> It's great to see that FileUtils has Unix friendly methods, so it feels
> like
> working in the shell. However, I'd prefer to just type cp and not
> FileUtils.cp. Is there a way to import those methods into Kernel so I
> don't
> have to qualify them all?

FileUtils is a module so you can #include or #extend.


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