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

ruby-changes:17786

From: yugui <ko1@a...>
Date: Mon, 15 Nov 2010 20:44:25 +0900 (JST)
Subject: [ruby-changes:17786] Ruby:r29797 (ruby_1_9_2): merges r29254 from trunk into ruby_1_9_2.

yugui	2010-11-15 20:44:05 +0900 (Mon, 15 Nov 2010)

  New Revision: 29797

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

  Log:
    merges r29254 from trunk into ruby_1_9_2.
    --
    * string.c (rb_str_times): mentioned about Hash argument.  a patch
      from Daniel Bovensiepen at [ruby-core:32386].
    
    * sprintf.c (get_hash): ditto, and fix typo.

  Modified files:
    branches/ruby_1_9_2/ChangeLog
    branches/ruby_1_9_2/sprintf.c
    branches/ruby_1_9_2/string.c
    branches/ruby_1_9_2/version.h

Index: ruby_1_9_2/ChangeLog
===================================================================
--- ruby_1_9_2/ChangeLog	(revision 29796)
+++ ruby_1_9_2/ChangeLog	(revision 29797)
@@ -1,3 +1,10 @@
+Wed Sep 15 07:27:52 2010  Nobuyoshi Nakada  <nobu@r...>
+
+	* string.c (rb_str_times): mentioned about Hash argument.  a patch
+	  from Daniel Bovensiepen at [ruby-core:32386].
+
+	* sprintf.c (get_hash): ditto, and fix typo.
+
 Mon Sep 13 19:56:50 2010  Nobuyoshi Nakada  <nobu@r...>
 
 	* ext/socket/rubysocket.h (__DARWIN_ALIGNBYTES): workaround of a
Index: ruby_1_9_2/string.c
===================================================================
--- ruby_1_9_2/string.c	(revision 29796)
+++ ruby_1_9_2/string.c	(revision 29797)
@@ -1224,12 +1224,13 @@
  *
  *  Format---Uses <i>str</i> as a format specification, and returns the result
  *  of applying it to <i>arg</i>. If the format specification contains more than
- *  one substitution, then <i>arg</i> must be an <code>Array</code> containing
- *  the values to be substituted. See <code>Kernel::sprintf</code> for details
- *  of the format string.
+ *  one substitution, then <i>arg</i> must be an <code>Array</code> or <code>Hash</code>
+ *  containing the values to be substituted. See <code>Kernel::sprintf</code> for
+ *  details of the format string.
  *
  *     "%05d" % 123                              #=> "00123"
  *     "%-5s: %08x" % [ "ID", self.object_id ]   #=> "ID   : 200e14d6"
+ *     "foo = %{foo}" % { :foo => 'bar' }        #=> "foo = bar"
  */
 
 static VALUE
Index: ruby_1_9_2/sprintf.c
===================================================================
--- ruby_1_9_2/sprintf.c	(revision 29796)
+++ ruby_1_9_2/sprintf.c	(revision 29797)
@@ -422,13 +422,13 @@
  *     sprintf("%u", -123)                        #=> "-123"
  *
  *  For more complex formatting, Ruby supports a reference by name.
- *  %<name>s style uses format style, but ${name} style doesn't.
+ *  %<name>s style uses format style, but %{name} style doesn't.
  *
  *  Exapmles:
  *    sprintf("%<foo>d : %<bar>f" % { :foo => 1, :bar => 2 })
  *      #=> 1 : 2.000000
- *    sprintf("%d %{foo}" % { :foo => 'bar' })
- *      # => "%d bar"
+ *    sprintf("%{foo}f" % { :foo => 1 })
+ *      # => "1f"
  */
 
 VALUE
Index: ruby_1_9_2/version.h
===================================================================
--- ruby_1_9_2/version.h	(revision 29796)
+++ ruby_1_9_2/version.h	(revision 29797)
@@ -1,5 +1,5 @@
 #define RUBY_VERSION "1.9.2"
-#define RUBY_PATCHLEVEL 41
+#define RUBY_PATCHLEVEL 42
 #define RUBY_VERSION_MAJOR 1
 #define RUBY_VERSION_MINOR 9
 #define RUBY_VERSION_TEENY 1

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

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