I started playing with MacRuby this evening. macirb wouldn’t run with my customized .irbrc and gave the following error:
/usr/local/bin/macirb:60:in `block': No such file or directory - open() failed (Errno::ENOENT)
from /usr/local/bin/macirb:9:in `block'
from /usr/local/bin/macirb:7:in `<main>'
Continue reading “MacRuby tweaks to your customized .irbrc”
Okay, now that Bundler 1.0.0.beta.10 is out, you can once again pass build-time options to gems with native extensions, such as Nokogiri. So this supercedes my older instructions for making Bundler 0.8.5 install Nokogiri on Leopard.
So now instead of making a YAML file and referring to it, pass the options like this:
bundle config build.nokogiri \
Kent Beck tweeted:
User story: “As a princess I want to confirm my royalty so I get bruised after sleeping on 40 mattresses over a pea”. Just tell real stories”
That sounded so much like a Cucumber feature that I decided to write it as one:
Feature: Physical Sensitivity
In order to confirm my royalty
As a princess
I want to be very delicate
Scenario: 40 mattresses on a pea
Given there is a pea on the bed
And there is a stack of 20 mattresses on the pea
And there is a stack of 20 featherbeds on the mattresses
When I try to sleep on top of the stack of featherbeds
Then I should not be able to sleep
If you’ve tried to use Machinist and autotest (part of ZenTest) you have probably seen this exception that prevented you from using it:
`method_missing': No sham defined for name
It’s discussed in the machinist Google Group as well.
It’s because of a wacky hack that’s part of Machinist that overrides Module.name so you can do
Sham.name, but ZenTest expects Module.name to do what it does normally.
I have a fix for this.
Continue reading “How to make Machinist and Autotest coexist”
Migrations are one of the best features of Rails. Although some folks prefer pure SQL rather than Rails migration DSL, I don’t know of anyone who dislikes the idea of a versioned schema that can evolve in a controlled and repeatable fashion.
But because the concept of database migrations is such a powerful one, it’s tempting to jam any old change that affects the database into a new migration and run
rake db:migrate to make it happen. I’ve been guilty of a bit of this in the past, and I’ve joined some projects that did other ugly things in migrations. In the process I’ve learned the hard way that there are some things you must never do in a migration or they will come back to haunt you later. Here they are.
Continue reading “Rails Migration Antipatterns and How To Fix Them”