Skip to content

Autoload JSON::GenericObject to avoid require ostruct warning in Ruby 3.4 - #577

Merged
hsbt merged 1 commit into
ruby:masterfrom
tompng:autoload_generic_object
Apr 4, 2024
Merged

hsbt merged 1 commit into
ruby:masterfrom
tompng:autoload_generic_object

Conversation

@tompng

@tompng tompng commented Apr 3, 2024 •

Copy link
Copy Markdown
Member

Fixes this warning

# ruby -v
ruby 3.4.0dev (2024-04-03T00:55:24Z master b664590c4d) [x86_64-linux]
# echo > Gemfile
# bundle exec ruby -e "require 'json'"
/opt/ruby/lib/ruby/3.4.0+0/json/generic_object.rb:3: warning: ostruct was loaded from the standard library, but will no longer be part of the default gems since Ruby 3.5.0. Add ostruct to your Gemfile or gemspec.
# echo "gem 'rbs'" > Gemfile
# bundle exec irb
(press a[TAB])
irb(main):001> a/opt/ruby/lib/ruby/3.4.0+0/json/generic_object.rb:3: warning: ostruct was loaded from the standard library, but will no longer be part of the default gems since Ruby 3.5.0. Add ostruct to your Gemfile or gemspec.       abort    
               alias    
               and      
               at_exit  
               autoload 
               autoload?

@hsbt
hsbt merged commit cdbcbd0 into ruby:master Apr 4, 2024
@tompng
tompng deleted the autoload_generic_object branch April 4, 2024 04:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants