[Bug 705420] New: ruby-bindings: function parameter with default value cannot be parsed
https://bugzilla.novell.com/show_bug.cgi?id=705420 https://bugzilla.novell.com/show_bug.cgi?id=705420#c0 Summary: ruby-bindings: function parameter with default value cannot be parsed Classification: openSUSE Product: openSUSE 11.4 Version: Final Platform: Other OS/Version: Other Status: NEW Severity: Normal Priority: P5 - None Component: YaST2 AssignedTo: dmacvicar@novell.com ReportedBy: jsuchome@novell.com QAContact: jsrain@novell.com Found By: Development Blocker: --- module KerberosClient def self.read(params={}) ... end end ruby-bidnings does not correctly realize number of arguments: Y2DIR= LD_LIBRARY_PATH= /usr/bin/ycpc -c -M. -I. -q Kerberos.ycp ruby/YRubyNamespace.cc(YRubyNamespace):239 [Y2Ruby] going to parse signature: 'any( any)' ruby/YRubyNamespace.cc(YRubyNamespace):239 [Y2Ruby] going to parse signature: 'any( any)' ruby/YRubyNamespace.cc(YRubyNamespace):239 [Y2Ruby] going to parse signature: 'any( )' Kerberos.ycp:279 [Parser] Excessive parameter in call to KerberosClient::read(...) -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=705420 https://bugzilla.novell.com/show_bug.cgi?id=705420#c1 --- Comment #1 from Duncan Mac-Vicar <dmacvicar@novell.com> 2011-07-21 08:21:30 UTC --- I discussed this bug with Jiri during the workshop. The reason it happens is because the bindings use Method#arity when it should probably use Method#parameters (as detailed in the ruby-doc). Method#arity returns negative numbers when there are optional parameters and this causes the crash. So YCP should always call ruby passing _all_ parameters of a ruby method with optional arguments. Sadly, the advertised Merthod#parameters (http://www.ruby-doc.org/core/classes/Method.html#M001075) does not seem to be available in the interpreter. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=705420 https://bugzilla.novell.com/show_bug.cgi?id=705420#c Jiří Suchomel <jsuchome@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Priority|P5 - None |P4 - Low -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=705420 https://bugzilla.novell.com/show_bug.cgi?id=705420#c2 Klaus Kämpf <kkaempf@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |kkaempf@novell.com --- Comment #2 from Klaus Kämpf <kkaempf@novell.com> 2011-07-25 09:08:50 UTC --- (In reply to comment #1)
Sadly, the advertised Merthod#parameters (http://www.ruby-doc.org/core/classes/Method.html#M001075) does not seem to be available in the interpreter.
Its a feature of Ruby 1.9 -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=705420 https://bugzilla.novell.com/show_bug.cgi?id=705420#c6 Martin Vidner <mvidner@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEEDINFO |NEW CC| |mvidner@suse.com InfoProvider|mvidner@suse.com | --- Comment #6 from Martin Vidner <mvidner@suse.com> 2012-10-29 11:04:58 CET --- In YCP, function overloading only works for built-ins, not for user defined functions. That's kind of stupid, having overloading implemented but keeping the user from using it in their APIs. We can fix that if we have a strong enough use case. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=705420 https://bugzilla.novell.com/show_bug.cgi?id=705420#c7 --- Comment #7 from Josef Reidinger <jreidinger@suse.com> 2012-10-29 10:36:40 UTC --- (In reply to comment #6)
In YCP, function overloading only works for built-ins, not for user defined functions.
That's kind of stupid, having overloading implemented but keeping the user from using it in their APIs. We can fix that if we have a strong enough use case.
Well, this is one use case. Without it I cannot fix this bug, as it is hard to convert ruby optional parameters if ycp doesn't allow it -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=705420 https://bugzilla.novell.com/show_bug.cgi?id=705420#c8 Josef Reidinger <jreidinger@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |FIXED --- Comment #8 from Josef Reidinger <jreidinger@suse.com> 2013-08-19 07:00:11 UTC --- with current ruby-bindings and new way how to export ruby code to component system, issue is no longer valid. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
participants (1)
-
bugzilla_noreply@novell.com