[yast-commit] r59251 - in /trunk/ruby-bindings/examples/ruby: Foo.rb ruby_from_ycp.sh ruby_from_ycp.ycp
Author: mvidner Date: Fri Oct 30 09:28:18 2009 New Revision: 59251 URL: http://svn.opensuse.org/viewcvs/yast?rev=59251&view=rev Log: Added a working example. Added: trunk/ruby-bindings/examples/ruby/ruby_from_ycp.sh (with props) Modified: trunk/ruby-bindings/examples/ruby/Foo.rb trunk/ruby-bindings/examples/ruby/ruby_from_ycp.ycp Modified: trunk/ruby-bindings/examples/ruby/Foo.rb URL: http://svn.opensuse.org/viewcvs/yast/trunk/ruby-bindings/examples/ruby/Foo.rb?rev=59251&r1=59250&r2=59251&view=diff ============================================================================== --- trunk/ruby-bindings/examples/ruby/Foo.rb (original) +++ trunk/ruby-bindings/examples/ruby/Foo.rb Fri Oct 30 09:28:18 2009 @@ -0,0 +1,5 @@ +module Foo + def self.multiply_by_eight(n) + n * 8 + end +end Added: trunk/ruby-bindings/examples/ruby/ruby_from_ycp.sh URL: http://svn.opensuse.org/viewcvs/yast/trunk/ruby-bindings/examples/ruby/ruby_from_ycp.sh?rev=59251&view=auto ============================================================================== --- trunk/ruby-bindings/examples/ruby/ruby_from_ycp.sh (added) +++ trunk/ruby-bindings/examples/ruby/ruby_from_ycp.sh Fri Oct 30 09:28:18 2009 @@ -0,0 +1 @@ +ln -snf . modules; Y2DIR=. /sbin/yast2 ./ruby_from_ycp.ycp Modified: trunk/ruby-bindings/examples/ruby/ruby_from_ycp.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/ruby-bindings/examples/ruby/ruby_from_ycp.ycp?rev=59251&r1=59250&r2=59251&view=diff ============================================================================== --- trunk/ruby-bindings/examples/ruby/ruby_from_ycp.ycp (original) +++ trunk/ruby-bindings/examples/ruby/ruby_from_ycp.ycp Fri Oct 30 09:28:18 2009 @@ -1,7 +1,7 @@ { import "Foo"; - string result = (string) multiply_by_eight(10); + string result = tostring(Foo::multiply_by_eight(10)); UI::OpenDialog( `VBox( `Label(result), @@ -10,4 +10,4 @@ ); UI::UserInput(); UI::CloseDialog(); -} \ No newline at end of file +} -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org
participants (1)
-
mvidner@svn.opensuse.org