[Bug 705417] New: ruby-bindings: lower-cased module not found by ycp
https://bugzilla.novell.com/show_bug.cgi?id=705417 https://bugzilla.novell.com/show_bug.cgi?id=705417#c0 Summary: ruby-bindings: lower-cased module not found by ycp 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: --- When ruby module is named in lowercase, ("kerberos_client.rb"), it cannot be imported from YCP -- 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=705417 https://bugzilla.novell.com/show_bug.cgi?id=705417#c1 Jiří Suchomel <jsuchome@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jreidinger@suse.com, | |kkaempf@suse.com, | |mvidner@suse.com --- Comment #1 from Jiří Suchomel <jsuchome@suse.com> 2011-09-07 08:25:16 UTC --- Any chance for a change here? -- 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=705417 https://bugzilla.novell.com/show_bug.cgi?id=705417#c2 --- Comment #2 from Klaus Kämpf <kkaempf@suse.com> 2011-09-07 08:34:34 UTC --- Testcase ? -- 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=705417 https://bugzilla.novell.com/show_bug.cgi?id=705417#c3 --- Comment #3 from Jiří Suchomel <jsuchome@suse.com> 2011-09-07 08:52:11 UTC --- Rename Foo.rb from ruby-bindings/examples/ruby, install it to /usr/share/YaST2/modules and try to import 'foo' from ycp client (just like ruby_from_ycp.ycp in the same dirctory). However, it would be better to have solution common with bug 705422 -- 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=705417 https://bugzilla.novell.com/show_bug.cgi?id=705417#c4 --- Comment #4 from Klaus Kämpf <kkaempf@suse.com> 2011-09-07 09:06:56 UTC --- (In reply to comment #3)
Rename Foo.rb from ruby-bindings/examples/ruby, install it to /usr/share/YaST2/modules and try to import 'foo' from ycp client (just like ruby_from_ycp.ycp in the same dirctory).
I get a yast:0:in `const_get': wrong constant name foo (NameError) here, is that what you're getting too ? -- 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=705417 https://bugzilla.novell.com/show_bug.cgi?id=705417#c5 --- Comment #5 from Jiří Suchomel <jsuchome@suse.com> 2011-09-07 09:21:51 UTC --- Yes. -- 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=705417 https://bugzilla.novell.com/show_bug.cgi?id=705417#c6 --- Comment #6 from Klaus Kämpf <kkaempf@suse.com> 2011-09-07 09:28:38 UTC --- Ah, the file name is coupled to the module name. ~/.y2log shows ruby/YRubyNamespace.cc(YRubyNamespace):184 Creating namespace for 'foo' -- 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=705417 https://bugzilla.novell.com/show_bug.cgi?id=705417#c7 --- Comment #7 from Klaus Kämpf <kkaempf@suse.com> 2011-09-07 09:37:15 UTC --- I guess there's no easy way to fix this. Somehow the YaST core must be informed about the just-imported module. Currently this is done in the bindings by treating the filename equal to the module name. Another solution would be to adapt the respective .rb files from module Foo ... end to yast_module Foo ... end or to module Foo yast_module ... end Opinions ? -- 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=705417 https://bugzilla.novell.com/show_bug.cgi?id=705417#c8 --- Comment #8 from Klaus Kämpf <kkaempf@suse.com> 2011-09-07 09:44:54 UTC --- Another option is to have Rails-like name-mangling File foo.rb would provide (module) Foo, file foo_bar.rb provide Foo::Bar, etc. -- 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=705417 https://bugzilla.novell.com/show_bug.cgi?id=705417#c9 --- Comment #9 from Jiří Suchomel <jsuchome@suse.com> 2011-09-07 09:48:11 UTC --- Example from YaST++ project: file name is kerberos_client.rb and it is written like: module YLib module KerberosClient ... end end How should it be imported from YCP? -- 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=705417 https://bugzilla.novell.com/show_bug.cgi?id=705417#c10 --- Comment #10 from Klaus Kämpf <kkaempf@suse.com> 2011-09-07 09:50:45 UTC --- (In reply to comment #8)
Another option is to have Rails-like name-mangling
File foo.rb would provide (module) Foo, file foo_bar.rb provide Foo::Bar, etc.
Oops, wrong. foo_bar.rb would provide FooBar and foo/bar.rb provide Foo::Bar -- 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=705417 https://bugzilla.novell.com/show_bug.cgi?id=705417#c11 --- Comment #11 from Klaus Kämpf <kkaempf@suse.com> 2011-09-07 09:51:49 UTC --- (In reply to comment #9)
Example from YaST++ project:
file name is kerberos_client.rb
and it is written like:
module YLib module KerberosClient ... end end
How should it be imported from YCP?
That would be require "y_lib/kerberos_client" doing it Rails-style (IIRC) -- 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=705417 https://bugzilla.novell.com/show_bug.cgi?id=705417#c12 --- Comment #12 from Jiří Suchomel <jsuchome@suse.com> 2011-09-07 10:04:38 UTC --- (In reply to comment #11)
That would be require "y_lib/kerberos_client" doing it Rails-style (IIRC)
But that's not ycp. Could we hide such transformation and do not touch either YCP nor ruby conventions? Currently, I do (locally) mkdir -p /usr/share/YaST2/modules/YLib ln -sf /usr/lib64/ruby/vendor_ruby/1.8/y_lib/kerberos_client.rb /usr/share/YaST2/modules/YLib/KerberosClient.rb Than I reach my goal to have this code in YCP: import "YLib/KerberosClient"; YLib::KerberosClient::read ($[]); But it would be better without that linking (or extra envelope ruby file) -- 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=705417 https://bugzilla.novell.com/show_bug.cgi?id=705417#c13 --- Comment #13 from Klaus Kämpf <kkaempf@suse.com> 2011-09-07 10:26:21 UTC --- So you want to name the file y_lib/kerberos_client.rb and use import "YLib/KerberosClient" to load it ? Yes, that should be doable. -- 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=705417 https://bugzilla.novell.com/show_bug.cgi?id=705417#c14 --- Comment #14 from Jiří Suchomel <jsuchome@suse.com> 2011-09-07 13:15:13 UTC --- Yes. -- 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=705417 https://bugzilla.novell.com/show_bug.cgi?id=705417#c16 Josef Reidinger <jreidinger@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |NEEDINFO InfoProvider| |jsuchome@suse.com --- Comment #16 from Josef Reidinger <jreidinger@suse.com> 2012-01-16 14:51:00 UTC --- Jiri - I fix it in svn. Could you please test it if it works as expected? thanks -- 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=705417 https://bugzilla.novell.com/show_bug.cgi?id=705417#c17 --- Comment #17 from Bernhard Wiedemann <bwiedemann@suse.com> 2012-01-16 17:00:09 CET --- This is an autogenerated message for OBS integration: This bug (705417) was mentioned in https://build.opensuse.org/request/show/100270 Factory / yast2-ruby-bindings -- 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=705417 https://bugzilla.novell.com/show_bug.cgi?id=705417#c18 Jiří Suchomel <jsuchome@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEEDINFO |NEW InfoProvider|jsuchome@suse.com | --- Comment #18 from Jiří Suchomel <jsuchome@suse.com> 2012-01-18 10:59:01 UTC --- It is not clear how should it be used. I'm creating symlink ln -s /usr/lib64/ruby/vendor_ruby/1.8/y_lib /usr/share/YaST2/modules/y_lib And calling from ycp import "YLib::KerberosClient"; y2internal ("read: %1", YLib::KerberosClient::read ($[])); Which ends with 2012-01-18 11:58:43 <1> dhcp74.suse.cz(18665) [liby2] genericfrontend.cc(main):675 Launched YaST2 component 'y2base' './kerberos.ycp' 'qt' 2012-01-18 11:58:43 <1> dhcp74.suse.cz(18665) [ui-component] YUIComponentCreator.cc(createInternal):134 Creating UI component for "" 2012-01-18 11:58:43 <1> dhcp74.suse.cz(18665) [ui-component] YUIComponentCreator.cc(createInternal):149 Returning existing UI component for "qt" 2012-01-18 11:58:43 <3> dhcp74.suse.cz(18665) [Interpreter] examples/kerberos.ycp:31 Loading module 'YLib::KerberosClient' failed 2012-01-18 11:58:43 <3> dhcp74.suse.cz(18665) [libycp] Import.cc(import):97 No matching component found 2012-01-18 11:58:43 <3> dhcp74.suse.cz(18665) [Parser] examples/kerberos.ycp:31 Can't load module 'YLib::KerberosClient'. 2012-01-18 11:58:43 <3> dhcp74.suse.cz(18665) [Parser] examples/kerberos.ycp:34 Unknown namespace 'YLib::KerberosClient'. Missing 'import'? 2012-01-18 11:58:43 <3> dhcp74.suse.cz(18665) [Parser] examples/kerberos.ycp:34 syntax error, unexpected SCANNER_ERROR 2012-01-18 11:58:43 <1> dhcp74.suse.cz(18665) [wfm] Y2CCWFM.cc(createInLevel):148 Parsing finished 2012-01-18 11 -- 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=705417 https://bugzilla.novell.com/show_bug.cgi?id=705417#c19 --- Comment #19 from Jiří Suchomel <jsuchome@suse.com> 2012-01-18 11:00:30 UTC --- BTW, you can test yourself with ycp example file in git repo: yast++lib-kerberos-client/examples/kerberos-example.ycp https://github.com/yast/yast--/blob/master/yast%2B%2Blib-kerberos-client/exa... -- 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=705417 https://bugzilla.novell.com/show_bug.cgi?id=705417#c20 Josef Reidinger <jreidinger@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |NEEDINFO InfoProvider| |jsuchome@suse.com --- Comment #20 from Josef Reidinger <jreidinger@suse.com> 2012-01-19 12:17:24 UTC --- Well, now I commit another fix, that at least work with example. Could you please try it with whole yast module? thanks -- 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=705417 https://bugzilla.novell.com/show_bug.cgi?id=705417#c21 Jiří Suchomel <jsuchome@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEEDINFO |NEW InfoProvider|jsuchome@suse.com | --- Comment #21 from Jiří Suchomel <jsuchome@suse.com> 2012-01-19 13:37:55 UTC --- Yes, this is better, thanks! I think you can close it now -- 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=705417 https://bugzilla.novell.com/show_bug.cgi?id=705417#c22 Josef Reidinger <jreidinger@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |FIXED --- Comment #22 from Josef Reidinger <jreidinger@suse.com> 2012-01-19 13:50:53 UTC --- OK, thanks -- 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=705417 https://bugzilla.novell.com/show_bug.cgi?id=705417#c23 --- Comment #23 from Bernhard Wiedemann <bwiedemann@suse.com> 2012-01-20 17:00:11 CET --- This is an autogenerated message for OBS integration: This bug (705417) was mentioned in https://build.opensuse.org/request/show/100948 Factory / yast2-ruby-bindings -- 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=705417 https://bugzilla.novell.com/show_bug.cgi?id=705417#c24 --- Comment #24 from Bernhard Wiedemann <bwiedemann@suse.com> 2012-01-25 18:00:14 CET --- This is an autogenerated message for OBS integration: This bug (705417) was mentioned in https://build.opensuse.org/request/show/101533 Factory / yast2-ruby-bindings -- 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