# File lib/hammer_cli/shell.rb, line 42 def initialize(history_file_path) @file_path = history_file_path load end
# File lib/hammer_cli/shell.rb, line 57 def ingonred_commands ["exit"] end
# File lib/hammer_cli/shell.rb, line 47 def push(line) line.strip! return if line.empty? or ingonred_commands.include?(line) Readline::HISTORY.push(line) File.open(file_path, "a") do |f| f.puts(line) end end
# File lib/hammer_cli/shell.rb, line 63 def file_path File.expand_path(@file_path) end
# File lib/hammer_cli/shell.rb, line 67 def load if File.exist?(file_path) File.readlines(file_path).each do |line| Readline::HISTORY.push(line.strip) end end end