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

ruby-changes:8662

From: yugui <ko1@a...>
Date: Tue, 11 Nov 2008 20:01:35 +0900 (JST)
Subject: [ruby-changes:8662] Ruby:r20197 (ruby_1_9_1): merges r20149 from trunk into ruby_1_9_1.

yugui	2008-11-11 20:01:13 +0900 (Tue, 11 Nov 2008)

  New Revision: 20197

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=20197

  Log:
    merges r20149 from trunk into ruby_1_9_1.
    * lib/optparse.rb (OptionParser#make_switch): 1.9 Symbols respond
      to :match.  a patch from keith cascio, <keith at ucla.edu>.
      [ruby-core:19730]

  Modified files:
    branches/ruby_1_9_1/ChangeLog
    branches/ruby_1_9_1/lib/optparse.rb

Index: ruby_1_9_1/ChangeLog
===================================================================
--- ruby_1_9_1/ChangeLog	(revision 20196)
+++ ruby_1_9_1/ChangeLog	(revision 20197)
@@ -1,3 +1,9 @@
+Sat Nov  8 17:15:08 2008  Yukihiro Matsumoto  <matz@r...>
+
+	* lib/optparse.rb (OptionParser#make_switch): 1.9 Symbols respond
+	  to :match.  a patch from keith cascio, <keith at ucla.edu>.
+	  [ruby-core:19730]
+
 Sat Nov  8 12:10:15 2008  Yukihiro Matsumoto  <matz@r...>
 
 	* ext/gdbm/gdbm.c (fgdbm_index): make #index warn like Hash.
Index: ruby_1_9_1/lib/optparse.rb
===================================================================
--- ruby_1_9_1/lib/optparse.rb	(revision 20196)
+++ ruby_1_9_1/lib/optparse.rb	(revision 20197)
@@ -1074,7 +1074,7 @@
       end
 
       # directly specified pattern(any object possible to match)
-      if !(String === o) and o.respond_to?(:match)
+      if (!(String === o || Symbol === o)) and o.respond_to?(:match)
         pattern = notwice(o, pattern, 'pattern')
         conv = pattern.method(:convert).to_proc if pattern.respond_to?(:convert)
         next

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

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