-
Notifications
You must be signed in to change notification settings - Fork 205
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Kernel.y interferes with code relying on method_missing #664
Comments
This would make sense. Could you workaround it by adding this shim for yourself? def y = method_missing(:y) |
Any idea who is requiring that file? It only adds the method to Kernel if something is requiring it, and Psych does not require it by default.
I'm not thrilled with Psych adding |
Thanks for your time. I should've added steps to reproduce in that moment, because my scenario eludes me today. It would appear that this issue only occurs when Line 17 in be0ba74
So I must have been either inside bundler's gem-templated Found some fresh steps to reproduce:
I'm feeling less strong about it now, since in all likelyhood it doesn't effect anyone's live environments. Feel free to close. |
Good day,
I have coordinate objects in protobuf which have a
.y
attribute defined, but rely onmethod_missing
to trigger calls to C.Kernel.y intercepts the message and gives me an unexpected result.
I believe other systems which also rely on method_missing like nokogiri will cause the same trouble when trying to access an arbitrary "y" property in a document.
Can we rename the "y" patch to Kernel, to something less common, please?
psych/lib/psych/y.rb
Line 5 in 21f051b
Otherwise people who use x,y,z coordinates get adverse effects and have to implement a workaround like the following.
Even "yy" would be better. Thank you :)
The text was updated successfully, but these errors were encountered: