irb history on ruby 1.8.6

gmarik 1 min

Somehow got irb history broken.

Googling brought a solution

Here’s the simplified version of the fix I’ve came with:

module IRB
  def HistorySavingAbility.extended(obj); 
    Kernel.at_exit{ HistorySavingAbility.create_finalizer.call }
    obj.load_history
    obj
  end
end 

Put it into .irbrc

Turns out that finalizer is not guaranteed to run, so Kernetl.at_exit hook should be used instead, to persist history

Read More
building ruby 1.8.6 with openssl 1 on Arch
buildin rmagick gem and how to avoid memory leak
Comments
read or add one↓