Today I was doing a spike on a crazy idea we've been toying on for a while, and I found myself in need of disabling authentication on one API endpoint in an existing application.
Of course I could just edit the source, but where's the fun in that? Surely there must be a better way. Alas the application is written in Merb, which has been in "suspended animation" since the merge with Rails was announced. As a consequence there doesn't seem to be much information around on this kind of -nasty hacks- advanced topics.
Long story short, Merb accepts an optional -I [filename.rb] argument; the file will be loaded and evaluated at some point during the application startup.
That's not the end of the story though: the file is evaluated early in the boot; merb-core is available, but none of your models, controllers and so on. Not a big deal, you just have to use the correct hook.
And that's it--this controller is now wide open, just the way I wanted it!