[Kde-bindings] [Bug 277459] Ruby bindings produce huge amount of warnings in ruby 1.9

Stefano Crocco stefano.crocco at alice.it
Mon Jul 18 16:58:20 UTC 2011


https://bugs.kde.org/show_bug.cgi?id=277459





--- Comment #2 from Stefano Crocco <stefano crocco alice it>  2011-07-18 16:58:19 ---
I tried looking at the ruby source code to find out when this warning is
generated, but I couldn't understand it (if you want to take a look, it's at
line 236 of vm_method.c in the ruby 1.9.2 source). From my tests it seems this
warning is produced when you redefine a method already defined in the same
class (redefining an inherited method doesn't produce it), and this behaviour
is the same in ruby 1.8 and 1.9. My best guess is that the class you're
redefining const_missing and method_missing doesn't have those method already
defined in ruby 1.8, while they're already defined in ruby 1.9. Is this
possibile?

I don't know if ruby behavior has changed between 1.8 and 1.9 regarding this
issue. If you want, I can ask for more information on the ruby mailing list (I
tried google but found nothing useful).

If the root of this issue can't be found, there are some workarounds which can
be used to avoid the issue, at least if they don't affect performance:
* set the $VERBOSE global variable to 0 before redefining the methods and
restore it after it's done
* use remove_method to remove the existing methods before redefining the new
ones
* alias the existing methods to something else, since the warning won't be
produced when the existing method has an alias

-- 
Configure bugmail: https://bugs.kde.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the Kde-bindings mailing list