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:
parent
b1028e2935
commit
a15d134e60
1 changed files with 13 additions and 6 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue