Points of Interest
class Thing def foo def bar(args) # some code end # some code that calls bar() end end
The structure of this code suggests that
baris scoped only within
the context of
foo. But alas, that is not the case. Ruby simply
Thing#barthe first time
foois called, analogous to
define_method :bar. Misleading syntax, for sure.
Ryan Davis‘s Flay is awesome. If you’re not
familiar with it, Flay parses your Ruby and compares subtrees with
each other to find where code has been duplicated (or nearly so).
Run on a codebase of over 20,000 lines of Ruby, Flay was able to
quickly indicate places where we had duplicate code lying around, as
well as many likely targets for refactoring work. We’ve found it to
be helpful in keeping code DRY.
In Snow Leopard, mapping CapsLock => Ctrl when two keyboards are
plugged in is problematic. You can do it by plugging in one keyboard
at a time and mapping each one individually. If anyone knows the
story behind why this is, or how to deal more easily, please comment!
Another lesson learned the hard way: starting up a bunch of leopard
machines at the same time wreaks havoc on the network for a few
minutes. Packet storm, dropped packets, etc. Is Bonjour to blame?
Inquiring minds want to know.
If you’re trying to stub a subclass of
Double Ruby (also known as RR), and you’re having issues, try
stubbing the method on
ActionMailer::Basedirectly. There’s some
weirdness there with
method_missingin Rails 2.3.
Does anyone know how to make
tabs inside of
Term.app? By default, these keys are bound to
switching windows, and we’d love to be able to do this on tabs
select_tag(..., :multiple => true)option doesn’t properly
selectedon the generated options. This appears to be a boog,
and anyone who’s interested in helping a Pivot write a patch, please