From: Eric Hodel Date: 2006-12-06T05:28:20+09:00 Subject: Re: "Filing out" irb prototyping sessions? On Dec 5, 2006, at 12:15 , Griff wrote: > Hi folks, > > It looks like you can use irb as a rapid prototyping environment by > combining ability to bind to objects and modify them, utilize tab > completion, and of course interact/prototype with these objects you > are > manipulating. > > Suppose you prototype some things and would like to "file out" your > changes to Ruby code so that you could easily reference your ideas. > > Is there some way to easily file out object definitions from an irb > session? Courtesy Ryan Davis: first: gem install ruby2ruby require 'rubygems' require 'discover' require 'ruby2ruby' $old_classes = discover_classes def saveirb (discover_classes - $old_classes).each do |klass| puts RubyToRuby.translate(klass) end end -- Eric Hodel - drbrain@segment7.net - http://blog.segment7.net I LIT YOUR GEM ON FIRE!