You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Ruby 2.6.8 ships a version of ostruct that does not exist #31
This is another case of CRuby's stdlib being updated without an according gem release.
Ruby 2.6.8 as tagged includes a gemspec for ostruct claiming version 0.1.0. However the ostruct.rb alongside it has the following diff:
$ diff -U 5 lib/ostruct.rb ../jruby/lib/ruby/stdlib/ostruct.rb
--- lib/ostruct.rb 2021-09-01 12:37:44.000000000 -0500+++ ../jruby/lib/ruby/stdlib/ostruct.rb 2021-09-15 11:34:53.000000000 -0500@@ -103,32 +103,19 @@
super
@table = @table.dup
end
#
- # call-seq:- # ostruct.to_h -> hash- # ostruct.to_h {|name, value| block } -> hash- #
# Converts the OpenStruct to a hash with keys representing
# each attribute (as symbols) and their corresponding values.
#
- # If a block is given, the results of the block on each pair of- # the receiver will be used as pairs.- #
# require "ostruct"
# data = OpenStruct.new("country" => "Australia", :capital => "Canberra")
# data.to_h # => {:country => "Australia", :capital => "Canberra" }
- # data.to_h {|name, value| [name.to_s, value.upcase] }- # # => {"country" => "AUSTRALIA", "capital" => "CANBERRA" }
#
- def to_h(&block)- if block_given?- @table.to_h(&block)- else- @table.dup- end+ def to_h+ @table.dup
end
#
# :call-seq:
# ostruct.each_pair {|name, value| block } -> ostruct
Changes made to gem-based libraries must be released as new versions of the gem before they are shipped with a release of CRuby.
As a result of this change, there is no way that JRuby can ship the exact same ostruct as Ruby 2.6.8, because the code in Ruby 2.6.8's ostruct does not correspond to any released version of ostruct.
Activity
hsbt commentedon Apr 15, 2022
@headius Sorry to late response. Unfortunately, Ruby 2.6 is EOL now. I will coordinate JRuby's issu same as this in the next release.