oscillot / image_optim_ruby_3.1_psych_4_repro

Reproduce an issue that occurs on Ruby3.1.x (With Psych 4.x)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

To reproduce the issue

  • Install ruby 3.1.2 (e.g. rbenv install if you use rbenv)
  • gem install bundler
  • bundle install
  • bundle exec ruby repro.rb

You will see output like this:

exception when reading .../.image_optim.yml: Tried to load unspecified class: Range
{}

Image_optim should explicitly pass the Range class to permitted_classes in this call to Yaml.load_file: https://github.com/toy/image_optim/blob/v0.31.1/lib/image_optim/config.rb#L36

If there are any other classes not listed here that are expected to be usable they will also need to be added: https://ruby-doc.org/stdlib-3.1.2/libdoc/psych/rdoc/Psych.html

About

Reproduce an issue that occurs on Ruby3.1.x (With Psych 4.x)


Languages

Language:Ruby 100.0%