Project

General

Profile

Feature #13504 ยป 0001-Document-the-Warning-module-and-warn-method.patch

jeremyevans0 (Jeremy Evans), 04/24/2017 06:43 PM

View differences:

error.c
rb_fatal("%s is only for internal use and deprecated; do not use", func);
}
/*
* call-seq:
* warn(msg) -> nil
*
* Writes warning message to $stderr, followed by a newline
* if the message does not end in a newline. This method is called
* by ruby for all emitted warnings.
*/
static VALUE
rb_warning_s_warn(VALUE mod, VALUE str)
{
......
return Qnil;
}
/*
* Document-module: Warning
*
* The Warning module contains a single method named #warn, and the
* module extends itself, making Warning.warn available.
* Warning.warn is called for all warnings issued by ruby.
* By default, warnings are printed to $stderr.
*
* By overriding Warning.warn, you can change how warnings are
* handled by ruby, either filtering some warnings, and/or outputing
* warnings somewhere other than $stderr. When Warning.warn is
* overridden, super can be called to get the default behavior of
* printing the warning to $stderr.
*
*/
static void
rb_write_warning_str(VALUE str)
{
    (1-1/1)