Class Pry::History
In: lib/pry/history.rb
Parent: Object

The History class is responsible for maintaining the user‘s input history, both internally and within Readline.

Methods

<<   clear   load   new   push   restore_default_behavior   save   to_a  

Attributes

clearer  [RW] 
loader  [RW] 
pusher  [RW] 
saver  [RW] 

Public Class methods

Public Instance methods

<<(line)

Alias for push

Clear all history. Anything the user entered before this point won‘t be saved, but anything they put in afterwards will still be appended to the history file on exit.

Load the input history using `History.loader`. @return [Integer] The number of lines loaded

Add a line to the input history, ignoring blank and duplicate lines. @param [String] line @return [String] The same line that was passed in

Assign the default methods for loading, saving, pushing, and clearing.

Write this session‘s history using `History.saver`. @return [Integer] The number of lines saved

Return an Array containing all stored history. @return [Array<String>] An Array containing all lines of history loaded

  or entered by the user in the current session.

[Validate]