Logo

Programming-Idioms

History of Idiom 59 > diff from v15 to v16

Edit summary for version 16 by :

Version 15

2015-08-23, 10:41:42

Version 16

2015-09-03, 16:27:18

Idiom #59 Write to standard error stream

Print the message "x is negative" to standard error (stderr), with integer x value substitution (e.g. "-2 is negative").

Idiom #59 Write to standard error stream

Print the message "x is negative" to standard error (stderr), with integer x value substitution (e.g. "-2 is negative").

Code
warn "#{x} is negative"
$stderr.puts "%d is negative" % x
Doc URL
http://ruby-doc.org/core-2.2.3/Kernel.html#method-i-warn