about require

L

Li Chen

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
 
A

Aredridel

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

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

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top