Sha256: ae777249f90fd7be497dfa4949b41035131e44dea619a205a8f3416f3c0548ad

Contents?: true

Size: 403 Bytes

Versions: 2

Compression:

Stored size: 403 Bytes

Contents

require 'ripl'

module Ripl::Record
  def after_loop
    super
    saved_history = Array(history)
    saved_history.pop if Ripl::Shell::EXIT_WORDS.include?(saved_history[-1])
    saved_history = saved_history.reverse.slice(0, @line - 1).reverse
    File.open(config[:play], 'w') {|f| f.write saved_history.join("\n") }
  end
end

Ripl::Shell.send :include, Ripl::Record
Ripl.config[:play] = 'ripl_tape'

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ripl-play-0.2.0 lib/ripl/record.rb
ripl-play-0.1.1 lib/ripl/record.rb