FileUtils.cp

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

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 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-forum.com/\.

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

Mike

···

On 23/09/06 Vincent Fourmond said:

  include FileUtils

--
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

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 :wink: !

  Vince