Module: Ripl::Hooks

Defined in:
lib/ripl/shell.rb

Instance Method Summary collapse

Instance Method Details

#after_loopObject



63
# File 'lib/ripl/shell.rb', line 63

def after_loop; end

#before_loopObject



53
54
55
56
57
# File 'lib/ripl/shell.rb', line 53

def before_loop
  load @irbrc if @irbrc && File.exists?(File.expand_path(@irbrc))
rescue StandardError, SyntaxError
  warn "Error while loading #{@irbrc}:\n"+ format_error($!)
end

#loop_eval(str) ⇒ Object



59
60
61
# File 'lib/ripl/shell.rb', line 59

def loop_eval(str)
  eval('_ = '+str, @binding, "(#{@name})", @line)
end