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

ruby-changes:46082

From: nagachika <ko1@a...>
Date: Mon, 27 Mar 2017 23:46:28 +0900 (JST)
Subject: [ruby-changes:46082] nagachika:r58153 (ruby_2_3): merge revision(s) 53667, 57735: [Backport #13148]

nagachika	2017-03-27 23:46:22 +0900 (Mon, 27 Mar 2017)

  New Revision: 58153

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

  Log:
    merge revision(s) 53667,57735: [Backport #13148]
    
    hash.c: exception examples
    
    * hash.c (rb_hash_dig): [DOC] add examples of exceptions.
    Fix doc for Hash#dig and Struct#dig
    
    * hash.c (rb_hash_dig): [DOC] correct argument name
      in method description; fix formatting in examples.
    * struct.c (rb_struct_dig): ditto.
    
    [ruby-core:79221] [Bug #13148]

  Modified directories:
    branches/ruby_2_3/
  Modified files:
    branches/ruby_2_3/hash.c
    branches/ruby_2_3/struct.c
    branches/ruby_2_3/version.h
Index: ruby_2_3/hash.c
===================================================================
--- ruby_2_3/hash.c	(revision 58152)
+++ ruby_2_3/hash.c	(revision 58153)
@@ -2699,17 +2699,19 @@ rb_hash_any_p(VALUE hash) https://github.com/ruby/ruby/blob/trunk/ruby_2_3/hash.c#L2699
  * call-seq:
  *   hsh.dig(key, ...)                 -> object
  *
- * Extracts the nested value specified by the sequence of <i>idx</i>
+ * Extracts the nested value specified by the sequence of <i>key</i>
  * objects by calling +dig+ at each step, returning +nil+ if any
  * intermediate step is +nil+.
  *
  *   h = { foo: {bar: {baz: 1}}}
  *
- *   h.dig(:foo, :bar, :baz)           #=> 1
- *   h.dig(:foo, :zot, :xyz)           #=> nil
+ *   h.dig(:foo, :bar, :baz)     #=> 1
+ *   h.dig(:foo, :zot, :xyz)     #=> nil
  *
  *   g = { foo: [10, 11, 12] }
- *   g.dig(:foo, 1)                    #=> 11
+ *   g.dig(:foo, 1)              #=> 11
+ *   g.dig(:foo, 1, 0)           #=> TypeError: Fixnum does not have #dig method
+ *   g.dig(:foo, :bar)           #=> TypeError: no implicit conversion of Symbol into Integer
  */
 
 VALUE
Index: ruby_2_3/version.h
===================================================================
--- ruby_2_3/version.h	(revision 58152)
+++ ruby_2_3/version.h	(revision 58153)
@@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_3/version.h#L1
 #define RUBY_VERSION "2.3.3"
 #define RUBY_RELEASE_DATE "2017-03-27"
-#define RUBY_PATCHLEVEL 264
+#define RUBY_PATCHLEVEL 265
 
 #define RUBY_RELEASE_YEAR 2017
 #define RUBY_RELEASE_MONTH 3
Index: ruby_2_3/struct.c
===================================================================
--- ruby_2_3/struct.c	(revision 58152)
+++ ruby_2_3/struct.c	(revision 58153)
@@ -1133,15 +1133,15 @@ rb_struct_size(VALUE s) https://github.com/ruby/ruby/blob/trunk/ruby_2_3/struct.c#L1133
  * call-seq:
  *   struct.dig(key, ...)              -> object
  *
- * Extracts the nested value specified by the sequence of <i>idx</i>
+ * Extracts the nested value specified by the sequence of +key+
  * objects by calling +dig+ at each step, returning +nil+ if any
  * intermediate step is +nil+.
  *
  *   klass = Struct.new(:a)
  *   o = klass.new(klass.new({b: [1, 2, 3]}))
  *
- *   o.dig(:a, :a, :b, 0)              #=> 1
- *   o.dig(:b, 0)                      #=> nil
+ *   o.dig(:a, :a, :b, 0)   #=> 1
+ *   o.dig(:b, 0)           #=> nil
  */
 
 static VALUE

Property changes on: ruby_2_3
___________________________________________________________________
Modified: svn:mergeinfo
   Merged /trunk:r53667,57735


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

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