Nate Clark's blog
Interesting Things
libxml-ruby doesn't work on Windows (surprise, surprise!). One of our teams discovered that the version of Ruby on Windows has a XML::Parser class, but it is NOT libxml-ruby even if you try to install the gem. A workaround is to rename or delete the libxml.so file, and then you can use the real XML::Parser.
A few Pivots just whipped up a pivotal-apdex gem that allows you to calculate your application's Apdex performance index via a simple command line tool by parsing Nginx or Apache server logs. Apdex is an emerging standard in measuring application performance. We were inspired by Lew Cirne, CEO of New Relic, who gave a talk about Apdex a few weeks ago at Pivotal's office.
Interesting Things
- memcache-client is broken in the sense that if it fails to connect to your memcached server, it will automatically try a new server. It does this 20 times. Not what one would expect. You can turn off this weird behavior by setting
:failover => false
Ask For Help
- When writing view specs, is there a better way to include your helpers if all helpers are not automatically included in ApplicationController? Some suggestions from the crowd: mock the helpers (test helpers separately), or reopen the template and define helpers there directly.
Interesting Things
Rubymine, just released a new beta revision 856. So far it "seems to work".
When using Object-Mother patterns for creating objects in tests (i.e. Fixjour, FactoryGirl) one gotcha that caused one of our teams some pain was when inadvertently setting an object and object_id for the same association. For example, setting
person = @nateandperson_id = @david.idin the same object creation will cause really weird problems. Our team debugged and solved this by validating object creation ... essentially writing tests for your test objects.Try mapping SHIFT + Space to the underscore character, and save your underscore finger from unnecessary travel.
Interesting Things
Webrat, the acceptance testing framework that is all the rage right now, has a neat lesser-known save_and_open_page command that is helpful for debugging when your tests go wrong. Essentially, this command dumps the current HTML to the browser and lets you inspect the state of the page visually at any point within your test.
Rubymine, Pivotal's favorite Ruby IDE, doesn't really support UTF8. You can type UTF8 characters seemingly fine ... but somewhere along the way it doesn't save properly. Apparently this has been an issue with Rubymine for quite some time. Frustrating.
Ask for Help
- Anyone know a reliable way of CSS regression testing? When we are refactoring CSS or markup, it would be great if there was an automated way to detect visual breakages. Some ideas floating around involve taking screenshots through Webkit's API and comparing them pixel by pixel. This kind of thing has been attempted twice by Pivots without much success. Anybody have a good solution?
Interesting Things
Many thanks to Pivot Josh Susser for his hard work co-coordinating this past weekend's Golden Gate Ruby Conference. We also want to thank our Live Blogging team: Chad, Ryan, Zach, and David -- who all did an excellent job of documenting the event. We also recorded videos of every talk, which will be posted to Talks within a week or so.
Something to be aware of if you are running your production app on EngineYard: Because of their shared disk setup, running disk intensive jobs on your staging environment may affect the performance of your production environment on the same slice. One of our teams ran into severe slowness on production due to tasks running on staging. This problem isn't immediately apparent because of the way the EY storage system is well abstracted for each environment. Submit a ticket to EY support for more details if this is a problem for you.
Ask for Help
- Adam Milligan submitted a patch to Rails a while ago that refactored the implementation of HasOneThroughAssociation. To his severe disappointment, the patch was rejected because the Rails core "doesn't apply refactorings." Adam is asking for help from Pivots and friends to add their comments and support to the patch so hopefully it will be applied to the upcoming Rails 3.0.
