module Pry::BondCompleter

Public Class Methods

build_completion_proc(target, pry=nil, commands=[""]) click to toggle source
# File lib/pry/completion.rb, line 7
def self.build_completion_proc(target, pry=nil, commands=[""])
  if !@started
    @started = true
    start
  end

  Pry.current[:pry] = pry
  proc{ |*a| Bond.agent.call(*a) }
end
start() click to toggle source
# File lib/pry/completion.rb, line 17
def self.start
  Bond.start(:eval_binding => lambda{ Pry.current[:pry].current_context })
  Bond.complete(:on => /\A/) do |input|
    Pry.commands.complete(input.line,
                         :pry_instance => Pry.current[:pry],
                         :target       => Pry.current[:pry].current_context,
                         :command_set  => Pry.current[:pry].commands)
  end
end