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

ruby-changes:54678

From: mame <ko1@a...>
Date: Mon, 21 Jan 2019 17:51:56 +0900 (JST)
Subject: [ruby-changes:54678] mame:r66894 (trunk): string.c (rb_str_dump): Fix the rdoc

mame	2019-01-21 17:51:51 +0900 (Mon, 21 Jan 2019)

  New Revision: 66894

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

  Log:
    string.c (rb_str_dump): Fix the rdoc
    
    * Officially states that String#dump is intended for round-trip.

  Modified files:
    trunk/string.c
Index: string.c
===================================================================
--- string.c	(revision 66893)
+++ string.c	(revision 66894)
@@ -6002,7 +6002,10 @@ rb_str_inspect(VALUE str) https://github.com/ruby/ruby/blob/trunk/string.c#L6002
  *     str.dump   -> new_str
  *
  *  Produces a version of +str+ with all non-printing characters replaced by
- *  <code>\nnn</code> notation and all special characters escaped.
+ *  <code>\xnn</code> notation and all special characters escaped.
+ *
+ *  This API is intended for round-trip: if the result string is eval'ed,
+ *  it produces the original string.
  *
  *    "hello \n ''".dump  #=> "\"hello \\n ''\""
  */

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

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