<feed xmlns='http://www.w3.org/2005/Atom'>
<title>ruby.git/test/psych/test_data.rb, branch v4.0.3</title>
<subtitle>The Ruby Programming Language</subtitle>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/'/>
<entry>
<title>[ruby/psych] Check that Data members match exactly</title>
<updated>2025-12-15T22:48:40+00:00</updated>
<author>
<name>Benoit Daloze</name>
<email>eregontp@gmail.com</email>
</author>
<published>2025-12-10T20:11:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=abefd3e8ff1853800d4df5b28388191b51d9ec37'/>
<id>abefd3e8ff1853800d4df5b28388191b51d9ec37</id>
<content type='text'>
* Fixes https://github.com/ruby/psych/issues/760

https://github.com/ruby/psych/commit/952008c898
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* Fixes https://github.com/ruby/psych/issues/760

https://github.com/ruby/psych/commit/952008c898
</pre>
</div>
</content>
</entry>
<entry>
<title>Add support for Data objects with ivars</title>
<updated>2025-05-01T17:52:14+00:00</updated>
<author>
<name>nick evans</name>
<email>nick@rubinick.dev</email>
</author>
<published>2024-10-28T19:41:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=136dc52663b3e3a1a6c4efd3c4621ea2a7aacd17'/>
<id>136dc52663b3e3a1a6c4efd3c4621ea2a7aacd17</id>
<content type='text'>
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.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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.
</pre>
</div>
</content>
</entry>
</feed>
