Chris Heisterkamp's blog
Interesting Things
A few projects are using parallel_test to speed up their tests/specs. One project has had the best results by running one less parallel spec than the number of cores on the machine, unless of course you only have one core.
Another team discovered an odd bug in RubyMine where they could not click-through "require spec" or run specs if their project had code in vendor/plugins that extended ActiveRecord::Base. Here is the RubyMine ticket they filed.
Finally, it looks like a Linux machine running Ruby 1.8.6 patch 287 had rounding errors when using the ActiveSupport helpers for 2.days.ago. They fixed the issue by upgrading to Ruby 1.8.7
Interesting Things
One project had trouble installing the Rails 2.3.3 with the most recent version of Rubygems (1.3.5) on a Gentoo box (EY Solo instance). Installing the gem on an OSX box worked fine with the same versions. No obvious solution presented itself, other than to roll back to Rubygems version 1.3.1.
If you do update your Rubygems version to 1.3.5 and you use Geminstaller you must update your Geminstaller gem to 0.5.2; Rubygems made some changes that break Geminstaller's implementation. If you use an older version of Rubygems then keep using Geminstaller 0.5.1.
One project wanted to find all places where they needed to escape user input on their site, so they injected
<script>alert('foo');</script>into every text field in the database, ran through their site, and looked for every place that a pop up box appeared.
Interesting Things
RailsBridge is organizing a global BugMash to help knock down some of the bugs on the Rails lighthouse this weekend. If your interested in helping out there is more information on their wiki
We started using JRuby for a project and wanted to use JRuby to run our specs. If you install RSpec 1.2.7 or higher you can specify the ruby command used to run your SpecTask in rspec.rake like this:
desc "Run all specs in spec directory (excluding plugin specs)"
Spec::Rake::SpecTask.new(:spec) do |t|
t.spec_opts = ['--options', "\"#{File.dirname(__FILE__)}/../../spec/spec.opts\""]
t.spec_files = FileList['spec/**/*/*_spec.rb']
t.ruby_cmd = 'jruby'
end
Interesting Things
We discovered a bug in the load order of CGI extensions in ActionController in Rails 2.3.3. The body of the first request to a Mongrel server after loading the Rails environment will appear empty, even if it's not. The problem is the default CGI::QueryExtension#initialize_query in the Ruby standard library will read the stdinput stream and not rewind it. As a result, future reads of stdinput look empty. In Rails, this behavior is overridden in action_controller/cgi_ext/query_extension.rb. Unfortunately this file isn't loaded until after the first request to a new server, at which point subsequent requests work normally. The Rails ticket is here.
The easiest fix is to require "action_controller/cgi_ext" in your environment file or an initializer file.
Interesting Things
- If you're on Rails 2.3+ you can use NestedScenarios instead of FixtureScenarios and FixtureScenarioBuilder and your life will be better.
Ask for Help
The Pre Dev Camp in San Francisco is looking for a home this weekend. If you have a location you can donate that can hold about 150 people with laptops, has power and wifi, please contact the organizer, Luke Kilpatri at (650) 745-5302 or luke@lukek.ca
"Does anyone have experience, good or bad, with RJB (the Ruby to Java bridge)?" General consensus was murmur murmur murmur no.
