1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Add documentation for the Kernel#warn :uplevel keyword

[ruby-core:84574] [Bug #14264]
Author:    Jeremy Evans <code@jeremyevans.net>

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62018 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
kazu 2018-01-24 00:03:51 +00:00
parent a41005eb6a
commit 49a23c27de

19
error.c
View file

@ -323,6 +323,25 @@ warning_write(int argc, VALUE *argv, VALUE buf)
*
* warning 1
* warning 2
*
* If the <code>:uplevel</code> keyword is given, the string will
* be prepended with information for the given caller frame in
* the same format used by the <code>rb_warn</code> C function.
*
* # In baz.rb
* def foo
* warn("invalid call to foo", uplevel: 1)
* end
*
* def bar
* foo
* end
*
* bar
*
* <em>produces:</em>
*
* baz.rb:6: warning: invalid call to foo
*/
static VALUE