Module: Ripl::Hijack

Defined in:
lib/ripl/hijack.rb

Constant Summary collapse

VERSION =
'0.1.0'

Instance Method Summary collapse

Instance Method Details

#after_loopObject



22
23
24
# File 'lib/ripl/hijack.rb', line 22

def after_loop
 Hijack::Console.remote.evaluate('__hijack_exit') rescue nil
end

#before_loopObject



16
17
18
19
20
# File 'lib/ripl/hijack.rb', line 16

def before_loop
  Hijack.start(config[:hijack_pid], config[:hijack_options])
  @binding = loop_eval("self").instance_eval { binding }
  super
end

#loop_eval(str) ⇒ Object



26
27
28
29
30
# File 'lib/ripl/hijack.rb', line 26

def loop_eval(str)
  (helper = Hijack::Helper.find_helper(str)) ?
    Hijack::Helper.send(helper, Hijack::Console.remote) :
    Hijack::Console.remote.evaluate(str)
end