[yast-commit] r67445 - in /trunk/ruby-bindings/tests/ycp: InRuby.rb ruby_from_ycp.ycp
Author: jreidinger Date: Wed Feb 15 15:00:15 2012 New Revision: 67445 URL: http://svn.opensuse.org/viewcvs/yast?rev=67445&view=rev Log: first test to play with exceptions in ruby-bindings ( I hope we switch to git in near future and hope that noone need to submit ruby-bindings until I implement it ) Modified: trunk/ruby-bindings/tests/ycp/InRuby.rb trunk/ruby-bindings/tests/ycp/ruby_from_ycp.ycp Modified: trunk/ruby-bindings/tests/ycp/InRuby.rb URL: http://svn.opensuse.org/viewcvs/yast/trunk/ruby-bindings/tests/ycp/InRuby.rb?rev=67445&r1=67444&r2=67445&view=diff ============================================================================== --- trunk/ruby-bindings/tests/ycp/InRuby.rb (original) +++ trunk/ruby-bindings/tests/ycp/InRuby.rb Wed Feb 15 15:00:15 2012 @@ -2,4 +2,8 @@ def self.multiply_by_eight(n) n * 8 end + + def self.raising_code + raise "Wow exception!" + end end Modified: trunk/ruby-bindings/tests/ycp/ruby_from_ycp.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/ruby-bindings/tests/ycp/ruby_from_ycp.ycp?rev=67445&r1=67444&r2=67445&view=diff ============================================================================== --- trunk/ruby-bindings/tests/ycp/ruby_from_ycp.ycp (original) +++ trunk/ruby-bindings/tests/ycp/ruby_from_ycp.ycp Wed Feb 15 15:00:15 2012 @@ -3,6 +3,15 @@ import "InRuby"; string result = tostring(InRuby::multiply_by_eight(10)); y2milestone("result: %1", result); + if (InRuby::raising_code()==nil) + { + string result = tostring(InRuby::last_exception()); + y2milestone("result: %1", result); + } + else + { + y2error("exception completely ignored"); + } import "CamelCase"; result = tostring(CamelCase::inc(10)); y2milestone("result: %1", result); -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org
participants (1)
-
jreidinger@svn2.opensuse.org