3 Commits

Author SHA1 Message Date
Nobuyoshi Nakada
c27ae8d91a [ruby/psych] Remove excessive check of message
The order of "unexpected" and "missing" keyword argument errors at
`Data#initialize` had not been defined strictly.

[Bug #21844](https://bugs.ruby-lang.org/issues/21844)
ruby/ruby#15910

https://github.com/ruby/psych/commit/ba748d9b04
2026-01-20 14:15:41 +00:00
Benoit Daloze
abefd3e8ff [ruby/psych] Check that Data members match exactly
* Fixes https://github.com/ruby/psych/issues/760

https://github.com/ruby/psych/commit/952008c898
2025-12-15 22:48:40 +00:00
nick evans
136dc52663 Add support for Data objects with ivars
This sets the ivars _before_ calling initialize, which feels wrong.  But
Data doesn't give us any mechanism for setting the members other than 1)
initialize, or 2) drop down into the C API.  Since initialize freezes
the object, we need to set the ivars before that.  I think this is a
reasonable compromise—if users need better handling, they can implement
their own `encode_with` and `init_with`.  But it will lead to unhappy
surprises for some users.

Alternatively, we could use the C API, similarly to Marshal.  Psych _is_
already using the C API for path2class and build_exception.  This would
be the least surprising behavior for users, I think.
2025-05-01 17:52:14 +00:00