The API does let you hook into the boot process at a point you specify. Merb::BootLoader loads its subclasses in a particular order. You can add to the boot process by simply extending Merb::BootLoader. Use the before and after methods to determine when your script is executed in boot. Logger is the first class loaded, so if you want to be right up front, load before that. Here is a skeleton (untested): http://gist.github.com/29482
On Nov 24, 10:14 pm, Rich Morin <[EMAIL PROTECTED]> wrote: > Background > > I'm playing around with merb, trying to add some infrastructure > for logging method calls, checking assertions, etc. My basic > plan, at this point, is as follows: > > * As soon as merb is run, walk ObjectSpace and record all of > the classes and methods that are defined at this point. > > * As soon as init.rb is run, walk ObjectSpace again and set > up "wrapper" methods for every "added" method (ie, ones > that were not recorded at start-up time). > > Also, set up a callback to set up a wrapper method for any > method that gets added after this point. > > Question > > In order to get my code to run as early as possible, I have made > a copy of the merb script (my_merb), adding the following line: > > require 'config/bare' if File.file? 'config/bare.rb' > > This works, but it conflicts with the notion of using public APIs, > rather then hacking up workarounds. So, is there a better way > to get the effect I'm looking for? If not, does this qualify as a > bug that should be reported? > > -r > --http://www.cfcl.com/rdm Rich Morinhttp://www.cfcl.com/rdm/resume > [EMAIL PROTECTED]://www.cfcl.com/rdm/weblog +1 650-873-7841 > > Technical editing and writing, programming, and web development --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "merb" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/merb?hl=en -~----------~----~----~----~------~----~------~--~---
