remove attempt at bond support from pry and move to `pry-bond` project.
https://github.com/johnny5-/pry-bond project adds the enable-bond! and disable-bond! commands, as well as other features, that enhance the pry&bond experience and make it easier to use and setup without a manual effort. see #1165 closes #1160
This commit is contained in:
parent
fe3ae6194d
commit
1c6a145ba7
1
Gemfile
1
Gemfile
|
@ -17,7 +17,6 @@ end
|
|||
|
||||
group :development, :test do
|
||||
gem 'simplecov', '~> 0.8'
|
||||
gem 'bond', '~> 0.5'
|
||||
end
|
||||
|
||||
platform :rbx do
|
||||
|
|
|
@ -1,17 +0,0 @@
|
|||
module Pry::BondCompleter
|
||||
def self.call(input, options)
|
||||
Pry.current[:pry] = options[:pry]
|
||||
Bond.agent.call(input)
|
||||
end
|
||||
|
||||
def self.start
|
||||
Bond.start(:eval_binding => lambda{ Pry.current[:pry] && 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
|
||||
self
|
||||
end
|
||||
end
|
|
@ -35,7 +35,10 @@ class Pry::Config::Default
|
|||
:extra_sticky_locals => proc { {} },
|
||||
:command_completions => proc { proc { commands.keys } },
|
||||
:file_completions => proc { proc { Dir["."] } },
|
||||
:completer => proc { lazy_completer }
|
||||
:completer => proc {
|
||||
require "pry/input_completer"
|
||||
Pry::InputCompleter.start
|
||||
}
|
||||
}
|
||||
|
||||
def initialize
|
||||
|
@ -113,16 +116,6 @@ private
|
|||
raise
|
||||
end
|
||||
|
||||
def lazy_completer
|
||||
if defined?(Bond) && !is_editline?(input)
|
||||
require "pry/bond_completer" unless defined?(Pry::BondCompleter)
|
||||
Pry::BondCompleter.start
|
||||
else
|
||||
require "pry/input_completer" unless defined?(Pry::InputCompleter)
|
||||
Pry::InputCompleter.start
|
||||
end
|
||||
end
|
||||
|
||||
def is_editline?(input)
|
||||
defined?(input::VERSION) && input::VERSION =~ /editline/i
|
||||
end
|
||||
|
|
|
@ -5,24 +5,6 @@ def completer_test(bind, pry=nil, assert_flag=true)
|
|||
Pry::InputCompleter.call(symbol[0..-2], :target => Pry.binding_for(bind), :pry => pry).include?(symbol).should == assert_flag}
|
||||
return proc {|*symbols| symbols.each(&test) }
|
||||
end
|
||||
|
||||
require "pry/bond_completer"
|
||||
describe Pry::BondCompleter do
|
||||
before do
|
||||
@local = Pry::Config.new Pry::Config::Default.new
|
||||
@local.completer
|
||||
end
|
||||
|
||||
it "should use Bond if it's available" do
|
||||
if defined?(Bond) && defined?(Readline) && Readline::VERSION !~ /editline/i
|
||||
@local.completer.should == Pry::BondCompleter
|
||||
else
|
||||
@local.completer.should == Pry::InputCompleter
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
require "pry/input_completer"
|
||||
describe Pry::InputCompleter do
|
||||
before do
|
||||
|
|
Loading…
Reference in New Issue