Flowdock
method

create_finalizer

Importance_0
v1_8_7_72 - Show latest stable - 0 notes - Class: IRB::HistorySavingAbility
create_finalizer() public

No documentation

This method has no description. You can help the Ruby community by adding new notes.

Hide source
# File lib/irb/ext/save-history.rb, line 53
    def HistorySavingAbility.create_finalizer
      proc do
        if num = IRB.conf[:SAVE_HISTORY] and (num = num.to_i) > 0
          if hf = IRB.conf[:HISTORY_FILE]
            file = File.expand_path(hf)
          end
          file = IRB.rc_file("_history") unless file
          open(file, 'w' ) do |f|
            hist = HISTORY.to_a
            f.puts(hist[-num..-1] || hist)
          end
        end
      end
    end
Register or log in to add new notes.