$ gem install guessmethod -y
$ irb
> require 'rubygems'
> require 'guessmethod'
> class Object; include GuessMethod; end # though this could go in the guessmethod.rb file in the gem
> class Product; def name; "Some product"; end; end
> Prodct.nw.nae
attention: replacing non-existant constant Prodct with Product for Objectattention: sending new instead of nw to Product:Classattention: sending name instead of nae to #<Product:0x144ff10>:Product
=> "Some product"
That’s going straight into my .irbrc file. My bad spelling, coupled with my British/Australian English, will never slow me down again!
UPDATE: actually, it doesn’t like being in the .irbrc file for Rails console; so in the config/environments/development.rb files will have to do for the moment.
Now you can create an account on my site using OpenID and never have to fill all that crap in again.
UPDATE: See comments below for how to use your blog domain name/url as your OpenID url. As it is this url that is appearing below people’s names, and that’s not what you want. That is, I can use drnicwilliams.com as my OpenID, even though it is actually http://drnicwilliams.myopenid.com/.
You can check that you’ve setup up your blog as your OpenID with this helper site.
I’ve been a fan of Ryan Davis‘ (zenspider) and Eric Hodel‘ ZenTest library (including its autotest CI tool for rails and gems), and their Hoe gem, the Rubyforge gem, etc ever since I figured out what they did. (Side note: how to setup rubyforge gem)
Over the last month, Ryan mentioned “functional testing by a matrix” in fourgreatblogarticles.
Ryan shows this off at RejectConf; its 16 minutes but definitely worth your time to investigate, as I think this will be awesome for ensuring basic edge cases are thoroughly tested. Can a guest create something? Can a member delete something?
It is hard to see the code on the screen, but look at the blog posts linked above to get the gist of what is being shown.
People were really interested this as you can tell by the huge number of questions, despite this being the last of many many presentations.
This stuff looks primed for a sweet generator to create the test file.
ActsAsReadonlyable adds support of multiple read-only slave databases to ActiveRecord models. When a model is marked with acts_as_readonlyable, some of AR finders are overridden to run against a slave DB. The supported finders are find, find_by_sql, count_by_sql, find_[all_]by_*, and reload.