summaryrefslogtreecommitdiff
path: root/io.c
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-04-30 13:53:30 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-04-30 13:53:30 +0000
commit410c048a3a44627aa152e721593526c970e9478b (patch)
tree3d1a74e409e1d6aabe738a1904807127e6c55cf0 /io.c
parent657a806711577f275425853632f3af0252a43ae7 (diff)
merge revision(s) 58062: [Backport #13306]
io.c: [DOC] expand docs for IO#puts [ruby-core:80081] [Bug #13306] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_3@58517 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'io.c')
-rw-r--r--io.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/io.c b/io.c
index a000450af8..72fbff3e3b 100644
--- a/io.c
+++ b/io.c
@@ -7099,15 +7099,17 @@ io_puts_ary(VALUE ary, VALUE out, int recur)
* call-seq:
* ios.puts(obj, ...) -> nil
*
- * Writes the given object(s) to <em>ios</em> as with <code>IO#write</code>.
+ * Writes the given object(s) to <em>ios</em>.
* Writes a newline after any that do not already end
- * with a newline sequence.
+ * with a newline sequence. Returns +nil+.
*
+ * The stream must be opened for writing.
* If called with an array argument, writes each element on a new line.
+ * Each given object that isn't a string or array will be converted
+ * by calling its +to_s+ method.
* If called without arguments, outputs a single newline.
- * This doesn't affect $/. ($RS or INPUT_RECORD_SEPARATOR in English.rb)
*
- * $stdout.puts("this", "is", "a", "test")
+ * $stdout.puts("this", "is", ["a", "test"])
*
* <em>produces:</em>
*
@@ -7115,6 +7117,9 @@ io_puts_ary(VALUE ary, VALUE out, int recur)
* is
* a
* test
+ *
+ * Note that +puts+ always uses newlines and is not affected
+ * by the output record separator (<code>$\\</code>).
*/
VALUE