From: ahoward Date: 2003-06-02T14:03:03+09:00 Subject: Re: Interactive programming On Mon, 1 Jun 2003, Jason Watkins wrote: > Just out of curiousity, how often do you find yourself: > > 1.) Write ruby in the interactive interpreter > 2.) Write ruby in files, occasionally calling the interpreter from a shell > to test your code i always have an irb window open, but code in files (sometimes i even have tests! ;-) ) mostly i do stuff like this in the irb window: > require 'postgres' > PGConn.new # oops error > PGconn.new # ah yes - that's how it's spelled also i often do this > require 'rbtree' > (RBTree.new.methods - Object.new.methods).sort or > object.methods > object.constants or > class Foo; FOO = 42; end > class Bar < Foo; end > Bar::FOO # does this work? or sometimes > require 'class_in_progress' > ClassInProgress.method args # repeat these two many times... instead of using the 'if $0 == __FILE__' bit... you get the idea. i also do a lot of database manipulate in irb instead of the native rdbms shell... in summary - i love irb. -a -- ==================================== | Ara Howard | NOAA Forecast Systems Laboratory | Information and Technology Services | Data Systems Group | R/FST 325 Broadway | Boulder, CO 80305-3328 | Email: ara.t.howard@noaa.gov | Phone: 303-497-7238 | Fax: 303-497-7259 | ~ > ruby -e 'p % ^) .intern' ====================================