Is there any way to save current job to a file in irb?

Or is there any tool to take place of it?

Kuang D. wrote:

Or is there any tool to take place of it?

  1. Please put your message in your message, rather than in the subject
    line.

  2. Have you considered using a text editor to create a Ruby source file?
    It
    is way more efficient than trying to create a program in irb, then
    losing
    it.

“irb” is meant for testing things, not writing computer programs. As
soon as
you find yourself entering “do” or “{” into irb, it is time to open a
text
editor.

Kuang D. wrote:

Or is there any tool to take place of it?

You can put this in your .irbrc:

def dump_history(file=nil)
if file
File.open(file, “w”) do |f|
f.puts IRB::ReadlineInputMethod::HISTORY.to_a
end
else
puts IRB::ReadlineInputMethod::HISTORY.to_a
end
end

Kuang D. wrote:

Or is there any tool to take place of it?

I use SCITE to test program fragments and can then save the code.

Michael W. Ryder wrote:

Kuang D. wrote:

Or is there any tool to take place of it?

I use SCITE to test program fragments and can then save the code.

There’s this, also

http://irb-history.rubyforge.org/rdoc/