From: Gavin Sinclair Date: 2003-03-30T22:08:07+09:00 Subject: Re: Saving code written during an irb session On Sunday, March 30, 2003, 10:31:55 PM, Bil wrote: > OK, so I admit: I'm stupid. How do I save the code I've generated > during an irb session? You're not (necessarily) stupid. irb has no obvious code export feature. And I can't give you a real answer, but since it's a low-traffic time, I'll try to point you in a helpful direction. If you search the list for 'irb' and 'history', you should find something in the last two months about how you can access irb's history programatically from within irb. If you can work out how to do that (perhaps it's even in the docs?, after all, it just uses readline), then you can write a method that writes the entire history to the named file. Put that method in your ~/.irbrc file, and it will be accessible from the irb prompt. Cheers, Gavin