docs for IO#print

* io.c: [DOC] split documentation for IO#print into smaller paragraphs,
  delete duplicate sentence, fix call-seq.
  Based on a patch by Dario Daic. [ruby-core:78291] [Bug #12975]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57780 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
stomar 2017-03-05 12:36:09 +00:00
parent 01fb669423
commit 6af78021d4

22
io.c
View File

@ -7012,18 +7012,20 @@ rb_f_printf(int argc, VALUE *argv)
/* /*
* call-seq: * call-seq:
* ios.print() -> nil * ios.print -> nil
* ios.print(obj, ...) -> nil * ios.print(obj, ...) -> nil
* *
* Writes the given object(s) to <em>ios</em>. The stream must be * Writes the given object(s) to <em>ios</em>. Returns <code>nil</code>.
* opened for writing. If the output field separator (<code>$,</code>) *
* is not <code>nil</code>, it will be inserted between each object. * The stream must be opened for writing.
* If the output record separator (<code>$\\</code>) * Each given object that isn't a string will be converted by calling
* is not <code>nil</code>, it will be appended to the output. If no * its <code>to_s</code> method.
* arguments are given, prints <code>$_</code>. Objects that aren't * When called without arguments, prints the contents of <code>$_</code>.
* strings will be converted by calling their <code>to_s</code> method. *
* With no argument, prints the contents of the variable <code>$_</code>. * If the output field separator (<code>$,</code>) is not <code>nil</code>,
* Returns <code>nil</code>. * it is inserted between objects.
* If the output record separator (<code>$\\</code>) is not <code>nil</code>,
* it is appended to the output.
* *
* $stdout.print("This is ", 100, " percent.\n") * $stdout.print("This is ", 100, " percent.\n")
* *