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

ruby-changes:38925

From: hsbt <ko1@a...>
Date: Wed, 24 Jun 2015 12:21:39 +0900 (JST)
Subject: [ruby-changes:38925] hsbt:r51006 (trunk): * re.c: Update documentation for Regexp class.

hsbt	2015-06-24 12:21:21 +0900 (Wed, 24 Jun 2015)

  New Revision: 51006

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

  Log:
    * re.c: Update documentation for Regexp class.
      [fix GH-937][ci skip] Patch by @davydovanton

  Modified files:
    trunk/ChangeLog
    trunk/re.c
Index: re.c
===================================================================
--- re.c	(revision 51005)
+++ re.c	(revision 51006)
@@ -1688,10 +1688,6 @@ match_array(VALUE match, int start) https://github.com/ruby/ruby/blob/trunk/re.c#L1688
 }
 
 
-/* [MG]:FIXME: I put parens around the /.../.match() in the first line of the
-   second example to prevent the '*' followed by a '/' from ending the
-   comment. */
-
 /*
  *  call-seq:
  *     mtch.to_a   -> anArray
@@ -1707,7 +1703,7 @@ match_array(VALUE match, int start) https://github.com/ruby/ruby/blob/trunk/re.c#L1703
  *  accessing the fields directly (as an intermediate array is
  *  generated).
  *
- *     all,f1,f2,f3 = *(/(.)(.)(\d+)(\d)/.match("THX1138."))
+ *     all,f1,f2,f3 = * /(.)(.)(\d+)(\d)/.match("THX1138.")
  *     all   #=> "HX1138"
  *     f1    #=> "H"
  *     f2    #=> "X"
@@ -2924,12 +2920,16 @@ rb_reg_match2(VALUE re) https://github.com/ruby/ruby/blob/trunk/re.c#L2920
  *  If a block is given, invoke the block with MatchData if match succeed, so
  *  that you can write
  *
- *     pat.match(str) {|m| ...}
+ *     /M(.*)/.match("Matz") do |m|
+ *       puts m[0]
+ *       puts m[1]
+ *     end
  *
  *  instead of
  *
- *     if m = pat.match(str)
- *       ...
+ *     if m = /M(.*)/.match("Matz")
+ *       puts m[0]
+ *       puts m[1]
  *     end
  *
  *  The return value is a value from block execution in this case.
@@ -2964,15 +2964,14 @@ rb_reg_match_m(int argc, VALUE *argv, VA https://github.com/ruby/ruby/blob/trunk/re.c#L2964
 /*
  * Document-method: compile
  *
- * Synonym for <code>Regexp.new</code>
+ * Alias for <code>Regexp.new</code>
  */
 
-
 /*
  *  call-seq:
- *     Regexp.new(string, [options [, kcode]])        -> regexp
+ *     Regexp.new(string, [options [, kcode]])       -> regexp
  *     Regexp.new(regexp)                            -> regexp
- *     Regexp.compile(string, [options [, kcode]])    -> regexp
+ *     Regexp.compile(string, [options [, kcode]])   -> regexp
  *     Regexp.compile(regexp)                        -> regexp
  *
  *  Constructs a new regular expression from +pattern+, which can be either a
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 51005)
+++ ChangeLog	(revision 51006)
@@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Wed Jun 24 12:21:16 2015  SHIBATA Hiroshi  <hsbt@r...>
+
+	* re.c: Update documentation for Regexp class.
+	  [fix GH-937][ci skip] Patch by @davydovanton
+
 Wed Jun 24 09:23:03 2015  Eric Wong  <e@8...>
 
 	* variable.c (generic_ivar_set): remove FL_ABLE check

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

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