From: Jason Voegele Date: 2005-09-23T09:48:01+09:00 Subject: Re: Switching code in or out. --nextPart1146384.NG9BLsQP3r Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On Thursday 22 September 2005 8:18, John Carter wrote: > Can anyone think of a convenient way of taking a class like.... > > class MyHairyClass > def invariant > raise "Invariant Failure: Bah" unless > deep_expensive_check_on_the_invariants_of_the_class > end > > def my_public_method( foo) > invariant > raise "Precondition failure: Blah" unless > some_expression_involving_foo > > # DO STUFF > > raise "Postcondtion failure: Bloo" unless > some_expression > invariant > end > > end Have you looked at the Ruby DbC package? It is not very robust solution, b= ut=20 it is simple and sounds like it might suit your needs: http://www.rubycentral.com/downloads/dbc.html =2D-=20 Jason Voegele The little town that time forgot, Where all the women are strong, The men are good-looking, And the children above-average. -- Prairie Home Companion --nextPart1146384.NG9BLsQP3r Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.5 (GNU/Linux) iD8DBQBDM1C1hnQPOwpx0DURAq7xAJ40tIE9ldhjgtwTDKkNGfO2wHsd3QCfWu2w XXQx1Tj68XR90KuzCC0qS2c= =E6I1 -----END PGP SIGNATURE----- --nextPart1146384.NG9BLsQP3r--