Method: Muby::InputWindow#loadHistory

Defined in:
lib/muby/inputwindow.rb

#loadHistoryObject

Load our history from the history file.



134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
# File 'lib/muby/inputwindow.rb', line 134

def loadHistory
  begin
    if FileTest.readable?(conf.history_file)
      info("Reading #{conf.history_file}")
      Kernel::open(conf.history_file) do |input|
        @history = Marshal.load(input.read)
      end
      @history.each do |line|
        Muby::Completer.get_instance.store(line)
      end if conf.feed_completer_with_history
    end
  rescue Exception => e
    exception(e)
  end
  @history ||= []
end