rjb 1.4.7 → 1.4.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/ChangeLog +651 -643
- data/ext/extconf.h +1 -2
- data/ext/rjb.c +9 -2
- data/test/Test$TestTypes.class +0 -0
- data/test/jp/co/infoseek/hp/arton/rjb/Test.class +0 -0
- data/test/test.rb +8 -0
- metadata +3 -2
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.8"
|
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
|
{
|
Binary file
|
Binary file
|
data/test/test.rb
CHANGED
@@ -878,5 +878,13 @@ class TestRjb < Test::Unit::TestCase
|
|
878
878
|
assert_equal(32, b.int_value)
|
879
879
|
assert b.compareTo(@jByte._invoke(:valueOf, 'B', 32))
|
880
880
|
end
|
881
|
+
def test_typedarray
|
882
|
+
test = import('jp.co.infoseek.hp.arton.rjb.Test').new
|
883
|
+
uri = import('java.net.URI')
|
884
|
+
ret = test.java_typed_array(['a', 'b', 'c'], [1, 2, 3], [uri.new('http://www.artonx.org')])
|
885
|
+
assert_equal '[Ljava.lang.String;', ret[0]
|
886
|
+
assert_equal '[Ljava.lang.Integer;', ret[1]
|
887
|
+
assert_equal '[Ljava.net.URI;', ret[2]
|
888
|
+
end
|
881
889
|
end
|
882
890
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rjb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.4.
|
4
|
+
version: 1.4.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- arton
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-06-
|
11
|
+
date: 2013-06-23 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: |
|
14
14
|
RJB is a bridge program that connect between Ruby and Java with Java Native Interface.
|
@@ -45,6 +45,7 @@ files:
|
|
45
45
|
- test/test_osxjvm.rb
|
46
46
|
- test/test_osxload.rb
|
47
47
|
- test/test_unload.rb
|
48
|
+
- test/Test$TestTypes.class
|
48
49
|
- test/Two.class
|
49
50
|
- test/TwoCaller.class
|
50
51
|
- test/jp/co/infoseek/hp/arton/rjb/CallbackTest$Callback.class
|