FileUtils.cp

Discussion in 'Ruby' started by Michael P. Soulier, Sep 23, 2006.

  1. --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+tyQg6CeItDPuwACcDdn6
    ba5yko8SKrOXKJwl9WsXuvg=
    =lCeM
    -----END PGP SIGNATURE-----

    --YAMuP2N37TMqsqKK--
     
    Michael P. Soulier, Sep 23, 2006
    #1
    1. Advertising

  2. 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
     
    Vincent Fourmond, Sep 23, 2006
    #2
    1. Advertising

  3. --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+qAJ4sKM4ciWNjpqP82mUn0u79IOf5uACggRif
    cYR/AWnRhpx9Ne9u4lXbn7g=
    =8s3p
    -----END PGP SIGNATURE-----

    --OcTOUf3JcxRJhNXh--
     
    Michael P. Soulier, Sep 24, 2006
    #3
  4. 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
     
    Vincent Fourmond, Sep 24, 2006
    #4
  5. 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/.
     
    Eero Saynatkari, Sep 24, 2006
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. mahesh
    Replies:
    1
    Views:
    630
    Andrew Thompson
    Dec 7, 2006
  2. Grzegorz Chrupala
    Replies:
    2
    Views:
    241
    Grzegorz Chrupala
    Jun 30, 2003
  3. Chad Fowler

    Fileutils.cp bug?

    Chad Fowler, Nov 17, 2003, in forum: Ruby
    Replies:
    2
    Views:
    200
  4. Jim Freeze

    FileUtils Bug in 1.8.0

    Jim Freeze, Apr 22, 2004, in forum: Ruby
    Replies:
    0
    Views:
    120
    Jim Freeze
    Apr 22, 2004
  5. Joel VanderWerf

    FileUtils.mv and the :force option

    Joel VanderWerf, May 7, 2004, in forum: Ruby
    Replies:
    2
    Views:
    203
    Minero Aoki
    May 7, 2004
Loading...

Share This Page