[DRE-commits] [ruby-rjb] 02/11: JException#cause to the instance method
Jérémy Bobbio
lunar at moszumanska.debian.org
Thu Apr 10 18:57:23 UTC 2014
This is an automated email from the git hooks/post-receive script.
lunar pushed a commit to branch master
in repository ruby-rjb.
commit bd191d7597c8df5d66daa42ba647eac351651917
Author: arton <arton at arton-ubuntu.(none)>
Date: Sat Dec 28 11:54:38 2013 +0900
JException#cause to the instance method
---
ChangeLog | 5 +++++
ext/rjbexception.c | 8 +++++++-
2 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/ChangeLog b/ChangeLog
index 216f10d..85ebfb1 100755
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Fri Jan 3 2014 arton
+ *ext/rjb.c
+ RJB_VERSION -> 1.4.9
+ *ext/rjbexception.c
+ make J#cause to the instance method for resolving Ruby 2.1 confliction.
Sun Jun 23 2013 arton
*ext/rjb.c
RJB_VERSION -> 1.4.8
diff --git a/ext/rjbexception.c b/ext/rjbexception.c
index 619e8a3..20560ae 100644
--- a/ext/rjbexception.c
+++ b/ext/rjbexception.c
@@ -32,6 +32,11 @@ static VALUE missing_delegate(int argc, VALUE* argv, VALUE self)
return rb_funcall(rb_ivar_get(self, rb_intern("@cause")), rmid, argc - 1, argv + 1);
}
+static VALUE get_cause(VALUE self)
+{
+ return rb_ivar_get(self, rb_intern("@cause"));
+}
+
static VALUE exception_to_s(VALUE self)
{
return rb_funcall(rb_ivar_get(self, rb_intern("@cause")),
@@ -66,7 +71,8 @@ VALUE rjb_get_exception_class(JNIEnv* jenv, jstring str)
if (rexp == Qnil)
{
rexp = rb_define_class(pcls, rb_eStandardError);
- rb_define_method(rexp, "method_missing", missing_delegate, -1);
+ rb_define_method(rexp, "cause", get_cause, -1);
+ rb_define_method(rexp, "method_missing", missing_delegate, 0);
rb_define_method(rexp, "to_str", exception_to_s, 0);
#if defined(HAVE_RB_HASH_ASET) || defined(RUBINIUS)
rb_hash_aset(rjb_loaded_classes, cname, rexp);
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ruby-extras/ruby-rjb.git
More information about the Pkg-ruby-extras-commits
mailing list