From d62ab8891f3f2585160483c9bcfa752a8e5b3f8e Mon Sep 17 00:00:00 2001 From: yui-knk Date: Tue, 1 Apr 2014 08:21:31 +0900 Subject: [PATCH] Fix bug when used with pry-remote(drb environment). See https://github.com/Mon-Ouie/pry-remote/issues/49 . When we translate Proc object with drb, proc is wrapped with DRbObject. In this case defined? proc.call is not delegated to proc self. But proc.respond_to? :call is delegated to proc self. So here it is better to check `proc.respond_to? :call`. --- lib/readline.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/readline.rb b/lib/readline.rb index a835f07..0152448 100644 --- a/lib/readline.rb +++ b/lib/readline.rb @@ -89,7 +89,7 @@ def self.line_buffer # Readline.completion_proc = proc{ |s| list.grep( /^#{Regexp.escape(s)}/) } # def self.completion_proc=(proc) - unless defined? proc.call + unless proc.respond_to? :call raise ArgumentError,"argument must respond to `call'" end @completion_proc = proc