From: David Vallner Date: 2006-11-12T05:25:01+09:00 Subject: Re: Loading, CGI and some aother questions --------------enigDA6B18214AB1CACA58B18A82 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Gambler Gluck wrote: > Well, configs are mine anyway, so I'm not afraid of injection from thos= e files. But how do I "source" a file? Kernel#load and Kernel#require ret= urn boolean and do not seem to affect local scope. Could you please provi= de a code example? >=20 eval / instance_eval / class_eval the contents of the file instead. You could also do as Rails does in for example config/routes.rb and provide an API to configure your app in a singleton. (Even is singletons are slightly evil with respects to unit testing, configuration isn't a component whose state changes at runtime as part of regular operation - i.e. only explicitly, not as a business logic side effect, so you can probably get away with that approach.) David Vallner --------------enigDA6B18214AB1CACA58B18A82 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (MingW32) iD8DBQFFVjHFy6MhrS8astoRAhC6AJ93PNR0iFZp+yS4sg4vyAvyt4rUBwCfR1n5 IBhOKvDnWrfz9b71nibO3cI= =C7VP -----END PGP SIGNATURE----- --------------enigDA6B18214AB1CACA58B18A82--