Aimred Developer Blog March 2008 Archive
Living On The Edge With Merb
Merb is a Ruby web framework seen by some as a “Rails killer” because of it’s ORM agnostic nature (we use Sequel) and speed. However because it’s under extremely active development (Merb 0.9 was big jump from the previous version) with numerous API changes it can be tough to develop against.
One of the issues we found was a lack of documentation which can hit you in unexpected ways. We were stuck with a bug where our initialize method was not being called during model instantiation but only when tests were run or if certain lines of code were changed that the models validations no longer were executed. After a lot of hours pestering #Merb on IRC we stumbled by chance on the solution that the Merb::BootLoader.after_app_loads block in config/init.rb must only contain references to gems, not to local libs that are in the app lib/ directory which we did.
The symptoms were not indicative of the problem and it was a lucky guess that finally solved the problem. That’s just an illustrative example of one of the issues of developing against ‘fresh’ code. A good testing regime does help though as it identifies issues as it helps to identify issues as soon as the new API code is present.