about require

Discussion in 'Ruby' started by Li Chen, Oct 20, 2006.

  1. Li Chen

    Li Chen Guest

    Hi folks,

    In Ruby why do we wirte code as require 'enumerator', instead of
    require 'Enumerator' with uppercase? What happens if 'enumerator' is not
    saved in the default path that Ruby usually looks for?


    Thanks,

    Li

    --
    Posted via http://www.ruby-forum.com/.
     
    Li Chen, Oct 20, 2006
    #1
    1. Advertising

  2. Li Chen

    Aredridel Guest

    --=-iAIJ8rHcIZhKQdglXDMO
    Content-Type: text/plain
    Content-Transfer-Encoding: quoted-printable

    On Sat, 2006-10-21 at 01:06 +0900, Li Chen wrote:=20
    > Hi folks,
    >=20
    > In Ruby why do we wirte code as require 'enumerator', instead of=20
    > require 'Enumerator' with uppercase?=20


    Because classes and files don't have a 1:1 mapping, and filesystems on
    some systems have case issues.

    > What happens if 'enumerator' is not=20
    > saved in the default path that Ruby usually looks for?


    Then it won't work unless you alter the path or put it in the right
    place.

    --=-iAIJ8rHcIZhKQdglXDMO
    Content-Type: application/pgp-signature; name=signature.asc
    Content-Description: This is a digitally signed message part

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

    iD8DBQBFOQGPtP09exA3hooRAj59AJ9//b00zPZg0dh16yxkxS2r/mdxKQCfRRTa
    j1m2JJwIvhOtYg25Q7lT0io=
    =IEfa
    -----END PGP SIGNATURE-----

    --=-iAIJ8rHcIZhKQdglXDMO--
     
    Aredridel, Oct 20, 2006
    #2
    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. Herman Eldering

    Re: Why does using keyword require a new scope?

    Herman Eldering, Aug 24, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    980
    Herman Eldering
    Aug 24, 2003
  2. Jip from Paris
    Replies:
    0
    Views:
    1,908
    Jip from Paris
    Aug 25, 2003
  3. Don
    Replies:
    2
    Views:
    442
    Ralph Henneberg
    Dec 10, 2003
  4. Patrick LeBoutillier

    use/require handler?

    Patrick LeBoutillier, Jan 31, 2004, in forum: Perl
    Replies:
    4
    Views:
    503
    Gunnar Hjalmarsson
    Jan 31, 2004
  5. steffen staehle
    Replies:
    0
    Views:
    504
    steffen staehle
    Sep 7, 2004
Loading...

Share This Page