| Server IP : 217.160.0.244 / Your IP : 216.73.217.138 Web Server : Apache System : Linux infong-eu155 4.4.400-icpu-108 #2 SMP Wed Feb 11 11:51:01 UTC 2026 x86_64 User : u100174116 ( 6746176) PHP Version : 8.5.10 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /kunden/lib/ruby/gems/3.3.0/gems/rbs-3.4.0/core/ |
Upload File : |
# <!-- rdoc-file=error.c --> # 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. # # Changing the behavior of Warning.warn is useful to customize how warnings are # handled by Ruby, for instance by filtering some warnings, and/or outputting # warnings somewhere other than `$stderr`. # # If you want to change the behavior of Warning.warn you should use # `Warning.extend(MyNewModuleWithWarnMethod)` and you can use `super` to get the # default behavior of printing the warning to `$stderr`. # # Example: # module MyWarningFilter # def warn(message, category: nil, **kwargs) # if /some warning I want to ignore/.match?(message) # # ignore # else # super # end # end # end # Warning.extend MyWarningFilter # # You should never redefine Warning#warn (the instance method), as that will # then no longer provide a way to use the default behavior. # # The [warning](https://rubygems.org/gems/warning) gem provides convenient ways # to customize Warning.warn. # module Warning # The types of categories the `Warning` module understands. # type category = :deprecated | :experimental | :performance # <!-- # rdoc-file=error.c # - Warning[category] -> true or false # --> # Returns the flag to show the warning messages for `category`. Supported # categories are: # # `:deprecated` # : deprecation warnings # * assignment of non-nil value to `$,` and `$;` # * keyword arguments # # etc. # # `:experimental` # : experimental features # * Pattern matching # # # `:performance` # : performance hints # * Shape variation limit # def self.[]: (category) -> bool # <!-- # rdoc-file=error.c # - Warning[category] = flag -> flag # --> # Sets the warning flags for `category`. See Warning.[] for the categories. # def self.[]=: [T] (category, T flag) -> T # <!-- # rdoc-file=error.c # - warn(msg, category: nil) -> nil # --> # Writes warning message `msg` to $stderr. This method is called by Ruby for all # emitted warnings. A `category` may be included with the warning. # # See the documentation of the Warning module for how to customize this. # def self?.warn: (String message, ?category: category?) -> nil end