rjb 1.4.7-x86-mswin32-100 → 1.4.9-x86-mswin32-100
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/ChangeLog +658 -639
- data/ext/extconf.h +1 -1
- data/ext/rjb.c +9 -2
- data/ext/rjbexception.c +6 -0
- data/lib/rjbcore.so +0 -0
- data/readme.txt +1 -1
- data/test/Base.class +0 -0
- data/test/CallbackTest$Callback.class +0 -0
- data/test/CallbackTest.class +0 -0
- data/test/ExtBase.class +0 -0
- data/test/IBase.class +0 -0
- data/test/JTest.class +0 -0
- data/test/Test$TestTypes.class +0 -0
- data/test/Test.class +0 -0
- data/test/Two.class +0 -0
- data/test/TwoCaller.class +0 -0
- data/test/jp/co/infoseek/hp/arton/rjb/CallbackTest$Callback.class +0 -0
- data/test/jp/co/infoseek/hp/arton/rjb/CallbackTest.class +0 -0
- data/test/jp/co/infoseek/hp/arton/rjb/IBase.class +0 -0
- data/test/jp/co/infoseek/hp/arton/rjb/JTest.class +0 -0
- data/test/jp/co/infoseek/hp/arton/rjb/Test$TestTypes.class +0 -0
- data/test/jp/co/infoseek/hp/arton/rjb/Test.class +0 -0
- data/test/rjbtest.jar +0 -0
- data/test/test.rb +21 -0
- metadata +48 -42
data/ext/extconf.h
CHANGED
data/ext/rjb.c
CHANGED
@@ -15,7 +15,7 @@
|
|
15
15
|
* $Id: rjb.c 199 2012-12-17 13:31:18Z arton $
|
16
16
|
*/
|
17
17
|
|
18
|
-
#define RJB_VERSION "1.4.
|
18
|
+
#define RJB_VERSION "1.4.9"
|
19
19
|
|
20
20
|
#include "ruby.h"
|
21
21
|
#include "extconf.h"
|
@@ -1066,7 +1066,14 @@ static jarray r2objarray(JNIEnv* jenv, VALUE v, const char* cls)
|
|
1066
1066
|
if (TYPE(v) == T_ARRAY)
|
1067
1067
|
{
|
1068
1068
|
int i;
|
1069
|
-
|
1069
|
+
jclass jcls = NULL;
|
1070
|
+
char* p = strchr(cls, ';');
|
1071
|
+
if (p)
|
1072
|
+
{
|
1073
|
+
volatile VALUE clsname = rb_str_new(cls + 1, p - cls - 1); // skip first 'L'
|
1074
|
+
jcls = rjb_find_class(jenv, clsname);
|
1075
|
+
}
|
1076
|
+
ary = (*jenv)->NewObjectArray(jenv, (jint)RARRAY_LEN(v), (jcls) ? jcls : j_object, NULL);
|
1070
1077
|
rjb_check_exception(jenv, 0);
|
1071
1078
|
for (i = 0; i < RARRAY_LEN(v); i++)
|
1072
1079
|
{
|
data/ext/rjbexception.c
CHANGED
@@ -32,6 +32,11 @@ static VALUE missing_delegate(int argc, VALUE* argv, VALUE self)
|
|
32
32
|
return rb_funcall(rb_ivar_get(self, rb_intern("@cause")), rmid, argc - 1, argv + 1);
|
33
33
|
}
|
34
34
|
|
35
|
+
static VALUE get_cause(VALUE self)
|
36
|
+
{
|
37
|
+
return rb_funcall(rb_ivar_get(self, rb_intern("@cause")), rb_intern("cause"), 0);
|
38
|
+
}
|
39
|
+
|
35
40
|
static VALUE exception_to_s(VALUE self)
|
36
41
|
{
|
37
42
|
return rb_funcall(rb_ivar_get(self, rb_intern("@cause")),
|
@@ -66,6 +71,7 @@ VALUE rjb_get_exception_class(JNIEnv* jenv, jstring str)
|
|
66
71
|
if (rexp == Qnil)
|
67
72
|
{
|
68
73
|
rexp = rb_define_class(pcls, rb_eStandardError);
|
74
|
+
rb_define_method(rexp, "cause", get_cause, 0);
|
69
75
|
rb_define_method(rexp, "method_missing", missing_delegate, -1);
|
70
76
|
rb_define_method(rexp, "to_str", exception_to_s, 0);
|
71
77
|
#if defined(HAVE_RB_HASH_ASET) || defined(RUBINIUS)
|
data/lib/rjbcore.so
CHANGED
Binary file
|
data/readme.txt
CHANGED
@@ -29,7 +29,7 @@ you must set LD_LIBRARY_PATH environmental variable to run rjb.
|
|
29
29
|
If you'll plan to open the non-ascii character named file by Java class through Rjb, it may require to set LC_ALL environment variable in you sciprt.
|
30
30
|
For example in Rails, set above line in production.rb as your environment.
|
31
31
|
ENV['LC_ALL'] = 'en_us.utf8' # or ja_JP.utf8 etc.
|
32
|
-
cf: http://bugs.sun.com/
|
32
|
+
cf: http://bugs.sun.com/view_bug.do?bug_id=4733494
|
33
33
|
(Thanks Paul for this information).
|
34
34
|
|
35
35
|
artonx@yahoo.co.jp
|
data/test/Base.class
ADDED
Binary file
|
Binary file
|
Binary file
|
data/test/ExtBase.class
ADDED
Binary file
|
data/test/IBase.class
ADDED
Binary file
|
data/test/JTest.class
ADDED
Binary file
|
Binary file
|
data/test/Test.class
ADDED
Binary file
|
data/test/Two.class
CHANGED
Binary file
|
data/test/TwoCaller.class
CHANGED
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
data/test/rjbtest.jar
CHANGED
Binary file
|
data/test/test.rb
CHANGED
@@ -810,6 +810,19 @@ class TestRjb < Test::Unit::TestCase
|
|
810
810
|
end
|
811
811
|
end
|
812
812
|
end
|
813
|
+
|
814
|
+
|
815
|
+
def test_inner_exception
|
816
|
+
test = import('jp.co.infoseek.hp.arton.rjb.Test').new
|
817
|
+
begin
|
818
|
+
test.cause_exception
|
819
|
+
flunk("no exception")
|
820
|
+
rescue IllegalStateException => e
|
821
|
+
ia = e.cause
|
822
|
+
assert_equal('bad argument', ia.message)
|
823
|
+
assert_equal('java.lang.IllegalArgumentException', ia._classname)
|
824
|
+
end
|
825
|
+
end
|
813
826
|
|
814
827
|
class CbTest
|
815
828
|
def method(l, s, i, d, str)
|
@@ -878,5 +891,13 @@ class TestRjb < Test::Unit::TestCase
|
|
878
891
|
assert_equal(32, b.int_value)
|
879
892
|
assert b.compareTo(@jByte._invoke(:valueOf, 'B', 32))
|
880
893
|
end
|
894
|
+
def test_typedarray
|
895
|
+
test = import('jp.co.infoseek.hp.arton.rjb.Test').new
|
896
|
+
uri = import('java.net.URI')
|
897
|
+
ret = test.java_typed_array(['a', 'b', 'c'], [1, 2, 3], [uri.new('http://www.artonx.org')])
|
898
|
+
assert_equal '[Ljava.lang.String;', ret[0]
|
899
|
+
assert_equal '[Ljava.lang.Integer;', ret[1]
|
900
|
+
assert_equal '[Ljava.net.URI;', ret[2]
|
901
|
+
end
|
881
902
|
end
|
882
903
|
|
metadata
CHANGED
@@ -1,93 +1,99 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rjb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.4.
|
5
|
-
prerelease:
|
4
|
+
version: 1.4.9
|
6
5
|
platform: x86-mswin32-100
|
7
6
|
authors:
|
8
7
|
- arton
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date:
|
11
|
+
date: 2014-01-03 00:00:00.000000000 Z
|
13
12
|
dependencies: []
|
14
|
-
description:
|
15
|
-
Native Interface.
|
16
|
-
|
17
|
-
'
|
13
|
+
description: |
|
14
|
+
RJB is a bridge program that connect between Ruby and Java with Java Native Interface.
|
18
15
|
email: artonx@gmail.com
|
19
16
|
executables: []
|
20
17
|
extensions: []
|
21
18
|
extra_rdoc_files: []
|
22
19
|
files:
|
20
|
+
- COPYING
|
21
|
+
- ChangeLog
|
22
|
+
- data/rjb/jp/co/infoseek/hp/arton/rjb/RBridge.class
|
23
23
|
- ext/RBridge.java
|
24
|
-
- ext/
|
25
|
-
- ext/rjb.c
|
26
|
-
- ext/load.c
|
27
|
-
- ext/riconv.c
|
24
|
+
- ext/depend
|
28
25
|
- ext/extconf.h
|
29
26
|
- ext/jniwrap.h
|
30
27
|
- ext/jp_co_infoseek_hp_arton_rjb_RBridge.h
|
31
|
-
- ext/
|
28
|
+
- ext/load.c
|
29
|
+
- ext/riconv.c
|
32
30
|
- ext/riconv.h
|
33
|
-
- ext/
|
34
|
-
-
|
35
|
-
-
|
31
|
+
- ext/rjb.c
|
32
|
+
- ext/rjb.h
|
33
|
+
- ext/rjbexception.c
|
36
34
|
- lib/rjb.rb
|
35
|
+
- lib/rjbcore.so
|
36
|
+
- lib/rjbextension.rb
|
37
|
+
- readme.sj
|
38
|
+
- readme.txt
|
37
39
|
- samples/filechooser.rb
|
38
40
|
- samples/unzip.rb
|
39
|
-
- test/
|
40
|
-
- test/
|
41
|
-
- test/
|
42
|
-
- test/
|
41
|
+
- test/Base.class
|
42
|
+
- test/CallbackTest$Callback.class
|
43
|
+
- test/CallbackTest.class
|
44
|
+
- test/ExtBase.class
|
45
|
+
- test/IBase.class
|
46
|
+
- test/JTest.class
|
47
|
+
- test/Test$TestTypes.class
|
48
|
+
- test/Test.class
|
49
|
+
- test/Two.class
|
50
|
+
- test/TwoCaller.class
|
43
51
|
- test/exttest.rb
|
44
|
-
- test/
|
45
|
-
- test/
|
52
|
+
- test/gctest.rb
|
53
|
+
- test/jartest.jar
|
54
|
+
- test/jartest.rb
|
55
|
+
- test/jartest2.jar
|
46
56
|
- test/jartest2.rb
|
47
57
|
- test/jartest3.rb
|
48
|
-
- test/test_unload.rb
|
49
|
-
- test/listtest.rb
|
50
|
-
- test/jp/co/infoseek/hp/arton/rjb/Test.class
|
51
|
-
- test/jp/co/infoseek/hp/arton/rjb/Test$TestTypes.class
|
52
58
|
- test/jp/co/infoseek/hp/arton/rjb/CallbackTest$Callback.class
|
53
59
|
- test/jp/co/infoseek/hp/arton/rjb/CallbackTest.class
|
54
60
|
- test/jp/co/infoseek/hp/arton/rjb/IBase.class
|
55
|
-
- test/
|
56
|
-
- test/
|
57
|
-
- test/
|
58
|
-
- test/
|
61
|
+
- test/jp/co/infoseek/hp/arton/rjb/JTest.class
|
62
|
+
- test/jp/co/infoseek/hp/arton/rjb/Test$TestTypes.class
|
63
|
+
- test/jp/co/infoseek/hp/arton/rjb/Test.class
|
64
|
+
- test/listtest.rb
|
65
|
+
- test/osx_jvmcheck.rb
|
59
66
|
- test/rjbtest.jar
|
60
|
-
-
|
61
|
-
-
|
62
|
-
-
|
63
|
-
-
|
64
|
-
- lib/rjbcore.so
|
67
|
+
- test/test.rb
|
68
|
+
- test/test_osxjvm.rb
|
69
|
+
- test/test_osxload.rb
|
70
|
+
- test/test_unload.rb
|
65
71
|
homepage: http://rjb.rubyforge.org/
|
66
|
-
licenses:
|
72
|
+
licenses:
|
73
|
+
- LGPL
|
74
|
+
metadata: {}
|
67
75
|
post_install_message:
|
68
76
|
rdoc_options: []
|
69
77
|
require_paths:
|
70
78
|
- lib
|
71
79
|
required_ruby_version: !ruby/object:Gem::Requirement
|
72
|
-
none: false
|
73
80
|
requirements:
|
74
|
-
- -
|
81
|
+
- - ">="
|
75
82
|
- !ruby/object:Gem::Version
|
76
83
|
version: 1.8.2
|
77
84
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
78
|
-
none: false
|
79
85
|
requirements:
|
80
|
-
- -
|
86
|
+
- - ">="
|
81
87
|
- !ruby/object:Gem::Version
|
82
88
|
version: '0'
|
83
89
|
requirements:
|
84
90
|
- none
|
85
91
|
- JDK 5.0
|
86
|
-
-
|
92
|
+
- " VC6 version of Ruby"
|
87
93
|
rubyforge_project: rjb
|
88
|
-
rubygems_version:
|
94
|
+
rubygems_version: 2.2.0
|
89
95
|
signing_key:
|
90
|
-
specification_version:
|
96
|
+
specification_version: 4
|
91
97
|
summary: Ruby Java bridge
|
92
98
|
test_files:
|
93
99
|
- test/test.rb
|