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

ruby-changes:34000

From: hsbt <ko1@a...>
Date: Sat, 24 May 2014 22:40:33 +0900 (JST)
Subject: [ruby-changes:34000] hsbt:r46081 (trunk): * array.c: [DOC] Add more documents to shuffle! and shuffle.

hsbt	2014-05-24 22:40:28 +0900 (Sat, 24 May 2014)

  New Revision: 46081

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

  Log:
    * array.c: [DOC] Add more documents to shuffle! and shuffle.
      Contributed by @JuanitoFatas [ci skip][fix GH-612]

  Modified files:
    trunk/ChangeLog
    trunk/array.c
Index: array.c
===================================================================
--- array.c	(revision 46080)
+++ array.c	(revision 46081)
@@ -4459,7 +4459,13 @@ static ID id_random; https://github.com/ruby/ruby/blob/trunk/array.c#L4459
  *
  *  Shuffles elements in +self+ in place.
  *
+ *     a = [ 1, 2, 3 ]           #=> [1, 2, 3]
+ *     a.shuffle!                #=> [2, 3, 1]
+ *     a                         #=> [2, 3, 1]
+ *
  *  The optional +rng+ argument will be used as the random number generator.
+ *
+ *     a.shuffle!(random: Random.new(1))  #=> [1, 3, 2]
  */
 
 static VALUE
@@ -4506,6 +4512,7 @@ rb_ary_shuffle_bang(int argc, VALUE *arg https://github.com/ruby/ruby/blob/trunk/array.c#L4512
  *
  *     a = [ 1, 2, 3 ]           #=> [1, 2, 3]
  *     a.shuffle                 #=> [2, 3, 1]
+ *     a                         #=> [1, 2, 3]
  *
  *  The optional +rng+ argument will be used as the random number generator.
  *
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 46080)
+++ ChangeLog	(revision 46081)
@@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Sat May 24 22:37:20 2014  SHIBATA Hiroshi  <shibata.hiroshi@g...>
+
+	* array.c: [DOC] Add more documents to shuffle! and shuffle.
+	  Contributed by @JuanitoFatas [ci skip][fix GH-612]
+
 Sat May 24 22:28:55 2014  SHIBATA Hiroshi  <shibata.hiroshi@g...>
 
 	* test/lib/minitest/.document: removed unused configuration.

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

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