Module: Ripl::Rc::SqueezeHistory
- Includes:
- U
- Defined in:
- lib/ripl/rc/squeeze_history.rb
Defined Under Namespace
Modules: Imp
Instance Method Summary collapse
-
#eval_input(input) ⇒ Object
squeeze history on memory too.
-
#write_history ⇒ Object
write squeezed history.
Methods included from U
Methods included from Imp
Methods included from Ripl::Rc::StripBacktrace::Imp
#cwd, #home, #snip, #strip_backtrace
Methods included from Anchor::Imp
Methods included from Color::Imp
#black, #blue, #color, #colors, #cyan, #find_color, #green, #magenta, #red, #reset, #white, #yellow
Instance Method Details
#eval_input(input) ⇒ Object
squeeze history on memory too
15 16 17 18 19 20 21 |
# File 'lib/ripl/rc/squeeze_history.rb', line 15 def eval_input input return super if SqueezeHistory.disabled? history.pop if input.strip == '' || (history.size > 1 && input == history.to_a[-2]) # EditLine is really broken, to_a is needed for it super end |
#write_history ⇒ Object
write squeezed history
8 9 10 11 12 |
# File 'lib/ripl/rc/squeeze_history.rb', line 8 def write_history return super if SqueezeHistory.disabled? @history = [U.squeeze_history(history).join("\n") + "\n"] super end |