redefininition of methods of DBus objects
tomasjura opened this issue · 1 comments
tomasjura commented
I have many warnings like this
/usr/lib/ruby/vendor_ruby/dbus/proxy_object.rb:94: warning: method redefined; discarding old Get
It is raised when dbus object is introspected more than one time.
I have solved by following patch, but I'm unsure if it is correct.
univocal_meths.each do |name, intf|
# creates a shortcut function that forwards each call to the method on
# the appropriate intf
singleton_class.class_eval do
+++ undef_method(name) if method_defined? name
define_method name do |*args, &reply_handler|
intf.method(name).call(*args, &reply_handler)
end
end
end
Shouldn't be the method redefinition skipped instead?