[ruby/date] Alias value to take in old Ruby

https://github.com/ruby/date/commit/1ce29a26dd
This commit is contained in:
Hiroshi SHIBATA 2025-06-03 15:43:32 +09:00 committed by git
parent 6f4eaa100f
commit 52d85c0efb

View File

@ -5,6 +5,10 @@ require 'date'
class TestDateParseRactor < Test::Unit::TestCase
def code(klass = Date, share: false)
<<~RUBY.gsub('Date', klass.name)
class Ractor
alias value take
end unless Ractor.method_defined? :value # compat with Ruby 3.4 and olders
share = #{share}
d = Date.parse('Aug 23:55')
Ractor.make_shareable(d) if share