Project

General

Profile

Actions

Feature #5029

closed

accept multiple args in Kernel#warn(), like puts()

Added by sunaku (Suraj Kurapati) almost 13 years ago. Updated almost 13 years ago.

Status:
Closed
Assignee:
-
Target version:
-
[ruby-core:38070]

Description

Hello,

Please make Kernel#warn() like Kernel#puts():

  • Accept multiple arguments.
  • Print them separated by newline.

This will allow me to warn exceptions easily:

begin
...
rescue => error
warn error.inspect, error.backtrace
end

Instead of the current way, of having to write:

begin
...
rescue => error
warn error.inspect
warn error.backtrace.join("\n")
end

Thanks for your consideration.


Files

0001-Changed-rb_warn_m-to-accept-variable-arguments.patch (1.58 KB) 0001-Changed-rb_warn_m-to-accept-variable-arguments.patch Changed rb_warn_m to accept variable arguments boredomist (Erik Price), 07/17/2011 11:06 AM

Updated by boredomist (Erik Price) almost 13 years ago

I implemented this feature request in the attached patch if there's any interest in the changed behavior of Kernel#warn().

Actions #2

Updated by nobu (Nobuyoshi Nakada) almost 13 years ago

  • Status changed from Open to Closed
  • % Done changed from 0 to 100

This issue was solved with changeset r32568.
Suraj, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


  • error.c (rb_warn_m): accept multiple args in like puts. rdoc
    patch by Erik Price at [ruby-core:38119]. [Feature #5029]
Actions

Also available in: Atom PDF

Like0
Like0Like0