From: daz Date: 2003-06-02T13:42:56+09:00 Subject: Re: Interactive programming "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 Important: If you never run Ruby under Windows, skip this post! DOS shell is rubbish, I use it as a last resort and fear the sight of a DOS box when it flashes up because it's going to close before I get to reading what was in it. I use Ruby Development Environment http://raa.ruby-lang.org/list.rhtml?name=rde + EnglishA.xml language file (while you're there) It's easy to run irb from within it ... http://www.rubygarden.org/ruby?RubyDevelopmentEnvironmentExtensions .... but it's hardly necessary because I keep a tabbed page open (usually called Blank{n} - no need to think of a name or where to save it), type (e.g.) p 6 + 4 hit F5, and the result is displayed in the output window. If I'm running a script that produces an output file, that file can be open in another page and if it has changed since the last time, RDE asks if I want to reload it. Click YES and there's the updated output from the script I just ran. I can have several scripts "in progress", cut and paste chunks from one to another etc. and test bits before "committing". If someone posts an irb script, I can copy it into an edit page and use the RDE RunBy facility to convert it with this Ruby snippet: ARGF.each{|lin| if lin =~ /\s*irb\(\w+\):\d{3}:\S+\s/ print $' else print '#.->', lin end } I don't really need it to be any easier than that. No doubt there are some slick Vi(m) / Emacs setups out there and I like the FreeRIDE project's aims and values: http://www.rubyide.org/cgi-bin/wiki.pl Irb is brilliant, and I don't think I would have stayed with Ruby had it not been available at the start but IMHO, it's not for coding with. daz