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

ruby-changes:29746

From: nobu <ko1@a...>
Date: Fri, 5 Jul 2013 22:43:32 +0900 (JST)
Subject: [ruby-changes:29746] nobu:r41799 (trunk): un.rb: refine regexp

nobu	2013-07-05 22:43:19 +0900 (Fri, 05 Jul 2013)

  New Revision: 41799

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

  Log:
    un.rb: refine regexp
    
    * lib/un.rb (help): refine regexp to extract method name.

  Modified files:
    trunk/lib/un.rb

Index: lib/un.rb
===================================================================
--- lib/un.rb	(revision 41798)
+++ lib/un.rb	(revision 41799)
@@ -342,7 +342,7 @@ def help https://github.com/ruby/ruby/blob/trunk/lib/un.rb#L342
     open(__FILE__) do |me|
       while me.gets("##\n")
         if help = me.gets("\n\n")
-          if all or argv.delete help[/-e \w+/].sub(/-e /, "")
+          if all or argv.delete help[/^#\s*ruby\s.*-e\s+(\w+)/, 1]
             print help.gsub(/^# ?/, "")
           end
         end

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

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