Module: Ripl::Record

Defined in:
lib/ripl/record.rb

Instance Method Summary collapse

Instance Method Details

#after_loopObject



4
5
6
7
8
9
10
# File 'lib/ripl/record.rb', line 4

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