From: Eric Hodel Date: 2004-03-10T13:35:16-08:00 Subject: Re: Borges app registration: mystery solved --BkCcXYe/IK2urb/q Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Jim Menard (jimm@io.com) wrote: > I think I understand what's happening with the out-of-the-box Borges exam= ples. > WEBrick.rb includes Borges.rb, which in turn includes all of the individu= al > components including the Counter example. Counter.rb has >=20 > class Borges::Counter < Borges::Component > # ... >=20 > register_application('counter') >=20 > end >=20 > This means register_application gets called when the file is required. Th= at > method registers the application with the default dispatcher, which is the > object responsible for recoginizing the '/counter' part of the URL. Yep. > The 'tutorial' app isn't registered because the require statements for th= at > one and a few others are commented out of the top-level Borges.rb file. I haven't bothered to verify that the tutorial app works yet, its very Smalltalkish. > This means that in order to add your own application you can add it to > Borges.rb. You don't need to do this, from your application code, you should: require 'Borges' class MyCounter < Borges::Component ... register_application 'mycounter' end See the SushiNet example in: /usr/local/share/examples/ruby/Borges/ --=20 Eric Hodel - drbrain@segment7.net - http://segment7.net All messages signed with fingerprint: FEC2 57F1 D465 EB15 5D6E 7C11 332A 551C 796C 9F04 --BkCcXYe/IK2urb/q Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.2 (FreeBSD) iD8DBQFAT4oUMypVHHlsnwQRAvD8AJ9fGd79MZwBdkvx6NZvuDKEQPoZiQCfb3Zb qYD8KU1Pp1sxXKIt28kffOg= =t3jB -----END PGP SIGNATURE----- --BkCcXYe/IK2urb/q--