[前][次][番号順一覧][スレッド一覧]

ruby-changes:61249

From: aycabta <ko1@a...>
Date: Thu, 14 May 2020 13:35:25 +0900 (JST)
Subject: [ruby-changes:61249] 68a7c8ad57 (master): Reline callbacks can take nil

https://git.ruby-lang.org/ruby.git/commit/?id=68a7c8ad57

From 68a7c8ad5781ecfa12cf7b512b5745ba1a78bdcd Mon Sep 17 00:00:00 2001
From: aycabta <aycabta@g...>
Date: Wed, 13 May 2020 07:21:44 +0900
Subject: Reline callbacks can take nil


diff --git a/lib/reline.rb b/lib/reline.rb
index 1537ee7..91863eb 100644
--- a/lib/reline.rb
+++ b/lib/reline.rb
@@ -98,22 +98,22 @@ module Reline https://github.com/ruby/ruby/blob/trunk/lib/reline.rb#L98
     end
 
     def completion_proc=(p)
-      raise ArgumentError unless p.respond_to?(:call)
+      raise ArgumentError unless p.respond_to?(:call) or p.nil?
       @completion_proc = p
     end
 
     def output_modifier_proc=(p)
-      raise ArgumentError unless p.respond_to?(:call)
+      raise ArgumentError unless p.respond_to?(:call) or p.nil?
       @output_modifier_proc = p
     end
 
     def prompt_proc=(p)
-      raise ArgumentError unless p.respond_to?(:call)
+      raise ArgumentError unless p.respond_to?(:call) or p.nil?
       @prompt_proc = p
     end
 
     def auto_indent_proc=(p)
-      raise ArgumentError unless p.respond_to?(:call)
+      raise ArgumentError unless p.respond_to?(:call) or p.nil?
       @auto_indent_proc = p
     end
 
@@ -122,7 +122,7 @@ module Reline https://github.com/ruby/ruby/blob/trunk/lib/reline.rb#L122
     end
 
     def dig_perfect_match_proc=(p)
-      raise ArgumentError unless p.respond_to?(:call)
+      raise ArgumentError unless p.respond_to?(:call) or p.nil?
       @dig_perfect_match_proc = p
     end
 
-- 
cgit v0.10.2


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]