- loading...
Magic Wiggly Lines => GuessMethod, by Chris Shea
If you ever make time to code just for pleasure, then method_missing and const_missing are just begging for abuse.
Chris Shea has come up with GuessMethod – a very cool hack that now deprecates my concept of Magic Wiggly Lines – a spell-checker for runtime code.
What’s it do? Cop a squiz at this genius…
$ 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 Object attention: sending new instead of nw to Product:Class attention: 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.