From: Chris Morris Date: 2003-03-31T23:29:12+09:00 Subject: Re: Saving code written during an irb session > # Output irb history to named file > def dumphist(path="irb.log") > File.open(path, 'w') do |file| > Readline::HISTORY.each do |line| > file.puts line unless /^\s*dumphist/ =~ line > end > end > end Is Readline a 1.8 thing? D:\ruby\bin>more .irbrc # Output irb history to named file def dumphist(path="irb.log") File.open(path, 'w') do |file| Readline::HISTORY.each do |line| file.puts line unless /^\s*dumphist/ =~ line end end end D:\ruby\bin>irb irb(main):001:0> puts VERSION 1.6.6 nil irb(main):002:0> dumphist NameError: uninitialized constant Readline from ./.irbrc:4:in `dumphist' from ./.irbrc:3:in `open' from ./.irbrc:3:in `dumphist' from (irb):2 Chris http://clabs.org