Class: Pry::History

Inherits:
Object
  • Object
show all
Defined in:
lib/yadriggy/source_code.rb

Overview

Log.

Instance Method Summary collapse

Instance Method Details

#push(line) ⇒ Object Also known as: <<

Records a line. We modify the original Pry::History::push to record a duplicated line as well.

Parameters:

  • line (String)

    an input.



13
14
15
16
17
18
19
20
21
22
# File 'lib/yadriggy/source_code.rb', line 13

def push(line)
  unless line.empty? || line.include?("\0")
    @pusher.call(line)
    @history << line
    if !should_ignore?(line) && Pry.config.history.should_save
      @saver.call(line)
    end
  end
  line
end