Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > FileUtils.cp

Reply
Thread Tools

FileUtils.cp

 
 
Michael P. Soulier
Guest
Posts: n/a
 
      09-23-2006
--YAMuP2N37TMqsqKK
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

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
--=20
Michael P. Soulier <>
"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

--YAMuP2N37TMqsqKK
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)

iD8DBQFFFSZaKGqCc1vIvggRAhgyAJ4y9zkFIL0W5Cg+tyQg6C eItDPuwACcDdn6
ba5yko8SKrOXKJwl9WsXuvg=
=lCeM
-----END PGP SIGNATURE-----

--YAMuP2N37TMqsqKK--

 
Reply With Quote
 
 
 
 
Vincent Fourmond
Guest
Posts: n/a
 
      09-23-2006

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

 
Reply With Quote
 
 
 
 
Michael P. Soulier
Guest
Posts: n/a
 
      09-24-2006
--OcTOUf3JcxRJhNXh
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On 23/09/06 Vincent Fourmond said:

> include FileUtils


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

Mike
--=20
Michael P. Soulier <>
"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

--OcTOUf3JcxRJhNXh
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)

iD8DBQFFFd8TKGqCc1vIvggRAg+qAJ4sKM4ciWNjpqP82mUn0u 79IOf5uACggRif
cYR/AWnRhpx9Ne9u4lXbn7g=
=8s3p
-----END PGP SIGNATURE-----

--OcTOUf3JcxRJhNXh--

 
Reply With Quote
 
Vincent Fourmond
Guest
Posts: n/a
 
      09-24-2006
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


 
Reply With Quote
 
Eero Saynatkari
Guest
Posts: n/a
 
      09-24-2006
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/.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off




Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57