From: mame@... Date: 2020-12-24T02:56:52+00:00 Subject: [ruby-core:101669] [Ruby master Bug#17387] About Warning.warn compatibility in Ruby 3.0.0 Issue #17387 has been updated by mame (Yusuke Endoh). Status changed from Open to Closed The Japanese doc has been fixed. This is actually an incompatibility, but I believe it is a minor issue. Thank you for the report. Closing. ---------------------------------------- Bug #17387: About Warning.warn compatibility in Ruby 3.0.0 https://bugs.ruby-lang.org/issues/17387#change-89488 * Author: jnchito (Junichi Ito) * Status: Closed * Priority: Normal * ruby -v: ruby 3.0.0preview2 (2020-12-08 master d7a16670c3) [x86_64-darwin20] * Backport: 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN ---------------------------------------- The sample code in https://docs.ruby-lang.org/ja/latest/method/Warning/s/warn.html does not work in Ruby 3.0.0. Is it intended behavior? I'm worrying about its compatibility. ``` ruby warn "hoge" module Warning def self.warn(*message) super(*message.map { |msg| msg.chomp + "!!!\n" }) end end warn "hoge" ``` ``` $ ruby ~/Desktop/test.rb hoge /Users/jnito/Desktop/test.rb:5:in `block in warn': undefined method `chomp' for {:category=>nil}:Hash (NoMethodError) from /Users/jnito/Desktop/test.rb:5:in `map' from /Users/jnito/Desktop/test.rb:5:in `warn' from :43:in `warn' from /Users/jnito/Desktop/test.rb:9:in `
' ``` This issue must be related to https://bugs.ruby-lang.org/issues/17122 -- https://bugs.ruby-lang.org/ Unsubscribe: