Flowdock
method

create_finalizer

Importance_0
Ruby latest stable (v2_5_5) - 0 notes - Class: IRB::HistorySavingAbility

Method deprecated or moved

This method is deprecated or moved on the latest stable version. The last existing version (v1_8_7_72) is shown here.

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.