Michael C. Libby wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Is there any way in irb to capture all of my input lines? I love to try 
> stuff out in there, but it gets really annoying copying out my work from 
> the sample output and all that. Anyway at the end of an irb session to 
> type in some command and have it spit out a full history into a string or 
> a file?

This will put your input in a string which you can access from the 
global var $lns:

module Readline

   alias old_readline readline

   def readline(*args,&block)
     # "&block" just because I don't know if it takes a block
     ln = old_readline(*args,&block)
     $lns ||= ""
     $lns << ln + "\n" if ln
     ln
   end

end