Hello community,
here is the log from the commit of package yast2-ruby-bindings for
openSUSE:Factory checked in at 2013-11-28 07:40:11
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/yast2-ruby-bindings (Old)
and /work/SRC/openSUSE:Factory/.yast2-ruby-bindings.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "yast2-ruby-bindings"
Changes:
--------
--- /work/SRC/openSUSE:Factory/yast2-ruby-bindings/yast2-ruby-bindings.changes
2013-11-07 09:15:34.000000000 +0100
+++
/work/SRC/openSUSE:Factory/.yast2-ruby-bindings.new/yast2-ruby-bindings.changes
2013-11-28 07:40:12.000000000 +0100
@@ -1,0 +2,6 @@
+Wed Nov 27 10:10:53 UTC 2013 - [email protected]
+
+- add detection of invalid type in publish call
+- 3.1.3
+
+-------------------------------------------------------------------
Old:
----
yast2-ruby-bindings-3.1.2.tar.bz2
New:
----
yast2-ruby-bindings-3.1.3.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ yast2-ruby-bindings.spec ++++++
--- /var/tmp/diff_new_pack.rToPTI/_old 2013-11-28 07:40:12.000000000 +0100
+++ /var/tmp/diff_new_pack.rToPTI/_new 2013-11-28 07:40:12.000000000 +0100
@@ -17,7 +17,7 @@
Name: yast2-ruby-bindings
-Version: 3.1.2
+Version: 3.1.3
Release: 0
BuildRoot: %{_tmppath}/%{name}-%{version}-build
Source0: yast2-ruby-bindings-%{version}.tar.bz2
++++++ yast2-ruby-bindings-3.1.2.tar.bz2 -> yast2-ruby-bindings-3.1.3.tar.bz2
++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/yast2-ruby-bindings-3.1.2/VERSION
new/yast2-ruby-bindings-3.1.3/VERSION
--- old/yast2-ruby-bindings-3.1.2/VERSION 2013-11-04 17:05:39.000000000
+0100
+++ new/yast2-ruby-bindings-3.1.3/VERSION 2013-11-27 13:57:37.000000000
+0100
@@ -1 +1 @@
-3.1.2
+3.1.3
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/yast2-ruby-bindings-3.1.2/package/yast2-ruby-bindings.changes
new/yast2-ruby-bindings-3.1.3/package/yast2-ruby-bindings.changes
--- old/yast2-ruby-bindings-3.1.2/package/yast2-ruby-bindings.changes
2013-11-04 17:05:39.000000000 +0100
+++ new/yast2-ruby-bindings-3.1.3/package/yast2-ruby-bindings.changes
2013-11-27 13:57:37.000000000 +0100
@@ -1,4 +1,10 @@
-------------------------------------------------------------------
+Wed Nov 27 10:10:53 UTC 2013 - [email protected]
+
+- add detection of invalid type in publish call
+- 3.1.3
+
+-------------------------------------------------------------------
Fri Oct 25 14:26:08 UTC 2013 - [email protected]
- report exceptions via Report.Error so there is no hidden failures
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/yast2-ruby-bindings-3.1.2/package/yast2-ruby-bindings.spec
new/yast2-ruby-bindings-3.1.3/package/yast2-ruby-bindings.spec
--- old/yast2-ruby-bindings-3.1.2/package/yast2-ruby-bindings.spec
2013-11-04 17:05:39.000000000 +0100
+++ new/yast2-ruby-bindings-3.1.3/package/yast2-ruby-bindings.spec
2013-11-27 13:57:37.000000000 +0100
@@ -3,7 +3,7 @@
#
Name: yast2-ruby-bindings
-Version: 3.1.2
+Version: 3.1.3
Release: 0
License: GPL-2.0
Group: System/YaST
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/yast2-ruby-bindings-3.1.2/src/binary/Y2RubyComponent.cc
new/yast2-ruby-bindings-3.1.3/src/binary/Y2RubyComponent.cc
--- old/yast2-ruby-bindings-3.1.2/src/binary/Y2RubyComponent.cc 2013-11-04
17:05:39.000000000 +0100
+++ new/yast2-ruby-bindings-3.1.3/src/binary/Y2RubyComponent.cc 2013-11-27
13:57:37.000000000 +0100
@@ -75,12 +75,17 @@
args->add (YCPString(/*module*/ name));
args->add (YCPString(/*module*/ module));
- YRuby::loadModule (args);
- y2debug("Module '%s' loaded", name);
- // introspect, create data structures for the interpreter
- Y2Namespace * res = new YRubyNamespace (name);
- namespaces[name] = res;
- return res;
+ try {
+ YRuby::loadModule (args);
+ y2debug("Module '%s' loaded", name);
+ // introspect, create data structures for the interpreter
+ Y2Namespace * res = new YRubyNamespace (name);
+ namespaces[name] = res;
+ return res;
+ } catch (exception& e) {
+ y2error("Loading module failed: %s", e.what());
+ return NULL;
+ }
}
const string Y2RubyComponent::CamelCase2DelimSepated( const char* name)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/yast2-ruby-bindings-3.1.2/src/binary/YRubyNamespace.cc
new/yast2-ruby-bindings-3.1.3/src/binary/YRubyNamespace.cc
--- old/yast2-ruby-bindings-3.1.2/src/binary/YRubyNamespace.cc 2013-11-04
17:05:39.000000000 +0100
+++ new/yast2-ruby-bindings-3.1.3/src/binary/YRubyNamespace.cc 2013-11-27
13:57:37.000000000 +0100
@@ -31,11 +31,38 @@
#include <ycp/Type.h>
#include <ycp/YCPVoid.h>
#include <stdio.h>
+#include <exception>
#include "YRuby.h"
#include "Y2RubyUtils.h"
/**
+ * Exception raised when type signature in ruby class is invalid
+ */
+class WrongTypeException: public exception
+{
+public:
+
+ WrongTypeException(string method_name, string signature)
+ {
+ message += "Invalid type '";
+ message += signature;
+ message += "' definition for method/variable: '";
+ message += method_name;
+ message += "'.";
+ }
+
+ virtual const char* what() const throw()
+ {
+ return message.c_str();
+ }
+
+ virtual ~WrongTypeException() throw() {}
+private:
+ string message;
+};
+
+/**
* The definition of a function that is implemented in Ruby
*/
class Y2RubyFunction : public Y2Function
@@ -281,6 +308,9 @@
string signature = StringValueCStr(type);
constTypePtr sym_tp = Type::fromSignature(signature);
+ if (sym_tp == NULL)
+ throw WrongTypeException(rb_id2name(SYM2ID(variable_name)), signature);
+
// symbol entry for the function
SymbolEntry *se = new VariableSymbolEntry ( ruby_module_name,
this,
@@ -305,6 +335,8 @@
void YRubyNamespace::addMethod( const char* name, const string &signature, int
offset)
{
constTypePtr sym_tp = Type::fromSignature(signature);
+ if (sym_tp == NULL || !sym_tp->isFunction())
+ throw WrongTypeException(name, signature);
// symbol entry for the function
SymbolEntryPtr fun_se = new SymbolEntry ( this,
--
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]