Joe Moore's blog
Standup 05/24/2007
Interesting Things
- We're looking for the best search plugins for Trac. Suggestions?
- Rails: We often find ourselves adding
and returnin our Controllers to avoid the dreadedDoubleRenderError. It turns out that you can useunless performed?instead:
<code> def double_rendering_action render :template => "wrangler/monkey" if wrangle_monkey? render :template => "wrangler/sleep" unless performed? end </code>
- Textmate Footnotes Plugin in Ruby on Rails will give you hyperlinked error messages that will open TextMate the the appropriate line of code.
- We've released our distributed page caching solution on the Pivotal RubyForge project!
Standup 05/23/2007
Interesting Things
Some projects are playing with the Mocha mocking framework. From their site:
Mocha is a library for mocking and stubbing using a syntax like that of JMock, and SchMock. Most commonly Mocha is used in conjunction with Test::Unit, but it can be used in other contexts.
Our own Nathan Sobo has released Treetop 0.1.0:
Treetop is a Ruby-based DSL for text parsing and interpretation. It facilitates an extension of the object-oriented paradigm called syntax-oriented programming.
- Jeff from Inveneo presented us with a tech-talk recently about the technology they are bringing to rural and remote communities throughout the world. Fascinating stuff. A group here has volunteered to help write some software if needed.
Ask for Help
- "Are there problems getting Rspec mocks to 'reset' for each spec run?" Mocks persist across test/spec runs for class methods, so watch out.
- "My routes arn't working..." Remember that Rails routes are positional, which means that they are matched top-to-bottom; changing the position seemed to be the fix in this case.
Standup 05/22/2007
Interesting Things
- We are hosting a Geek Session tonight at SF Beta. Tickets are going fast.
Standup 05/21/2007
Interesting Things
- Rails gotcha: with ActiveRecord.findXXX, you can specify query parameters such as
:group_by,:limit, and:include. But if you use those three together Rails will generate an incorrect query. - Rspec 1.0 has been released.
Ask for Help
*"Can you use the Venkman Javascript Debugger to debug programatically-loaded JS, files that are actually hosted by a 3rd party, such as Yahoo!?" We don't think so, but if anyone in the community has an answer, let us know.
Standup 05/17/2007
Interesting Things
- Yahoo's Geolocation service is broken after they released a new version if their code. Zip code searching in particular significantly broken -- discussion thread here: http://tech.groups.yahoo.com/group/yws-maps/message/5468 -- here is an example:
- Search for a zip code using the following URL: http://local.yahooapis.com/MapsService/V1/geocode?appid=YahooDemo&location=94102
- Result (notice the bad State and Zip tags):
<code>
<\?xml version="1.0"?>
<\ResultSet xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:yahoo:maps"
xsi:schemaLocation="urn:yahoo:maps http://api.local.yahoo.com/MapsService/V1/GeocodeResponse.xsd">
<\Result precision="zip">
<\Latitude>37.779411
<\Longitude>-122.417740
<\Address>
<\City>San Francisco, CA 94102
<\State>United States
<\Zip>
<\Country>US
<\/Result>
<\/ResultSet>
<\!-- ws05.search.re2.yahoo.com compressed/chunked Thu May 17 15:02:00 PDT 2007 -->
</code>
UPDATE This is fixed! Thanks, Yahoo!
Standup 05/16/2007
Interesting Things
- We've set up a Pivotal Rubyforge Project! Keep an eye out for code from us.
Standup 05/15/2007
Ask for Help
- "Does anyone have recommendations for browser-embedded WSIWIG text editors?" The #1 recommendation is TinyMCE, followed by FKEditor
- "Rails cached-pages sweepers are causing a
nil.controller_name_error deep in the rails framework..." We 'fixed' this with a variation of this patch: http://dev.rubyonrails.org/ticket/6199
Standup 05/10/2007
Interesting Things
- Several folks here are looking at Merb (Mongrel with ERB) as a light-weight alternative to Rails for certain targeted usages. We'll be sure and attend the Merb hack-fest at Rails Conf.
- Debian MySQL pain: if your MySQL Client and Server versions do not match, MySQL behave badly, reporting that it cannot find UTF-8 support.
Ask for Help
- "Can you terminate an AJAX request?" The answer is "kinda". XMLHttpRequest has an
abort()method will terminates the request in the browser and prevents any callbacks from being invoked. But, your server might still be chugging away on the requested action.
Standup 05/09/2007
Interesting Things
- Hpricot versions 0.4 and 0.5.x are causing us Segmentation faults. Why, Why?
- Rails gotcha: Rails' automatically generated finder methods will not work properly if you have a class name with the word 'And' in it. For example, a RentalCarCompany might have many CarsAndTruck. You will have problems if you try to call
RentalCarCompany.find_by_cars_and_truck_idsbecause the_and_is reserved for methods such as find_by_name_and_address.
Standup 05/08/2007
Interesting Things
If you are missing the Rspec gem, you specs will fail silently. It's a good way waste a few hours trying to figure out what's wrong.







