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

ruby-changes:47112

From: usa <ko1@a...>
Date: Fri, 30 Jun 2017 20:32:57 +0900 (JST)
Subject: [ruby-changes:47112] usa:r59227 (ruby_2_3): merge revision(s) 59002: [Backport #13621]

usa	2017-06-30 20:32:44 +0900 (Fri, 30 Jun 2017)

  New Revision: 59227

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

  Log:
    merge revision(s) 59002: [Backport #13621]
    
    string.c: docs for String#split
    
    * string.c: [DOC] clarify docs for String#split when called
      with limit and capture groups.
      Reported by Cichol Tsai.  [ruby-core:81505] [Bug #13621]

  Modified directories:
    branches/ruby_2_3/
  Modified files:
    branches/ruby_2_3/ChangeLog
    branches/ruby_2_3/string.c
    branches/ruby_2_3/version.h
Index: ruby_2_3/version.h
===================================================================
--- ruby_2_3/version.h	(revision 59226)
+++ ruby_2_3/version.h	(revision 59227)
@@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_3/version.h#L1
 #define RUBY_VERSION "2.3.5"
 #define RUBY_RELEASE_DATE "2017-06-30"
-#define RUBY_PATCHLEVEL 323
+#define RUBY_PATCHLEVEL 324
 
 #define RUBY_RELEASE_YEAR 2017
 #define RUBY_RELEASE_MONTH 6
Index: ruby_2_3/ChangeLog
===================================================================
--- ruby_2_3/ChangeLog	(revision 59226)
+++ ruby_2_3/ChangeLog	(revision 59227)
@@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_3/ChangeLog#L1
+Fri Jun 30 20:31:59 2017  Marcus Stollsteimer  <sto.mar@w...>
+
+	* string.c: [DOC] clarify docs for String#split when called with limit
+	  and capture groups. Reported by Cichol Tsai. [Bug #13621]
+
 Fri Jun 30 20:23:31 2017  Takashi Kokubun  <takashikkbn@g...>
 
 	* lib/erb.rb: Allow explicit trimming carriage return when trim_mode is
Index: ruby_2_3/string.c
===================================================================
--- ruby_2_3/string.c	(revision 59226)
+++ ruby_2_3/string.c	(revision 59227)
@@ -6769,7 +6769,7 @@ static const char isspacetable[256] = { https://github.com/ruby/ruby/blob/trunk/ruby_2_3/string.c#L6769
 
 /*
  *  call-seq:
- *     str.split(pattern=nil, [limit])   -> anArray
+ *     str.split(pattern=nil, [limit])   -> an_array
  *
  *  Divides <i>str</i> into substrings based on a delimiter, returning an array
  *  of these substrings.
@@ -6789,9 +6789,11 @@ static const char isspacetable[256] = { https://github.com/ruby/ruby/blob/trunk/ruby_2_3/string.c#L6789
  *  split on whitespace as if ` ' were specified.
  *
  *  If the <i>limit</i> parameter is omitted, trailing null fields are
- *  suppressed. If <i>limit</i> is a positive number, at most that number of
- *  fields will be returned (if <i>limit</i> is <code>1</code>, the entire
- *  string is returned as the only entry in an array). If negative, there is no
+ *  suppressed. If <i>limit</i> is a positive number, at most that number
+ *  of split substrings will be returned (captured groups will be returned
+ *  as well, but are not counted towards the limit).
+ *  If <i>limit</i> is <code>1</code>, the entire
+ *  string is returned as the only entry in an array. If negative, there is no
  *  limit to the number of fields returned, and trailing null fields are not
  *  suppressed.
  *
@@ -6811,6 +6813,8 @@ static const char isspacetable[256] = { https://github.com/ruby/ruby/blob/trunk/ruby_2_3/string.c#L6813
  *     "1,2,,3,4,,".split(',', 4)      #=> ["1", "2", "", "3,4,,"]
  *     "1,2,,3,4,,".split(',', -4)     #=> ["1", "2", "", "3", "4", "", ""]
  *
+ *     "1:2:3".split(/(:)()()/, 2)     #=> ["1", ":", "", "", "2:3"]
+ *
  *     "".split(',', -1)               #=> []
  */
 
Index: ruby_2_3
===================================================================
--- ruby_2_3	(revision 59226)
+++ ruby_2_3	(revision 59227)

Property changes on: ruby_2_3
___________________________________________________________________
Modified: svn:mergeinfo
## -0,0 +0,1 ##
   Merged /trunk:r59002

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

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