Sha256: f103b9afe77d5ef81a391aea84ccc2f7140e46b1bfe548ab6c3951504400a4d8
Contents?: true
Size: 520 Bytes
Versions: 12
Compression:
Stored size: 520 Bytes
Contents
module Qcmd class History class << self attr_accessor :commands def load if File.exists?(Qcmd::Configuration.history_file) lines = File.new(Qcmd::Configuration.history_file, 'r').readlines else lines = [] end if lines lines.reverse[0..100].reverse.each {|hist| Readline::HISTORY.push(hist) } end end def push command Qcmd::Configuration.history.puts command end end end end
Version data entries
12 entries across 12 versions & 1 rubygems