From: David Vallner Date: 2006-04-12T09:33:11+09:00 Subject: Re: Equivalent of Java static code block in Ruby? --nextPart1245106.YERaHO0BSd Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline D=C5=88a Utorok 11. Apr=C3=ADl 2006 23:56 Matthew Desmarais nap=C3=ADsal: > I think you need to find out why the class is being loaded multiple > times. I may be completely off base here, but don't you load your > entire app every time that you get a new request in Rails development > mode? That would explain the results that you're seeing. > Does it behave that way for BEGIN {} and END {} blocks too? Religious sidenote: you should not use "static" code to alter application=20 state, lest classloading (-parsing) order static data clobbering grues eat= =20 your face sooner than you think. Extract the configuration handling into a singleton initialized from them=20 files perhaps? Just a thought. David Vallner --nextPart1245106.YERaHO0BSd Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2.2 (GNU/Linux) iD8DBQBEPErA+aUhotvmpDgRAqwXAKCcLK0AeqUP9u+1YZgg3s4BgjGH9ACeKDBa 8VZcVzLllCBiza2MEiRYEHE= =wZLs -----END PGP SIGNATURE----- --nextPart1245106.YERaHO0BSd--