Class: InteractiveS3::History
- Inherits:
-
Object
- Object
- InteractiveS3::History
- Defined in:
- lib/interactive_s3/history.rb
Constant Summary collapse
- HISTORY_FILE =
"#{Dir.home}/.is3_history"
- HISTORY_SIZE =
500
Instance Method Summary collapse
Instance Method Details
#load ⇒ Object
6 7 8 9 10 11 12 |
# File 'lib/interactive_s3/history.rb', line 6 def load if file_exist? File.read(file_path).each_line do |line| Readline::HISTORY << line.chomp end end end |
#save ⇒ Object
14 15 16 |
# File 'lib/interactive_s3/history.rb', line 14 def save File.write(file_path, Readline::HISTORY.to_a.last(history_size).join("\n")) end |