1
0
Fork 0
mirror of https://github.com/pry/pry.git synced 2022-11-09 12:35:05 -05:00

Don't start bond unless it's loaded

This commit is contained in:
Conrad Irwin 2012-11-18 03:24:10 -08:00
parent b1028e2935
commit a15d134e60

View file

@ -5,16 +5,23 @@ class Pry
module BondCompleter
def self.build_completion_proc(target, pry=nil, commands=[""])
if !@started
@started = true
start
end
Pry.th[:pry] = pry
proc{ |*a| Bond.agent.call(*a) }
end
Bond.start(:eval_binding => lambda{ Pry.th[:pry].current_context })
Bond.complete(:on => /\A/) do |input|
Pry.commands.complete(input.line,
:pry_instance => Pry.th[:pry],
:target => Pry.th[:pry].current_context,
:command_set => Pry.th[:pry].commands)
def self.start
Bond.start(:eval_binding => lambda{ Pry.th[:pry].current_context })
Bond.complete(:on => /\A/) do |input|
Pry.commands.complete(input.line,
:pry_instance => Pry.th[:pry],
:target => Pry.th[:pry].current_context,
:command_set => Pry.th[:pry].commands)
end
end
end