jnunemaker / crack

Really simple JSON and XML parsing, ripped from Merb and Rails.
MIT License
540 stars 93 forks source link

Add Ruby 3.1 support that is backwards compatible to Ruby 1.9.3 #74

Closed dmorehouse closed 7 months ago

dmorehouse commented 1 year ago

YAML.safe_load with keyword arguments is available since Psych 3.1 [https://github.com/ruby/psych/pull/358, https://github.com/ruby/psych/pull/378], but keyword arguments are mandatory since Psych 4.0 [3].

This is a backwards compatible version of #73. Using docker images, I was able to test this works back to Ruby 1.9.3 (probably before that, I just can't build Ruby < 2 on my machine and Ruby 1.9.3 is the only official Docker image).

Fixes https://github.com/jnunemaker/crack/issues/72

kiskoza commented 7 months ago

@bf4 this PR should be merged next to make the CI pass for Ruby 3.1+