class Pry::History

def push(line)

Returns:
  • (String) - The same line that was passed in

Parameters:
  • line (String) --
def push(line)
  return line if line.empty? || invalid_readline_line?(line)
  begin
    last_line = @history[-1]
  rescue IndexError
    last_line = nil
  end
  return line if line == last_line
  @history << line
  @history_line_count += 1
  @saver.call(line) if !should_ignore?(line) && Pry.config.history_save
  line
end