[rubygems/rubygems] Allow upcoming JRuby to pass keywords for Kernel#warn

jruby-head (which will be JRuby 9.4.0.0) can now properly process
the keywords to Kernel#warn.  I cannot think of any capability based
test for this so I constrained it using a version guard.  Only JRuby
will ever hit the version guard.

https://github.com/rubygems/rubygems/commit/cd468c7e0f
This commit is contained in:
Thomas E. Enebo 2022-10-20 13:17:47 -05:00 committed by git
parent 0d697e341a
commit 420bdba139
2 changed files with 2 additions and 2 deletions

View File

@ -406,7 +406,7 @@ which is the non-negative integer line number
in the stream where the next read will occur. in the stream where the next read will occur.
The line number is the number of lines read by certain line-oriented methods The line number is the number of lines read by certain line-oriented methods
({::foreach}[https://docs.ruby-lang.org/en/master/IO.html#method-c-foreach], ({::foreach}[rdoc-ref:IO.foreach],
{#each_line}[rdoc-ref:io_streams.rdoc@Method+-23each_line], {#each_line}[rdoc-ref:io_streams.rdoc@Method+-23each_line],
{#gets}[rdoc-ref:io_streams.rdoc@Method+-23gets], {#gets}[rdoc-ref:io_streams.rdoc@Method+-23gets],
{#readline}[rdoc-ref:io_streams.rdoc@Method+-23readline], {#readline}[rdoc-ref:io_streams.rdoc@Method+-23readline],

View File

@ -16,7 +16,7 @@ if RUBY_VERSION >= "2.5" && !Gem::KERNEL_WARN_IGNORES_INTERNAL_ENTRIES
module_function define_method(:warn) {|*messages, **kw| module_function define_method(:warn) {|*messages, **kw|
unless uplevel = kw[:uplevel] unless uplevel = kw[:uplevel]
if Gem.java_platform? if Gem.java_platform? && RUBY_VERSION < "3.1"
return original_warn.bind(self).call(*messages) return original_warn.bind(self).call(*messages)
else else
return original_warn.bind(self).call(*messages, **kw) return original_warn.bind(self).call(*messages, **kw)