rjb 1.4.6 → 1.4.7
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 +7 -0
- data/ChangeLog +64 -52
- data/ext/extconf.h +1 -1
- data/ext/jp_co_infoseek_hp_arton_rjb_RBridge.h +21 -21
- data/ext/load.c +46 -16
- data/ext/rjb.c +5 -8
- data/test/test.rb +9 -0
- metadata +24 -28
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA1:
|
|
3
|
+
metadata.gz: 8aa00e04a681cc120889e76d4fd3510f7d5a2623
|
|
4
|
+
data.tar.gz: 0dc99b76f4d14ae46237cf3efe853954ffd2ae44
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: 8f5432b1983b8e6a1d316026b3d18bb63c250fb54e12c42f58fba1a2366e9af359e24ff7b50e71e5cb38f8eb2dc387c8d433c3d240592499a165a1c6e35db848
|
|
7
|
+
data.tar.gz: 1a49b468b18692ce79da777498bee35f7b0d88e5996f36adae942df91a19b90a28e7fc6b672ec4930eef0d33e15bf4053853d787b255132c96c04890c5a5de7d
|
data/ChangeLog
CHANGED
|
@@ -1,3 +1,19 @@
|
|
|
1
|
+
Tue Jun 18 2013 arton
|
|
2
|
+
*ext/load.c
|
|
3
|
+
check fiddler has dlopen (after ruby 2.0).
|
|
4
|
+
Tue Jun 18 2013 arton
|
|
5
|
+
*ext/rjb.c
|
|
6
|
+
RJB_VERSION -> 1.4.7
|
|
7
|
+
*ext/load.c
|
|
8
|
+
rqeuire fiddle first, then dl. the patch originally created by Victor Lellis.
|
|
9
|
+
Fri May 17 2013 arton
|
|
10
|
+
*test/test.rb
|
|
11
|
+
add Byte test
|
|
12
|
+
Sun Apr 48 2013 arton
|
|
13
|
+
*ext/rjb.o
|
|
14
|
+
remove binary
|
|
15
|
+
*ext/rjb.obj
|
|
16
|
+
remove binary
|
|
1
17
|
Sat Jan 26 2013 arton
|
|
2
18
|
*ext/rjb.c
|
|
3
19
|
RJB_VERSION -> 1.4.6 for new gem
|
|
@@ -7,7 +23,7 @@ Sun Jan 13 2013 arton
|
|
|
7
23
|
*test/test.rb
|
|
8
24
|
add bignum argument test
|
|
9
25
|
*ext/rjb.c
|
|
10
|
-
accept bignum argument for 'J'
|
|
26
|
+
accept bignum argument for 'J'
|
|
11
27
|
this bug(or at least mis spec.) was pointed by janroesner. Thanks janroesner !
|
|
12
28
|
Tue Dec 17 arton
|
|
13
29
|
*test/test.rb
|
|
@@ -92,7 +108,7 @@ Mon Jul 18 arton
|
|
|
92
108
|
*test/test.rb
|
|
93
109
|
add anonymous inner class test
|
|
94
110
|
*test/Two.java
|
|
95
|
-
for anonymous inner class test
|
|
111
|
+
for anonymous inner class test
|
|
96
112
|
*test/TwoCaller.java
|
|
97
113
|
for anonymous inner class test
|
|
98
114
|
Sat Jul 16 arton
|
|
@@ -133,7 +149,7 @@ Tue Oct 26 arton
|
|
|
133
149
|
Sun Oct 24 arton
|
|
134
150
|
*sample/filechooser.rb
|
|
135
151
|
omit Thread use (cause JVM crush with 1.9 and StackOverflow with 1.8)
|
|
136
|
-
Sat Oct 23 arton
|
|
152
|
+
Sat Oct 23 arton
|
|
137
153
|
*ext/rjb.c
|
|
138
154
|
RJV_VERSION -> 1.3.0
|
|
139
155
|
add loaded? class method.
|
|
@@ -200,22 +216,22 @@ Wed Jun 9 arton
|
|
|
200
216
|
accept JAVA_HOME having an extra slash at the end
|
|
201
217
|
*ext/rjb.c
|
|
202
218
|
RJB_VERSION -> 1.2.5
|
|
203
|
-
Fri Jun 5 arton
|
|
219
|
+
Fri Jun 5 arton
|
|
204
220
|
*ext/rjb.h
|
|
205
221
|
defin HAVE_LONG_LONG if no HAVE_LONG_LONG but LP64
|
|
206
222
|
*ext/rjb.c
|
|
207
223
|
remove unused variables
|
|
208
|
-
RJB_VERSION -> 1.2.4
|
|
224
|
+
RJB_VERSION -> 1.2.4
|
|
209
225
|
Fri Jun 4 arton
|
|
210
226
|
*ext/riconv.c
|
|
211
227
|
remove unused function if build with Ruby 1.9
|
|
212
228
|
*ext/rjb.c
|
|
213
|
-
RJB_VERSION -> 1.2.3
|
|
214
|
-
to accomodate with rubinius
|
|
215
|
-
*ext/load.c
|
|
216
|
-
to accomodate with rubinius
|
|
229
|
+
RJB_VERSION -> 1.2.3
|
|
230
|
+
to accomodate with rubinius
|
|
231
|
+
*ext/load.c
|
|
232
|
+
to accomodate with rubinius
|
|
217
233
|
*ext/rjbexception.c
|
|
218
|
-
to accomodate with rubinius
|
|
234
|
+
to accomodate with rubinius
|
|
219
235
|
Sun May 30 arton
|
|
220
236
|
*lib/rjbextension.rb
|
|
221
237
|
Rjb extension from Andreas Ronge's neo4j
|
|
@@ -226,8 +242,8 @@ Sun May 30 arton
|
|
|
226
242
|
*test/rjbtest.jar
|
|
227
243
|
test file for rjbextension.rb
|
|
228
244
|
Sat May 29 arton on behalf of atoulme
|
|
229
|
-
*ext/rjb.c
|
|
230
|
-
*ext/load.c
|
|
245
|
+
*ext/rjb.c
|
|
246
|
+
*ext/load.c
|
|
231
247
|
*ext/rjbexception.c
|
|
232
248
|
to accomodate with rubinius
|
|
233
249
|
thanks atoulme !
|
|
@@ -251,7 +267,7 @@ Tue Mar 16 arton
|
|
|
251
267
|
*ext/riconv.c
|
|
252
268
|
change locale setting "" to "C", fixed by Fabien Sartor (rjb-Bugs-27968)
|
|
253
269
|
*ext/rjb.c
|
|
254
|
-
RJB_VERSION -> 1.2.1
|
|
270
|
+
RJB_VERSION -> 1.2.1
|
|
255
271
|
Sun Nov 1 arton
|
|
256
272
|
*ext/load.c
|
|
257
273
|
load jvm pointed by JVM_LIB environment variable first (suggested by Ittay Dror).
|
|
@@ -289,7 +305,7 @@ Thu Feb 5 kuwa1
|
|
|
289
305
|
*ext/load.c
|
|
290
306
|
fix for ruby19
|
|
291
307
|
Sun Nov 16 arton
|
|
292
|
-
*ext/load.c
|
|
308
|
+
*ext/load.c
|
|
293
309
|
apply hpux patch, contributed by Ittay Dror. thanks
|
|
294
310
|
Tue Aug 26 arton
|
|
295
311
|
*ext/load.c, rjb.c, rjb.h
|
|
@@ -314,13 +330,13 @@ Mon May 26 arton
|
|
|
314
330
|
use macroes for loading classes
|
|
315
331
|
*ext/load.c
|
|
316
332
|
adjust OS X's directory
|
|
317
|
-
*ext/extconf.rb
|
|
318
|
-
adjust OS X's directory if Home exists
|
|
333
|
+
*ext/extconf.rb
|
|
334
|
+
adjust OS X's directory if Home exists
|
|
319
335
|
Thu Mar 27 arton
|
|
320
336
|
*ext/rjb.c
|
|
321
337
|
mark version 1.1.4 for the next release.
|
|
322
338
|
*test/test.rb
|
|
323
|
-
remove unload, because it fails.
|
|
339
|
+
remove unload, because it fails.
|
|
324
340
|
It's more important to assert each functions.
|
|
325
341
|
Thu Mar 27 arton
|
|
326
342
|
*ext/riconv.c
|
|
@@ -342,7 +358,7 @@ Tue Mar 4 Kuwashima
|
|
|
342
358
|
*test/test.rb
|
|
343
359
|
add Rjb::unbind
|
|
344
360
|
*test/test.rb
|
|
345
|
-
add loading rubygems
|
|
361
|
+
add loading rubygems
|
|
346
362
|
Sat Feb 23 arton
|
|
347
363
|
*test/test.rb
|
|
348
364
|
let test_field metod use Test.class instead of Point.class
|
|
@@ -358,8 +374,8 @@ Wed Jan 9 arton
|
|
|
358
374
|
*ext/rjb.h
|
|
359
375
|
add some ruby macros that defined after 1.8.6 for compatibility
|
|
360
376
|
Change RBridge.class by 1.4.2
|
|
361
|
-
*data/rjb/jp/co/infoseek/hp/arton/rjb/RBridge.class
|
|
362
|
-
compiled by 1.4.2 version of Java
|
|
377
|
+
*data/rjb/jp/co/infoseek/hp/arton/rjb/RBridge.class
|
|
378
|
+
compiled by 1.4.2 version of Java
|
|
363
379
|
*rjb.c
|
|
364
380
|
mark version 1.1.2 for the next release.
|
|
365
381
|
Tue Dec 27 Kuwashima
|
|
@@ -424,17 +440,15 @@ Sun Jun 17 arton
|
|
|
424
440
|
add a test for the method alias feature.
|
|
425
441
|
Tue Nov 21 arton
|
|
426
442
|
*rjb.c
|
|
427
|
-
Skip the constant registering process, if the constant was already defined.
|
|
443
|
+
Skip the constant registering process, if the constant was already defined.
|
|
428
444
|
*load.c
|
|
429
445
|
*rjb.c
|
|
430
446
|
*rjbexception.c
|
|
431
|
-
*rjb.h
|
|
447
|
+
*rjb.h
|
|
432
448
|
add prefix 'rjb' for externed symbol names to avoid confliction.
|
|
433
|
-
|
|
434
449
|
Sun Oct 08 arton (on behalf of richard apodaca)
|
|
435
450
|
*load.c
|
|
436
451
|
support AMD64
|
|
437
|
-
|
|
438
452
|
Mon Sep 11 arton
|
|
439
453
|
*test.rb
|
|
440
454
|
add a test of arguments types are various array.
|
|
@@ -457,13 +471,12 @@ Tue Aug 1 arton
|
|
|
457
471
|
add for remove previous installed rjb.so.
|
|
458
472
|
*rjb.rake
|
|
459
473
|
add for build Gem.
|
|
460
|
-
*rjb.rb
|
|
474
|
+
*rjb.rb
|
|
461
475
|
for preparing the pathname constant of the bridge class.
|
|
462
476
|
*depend
|
|
463
477
|
chage binary name from rjb.so to rjbcore.so
|
|
464
478
|
*extconf.rb
|
|
465
479
|
chage binary name from rjb.so to rjbcore.so
|
|
466
|
-
|
|
467
480
|
Mon Jul 31 arton
|
|
468
481
|
*load.c
|
|
469
482
|
fix buffer allocation
|
|
@@ -472,14 +485,13 @@ Sun Jul 16 (Jun 22) Kuwashima and arton
|
|
|
472
485
|
*rjb.c
|
|
473
486
|
version 0.2.8
|
|
474
487
|
*MANIFEST
|
|
475
|
-
*depend
|
|
488
|
+
*depend
|
|
476
489
|
*load.c
|
|
477
490
|
*rjbexception.c
|
|
478
491
|
change jni.h to jniwrap.h.
|
|
479
492
|
change the bridge class's header according to JDK 5.0's javah.
|
|
480
493
|
*jniwrap.h
|
|
481
494
|
wrap jni.h for Cygin
|
|
482
|
-
|
|
483
495
|
Sat Jun 10 14:10:05 2006 arton
|
|
484
496
|
*rjb.c
|
|
485
497
|
version 0.2.7
|
|
@@ -495,19 +507,19 @@ Wed Apr 12 03:57:12 2006 arton
|
|
|
495
507
|
*rjb.c
|
|
496
508
|
version 0.2.6
|
|
497
509
|
support an array of arrays.
|
|
498
|
-
*test.rb
|
|
510
|
+
*test.rb
|
|
499
511
|
add an array of arrays test, some tests are contributed by Darren Day.
|
|
500
512
|
*Test.java
|
|
501
513
|
add a test method that returns an array of arrays, some tests are
|
|
502
514
|
contributed by Darren Day.
|
|
503
|
-
|
|
515
|
+
|
|
504
516
|
Sat Dec 24 18:56:38 2005 arton
|
|
505
517
|
*rjb.c
|
|
506
518
|
version 0.2.5
|
|
507
519
|
release String, Float, Array object after method call.
|
|
508
520
|
*gctest.rb
|
|
509
521
|
add for String object gc test
|
|
510
|
-
|
|
522
|
+
|
|
511
523
|
Mon Sep 19 01:09:30 2005 arton
|
|
512
524
|
*rjb.c
|
|
513
525
|
version 0.2.4
|
|
@@ -515,7 +527,7 @@ Mon Sep 19 01:09:30 2005 arton
|
|
|
515
527
|
omit unused local variable from jstring2val
|
|
516
528
|
*test.rb
|
|
517
529
|
add null string test (bug since utf-8 support)
|
|
518
|
-
|
|
530
|
+
|
|
519
531
|
Tue Jun 28 01:57:07 2005 arton
|
|
520
532
|
*rjb.c
|
|
521
533
|
version 0.2.3
|
|
@@ -523,7 +535,7 @@ Tue Jun 28 01:57:07 2005 arton
|
|
|
523
535
|
call Class#forName if argument count is 1
|
|
524
536
|
*test.rb
|
|
525
537
|
add test_importobj contributed by Mr. Kuwashima, thanks.
|
|
526
|
-
|
|
538
|
+
|
|
527
539
|
Mon Jun 27 20:30:50 2005 arton
|
|
528
540
|
treat Class.forName as Rjb::import
|
|
529
541
|
*rjb.c
|
|
@@ -532,7 +544,7 @@ Mon Jun 27 20:30:50 2005 arton
|
|
|
532
544
|
if pass imported object to JVM, extract Class object from ruby object
|
|
533
545
|
*test.rb
|
|
534
546
|
add above tests
|
|
535
|
-
|
|
547
|
+
|
|
536
548
|
Sat Jun 25 05:58:36 2005 arton
|
|
537
549
|
most bugs were reported by Mr. Micael Weller, thanks.
|
|
538
550
|
*rjb.c
|
|
@@ -540,12 +552,12 @@ Sat Jun 25 05:58:36 2005 arton
|
|
|
540
552
|
correct derived static method search
|
|
541
553
|
search class methods then class's instance methods when called by class
|
|
542
554
|
avoid register non capitalized named constants into constants table
|
|
543
|
-
correct capitalized named method search
|
|
555
|
+
correct capitalized named method search
|
|
544
556
|
*riconv.c
|
|
545
557
|
never call iconv if $KCODE is nil
|
|
546
558
|
*load.c
|
|
547
559
|
using path separator ; for cygwin (by Ryugate)
|
|
548
|
-
|
|
560
|
+
|
|
549
561
|
Sun Apr 24 05:26:16 2005 arton
|
|
550
562
|
*rb.c
|
|
551
563
|
version 0.2.0
|
|
@@ -553,7 +565,7 @@ Sun Apr 24 05:26:16 2005 arton
|
|
|
553
565
|
load can take the second argument for jvm
|
|
554
566
|
*load.c
|
|
555
567
|
load can take the second argument for jvm
|
|
556
|
-
|
|
568
|
+
|
|
557
569
|
Mon Jan 17 02:40:21 2005 arton
|
|
558
570
|
*rjb.c
|
|
559
571
|
add 'throw' module function.
|
|
@@ -564,7 +576,7 @@ Mon Jan 17 02:40:21 2005 arton
|
|
|
564
576
|
java exception handling functions, and 'throw' module function.
|
|
565
577
|
*test.rb
|
|
566
578
|
adding throw test.
|
|
567
|
-
|
|
579
|
+
|
|
568
580
|
Wed Jan 12 00:01:08 2005 Kaspar Schiess and arton
|
|
569
581
|
*rjb.c
|
|
570
582
|
correct Rjb::load parameter evaluation (classpath).
|
|
@@ -585,12 +597,12 @@ Sun Nov 21 02:51:43 2004 Kuwashima and arton
|
|
|
585
597
|
Tue Oct 5 23:08:59 2004 Kuwashima and arton
|
|
586
598
|
*test.rb
|
|
587
599
|
add kanji conversion test
|
|
588
|
-
*rjb.c
|
|
600
|
+
*rjb.c
|
|
589
601
|
add dbcs(sjis and euc-jp) - utf-8 auto conversion feature.
|
|
590
602
|
the patch was contributed by Mr.Kuwashima, many thanks.
|
|
591
|
-
|
|
603
|
+
|
|
592
604
|
Sun Oct 3 18:24:42 2004 arton
|
|
593
|
-
*load.c
|
|
605
|
+
*load.c
|
|
594
606
|
JNIEnv* now using local variable instead of global one.
|
|
595
607
|
Because AWT event use a worker thread, and JNI need thread's owned JNIEnv.
|
|
596
608
|
*rjb.c
|
|
@@ -600,24 +612,24 @@ Sun Oct 3 18:24:42 2004 arton
|
|
|
600
612
|
and gave me some test codes.
|
|
601
613
|
and attach_current_thread is from Mr.Kuwashima's patch.
|
|
602
614
|
Many thanks to Mr.Kuwashima.
|
|
603
|
-
|
|
615
|
+
|
|
604
616
|
Sat Sep 25 03:25:45 2004 arton
|
|
605
|
-
*rjb.c
|
|
617
|
+
*rjb.c
|
|
606
618
|
implements interface's method argument conversion.
|
|
607
619
|
*test.rb
|
|
608
620
|
add Comparable test (interface with method arguments)
|
|
609
|
-
*Test.java
|
|
621
|
+
*Test.java
|
|
610
622
|
add Comparable test method.
|
|
611
623
|
|
|
612
|
-
Wed Sep 22 02:30:15 2004 arton
|
|
613
|
-
*rjb.c
|
|
624
|
+
Wed Sep 22 02:30:15 2004 arton
|
|
625
|
+
*rjb.c
|
|
614
626
|
correct constants load, using mid-class.
|
|
615
627
|
convert null string to nil
|
|
616
|
-
|
|
617
|
-
Wed Sep 22 00:05:32 2004 arton
|
|
618
|
-
*rjb.c
|
|
628
|
+
|
|
629
|
+
Wed Sep 22 00:05:32 2004 arton
|
|
630
|
+
*rjb.c
|
|
619
631
|
correct ruby type checking. If the parameter type is java.lang.String, rjb instance is always accepted.
|
|
620
|
-
|
|
632
|
+
|
|
621
633
|
Mon Sep 20 22:02:53 2004 arton
|
|
622
634
|
*rjb.c
|
|
623
635
|
checking method/constructor signature with class when the argument is rjb's instance.
|
|
@@ -626,9 +638,9 @@ Sun Sep 19 00:54:35 2004 arton
|
|
|
626
638
|
convert Java exception to Ruby's StandardError derived class.
|
|
627
639
|
checking method/constructor signature when invoking if no signatur argument is supplied.
|
|
628
640
|
adding field accessor.
|
|
629
|
-
|
|
641
|
+
|
|
630
642
|
Sun Sep 12 21:42:00 2004 arton
|
|
631
|
-
*rjb.c
|
|
643
|
+
*rjb.c
|
|
632
644
|
call exception description when verbose = true.
|
|
633
645
|
correct recursive import call (for Boolean).
|
|
634
646
|
corrent method not found message creation.
|
data/ext/extconf.h
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
/* DO NOT EDIT THIS FILE - it is machine generated */
|
|
2
|
-
#include <jni.h>
|
|
3
|
-
/* Header for class jp_co_infoseek_hp_arton_rjb_RBridge */
|
|
4
|
-
|
|
5
|
-
#ifndef _Included_jp_co_infoseek_hp_arton_rjb_RBridge
|
|
6
|
-
#define _Included_jp_co_infoseek_hp_arton_rjb_RBridge
|
|
7
|
-
#ifdef __cplusplus
|
|
8
|
-
extern "C" {
|
|
9
|
-
#endif
|
|
10
|
-
/*
|
|
11
|
-
* Class: jp_co_infoseek_hp_arton_rjb_RBridge
|
|
12
|
-
* Method: call
|
|
13
|
-
* Signature: (Ljava/lang/String;Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;
|
|
14
|
-
*/
|
|
15
|
-
JNIEXPORT jobject JNICALL Java_jp_co_infoseek_hp_arton_rjb_RBridge_call
|
|
16
|
-
(JNIEnv *, jobject, jstring, jobject, jobjectArray);
|
|
17
|
-
|
|
18
|
-
#ifdef __cplusplus
|
|
19
|
-
}
|
|
20
|
-
#endif
|
|
21
|
-
#endif
|
|
1
|
+
/* DO NOT EDIT THIS FILE - it is machine generated */
|
|
2
|
+
#include <jni.h>
|
|
3
|
+
/* Header for class jp_co_infoseek_hp_arton_rjb_RBridge */
|
|
4
|
+
|
|
5
|
+
#ifndef _Included_jp_co_infoseek_hp_arton_rjb_RBridge
|
|
6
|
+
#define _Included_jp_co_infoseek_hp_arton_rjb_RBridge
|
|
7
|
+
#ifdef __cplusplus
|
|
8
|
+
extern "C" {
|
|
9
|
+
#endif
|
|
10
|
+
/*
|
|
11
|
+
* Class: jp_co_infoseek_hp_arton_rjb_RBridge
|
|
12
|
+
* Method: call
|
|
13
|
+
* Signature: (Ljava/lang/String;Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;
|
|
14
|
+
*/
|
|
15
|
+
JNIEXPORT jobject JNICALL Java_jp_co_infoseek_hp_arton_rjb_RBridge_call
|
|
16
|
+
(JNIEnv *, jobject, jstring, jobject, jobjectArray);
|
|
17
|
+
|
|
18
|
+
#ifdef __cplusplus
|
|
19
|
+
}
|
|
20
|
+
#endif
|
|
21
|
+
#endif
|
data/ext/load.c
CHANGED
|
@@ -102,28 +102,58 @@ static VALUE jvmdll = Qnil;
|
|
|
102
102
|
static VALUE getdefaultjavavminitargsfunc;
|
|
103
103
|
static VALUE createjavavmfunc;
|
|
104
104
|
|
|
105
|
+
static const char* DLLibs[] = { "fiddle", "dl" };
|
|
106
|
+
static const char* DLNames[] = { "Fiddle", "DL" };
|
|
107
|
+
|
|
108
|
+
static VALUE safe_require(VALUE args)
|
|
109
|
+
{
|
|
110
|
+
return rb_require(StringValueCStr(args));
|
|
111
|
+
}
|
|
112
|
+
|
|
105
113
|
static int open_jvm(char* libpath)
|
|
106
114
|
{
|
|
107
115
|
int sstat;
|
|
108
116
|
VALUE* argv;
|
|
117
|
+
size_t i;
|
|
118
|
+
int state;
|
|
109
119
|
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
rb_raise(rb_eRuntimeError, "Constants DL is not defined.");
|
|
115
|
-
return 0;
|
|
116
|
-
}
|
|
120
|
+
#if defined(RUBINIUS)
|
|
121
|
+
i = 1;
|
|
122
|
+
#else
|
|
123
|
+
i = 0;
|
|
117
124
|
#endif
|
|
118
|
-
|
|
119
|
-
*argv = rb_const_get(rb_cObject, rb_intern("DL"));
|
|
120
|
-
*(argv + 1) = rb_intern("dlopen");
|
|
121
|
-
*(argv + 2) = 1;
|
|
122
|
-
*(argv + 3) = rb_str_new2(libpath);
|
|
123
|
-
jvmdll = rb_protect(rjb_safe_funcall, (VALUE)argv, &sstat);
|
|
124
|
-
if (sstat)
|
|
125
|
+
for (; i < COUNTOF(DLLibs); i++)
|
|
125
126
|
{
|
|
126
|
-
|
|
127
|
+
state = 0;
|
|
128
|
+
rb_protect(safe_require, rb_str_new2(DLLibs[i]), &state);
|
|
129
|
+
#if !defined(RUBINIUS)
|
|
130
|
+
if (state || !rb_const_defined_at(rb_cObject, rb_intern(DLNames[i])))
|
|
131
|
+
{
|
|
132
|
+
if (i > 0)
|
|
133
|
+
{
|
|
134
|
+
rb_raise(rb_eRuntimeError, "Constants DL and Fiddle is not defined.");
|
|
135
|
+
return 0;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
else
|
|
139
|
+
#endif
|
|
140
|
+
{
|
|
141
|
+
sstat = 0;
|
|
142
|
+
argv = ALLOCA_N(VALUE, 4);
|
|
143
|
+
*argv = rb_const_get(rb_cObject, rb_intern(DLNames[i]));
|
|
144
|
+
*(argv + 1) = rb_intern("dlopen");
|
|
145
|
+
*(argv + 2) = 1;
|
|
146
|
+
*(argv + 3) = rb_str_new2(libpath);
|
|
147
|
+
jvmdll = rb_protect(rjb_safe_funcall, (VALUE)argv, &sstat);
|
|
148
|
+
if (!sstat)
|
|
149
|
+
{
|
|
150
|
+
break;
|
|
151
|
+
}
|
|
152
|
+
else if (i > 0)
|
|
153
|
+
{
|
|
154
|
+
return 0;
|
|
155
|
+
}
|
|
156
|
+
}
|
|
127
157
|
}
|
|
128
158
|
/* get function pointers of JNI */
|
|
129
159
|
#if RJB_RUBY_VERSION_CODE < 190
|
|
@@ -302,7 +332,7 @@ int rjb_create_jvm(JNIEnv** pjenv, JavaVMInitArgs* vm_args, char* userpath, VALU
|
|
|
302
332
|
CREATEJAVAVM createjavavm;
|
|
303
333
|
JavaVMOption* options;
|
|
304
334
|
size_t optlen;
|
|
305
|
-
|
|
335
|
+
size_t i;
|
|
306
336
|
VALUE optval;
|
|
307
337
|
|
|
308
338
|
if (!RTEST(jvmdll))
|
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.7"
|
|
19
19
|
|
|
20
20
|
#include "ruby.h"
|
|
21
21
|
#include "extconf.h"
|
|
@@ -1144,7 +1144,7 @@ static void rv2jarray(JNIEnv* jenv, VALUE val, jvalue* jv, const char* psig, int
|
|
|
1144
1144
|
}
|
|
1145
1145
|
else
|
|
1146
1146
|
{
|
|
1147
|
-
VALUE src = rb_str_new(p, len);
|
|
1147
|
+
VALUE src = rb_str_new((char*)p, len);
|
|
1148
1148
|
rb_str_set_len(val, 0);
|
|
1149
1149
|
rb_str_append(val, src);
|
|
1150
1150
|
}
|
|
@@ -2084,7 +2084,7 @@ static VALUE import_class(JNIEnv* jenv, jclass jcls, VALUE clsname)
|
|
|
2084
2084
|
|
|
2085
2085
|
static VALUE rjb_a_initialize(VALUE self, VALUE proc)
|
|
2086
2086
|
{
|
|
2087
|
-
rb_ivar_set(self, anonymousblock, proc);
|
|
2087
|
+
return rb_ivar_set(self, anonymousblock, proc);
|
|
2088
2088
|
}
|
|
2089
2089
|
|
|
2090
2090
|
static VALUE rjb_a_missing(int argc, VALUE* argv, VALUE self)
|
|
@@ -2484,7 +2484,9 @@ static jobject conv_jarname_to_url(JNIEnv* jenv, VALUE jarname)
|
|
|
2484
2484
|
{
|
|
2485
2485
|
jvalue arg;
|
|
2486
2486
|
jobject url;
|
|
2487
|
+
#if defined(DOSISH)
|
|
2487
2488
|
size_t len;
|
|
2489
|
+
#endif
|
|
2488
2490
|
char* jarp;
|
|
2489
2491
|
char* urlp;
|
|
2490
2492
|
|
|
@@ -3141,11 +3143,6 @@ static VALUE find_const(VALUE pv)
|
|
|
3141
3143
|
return rb_const_get(*p, (ID)*(p + 1));
|
|
3142
3144
|
}
|
|
3143
3145
|
|
|
3144
|
-
static VALUE call_blcock(int argc, VALUE* argv)
|
|
3145
|
-
{
|
|
3146
|
-
return rb_yield_values2(argc, argv);
|
|
3147
|
-
}
|
|
3148
|
-
|
|
3149
3146
|
static VALUE rjb_missing(int argc, VALUE* argv, VALUE self)
|
|
3150
3147
|
{
|
|
3151
3148
|
struct jv_data* ptr;
|
data/test/test.rb
CHANGED
|
@@ -869,5 +869,14 @@ class TestRjb < Test::Unit::TestCase
|
|
|
869
869
|
assert true
|
|
870
870
|
end
|
|
871
871
|
end
|
|
872
|
+
def test_bytearg
|
|
873
|
+
b = @jByte.new(32)
|
|
874
|
+
assert_equal(32, b.int_value)
|
|
875
|
+
assert b.compareTo(@jByte.new(32))
|
|
876
|
+
assert b.compareTo(@jByte.value_of(32))
|
|
877
|
+
b = @jByte.new_with_sig('B', 32)
|
|
878
|
+
assert_equal(32, b.int_value)
|
|
879
|
+
assert b.compareTo(@jByte._invoke(:valueOf, 'B', 32))
|
|
880
|
+
end
|
|
872
881
|
end
|
|
873
882
|
|
metadata
CHANGED
|
@@ -1,20 +1,17 @@
|
|
|
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.7
|
|
6
5
|
platform: ruby
|
|
7
6
|
authors:
|
|
8
7
|
- arton
|
|
9
8
|
autorequire:
|
|
10
9
|
bindir: bin
|
|
11
10
|
cert_chain: []
|
|
12
|
-
date: 2013-
|
|
11
|
+
date: 2013-06-18 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:
|
|
@@ -22,39 +19,39 @@ extensions:
|
|
|
22
19
|
extra_rdoc_files: []
|
|
23
20
|
files:
|
|
24
21
|
- ext/RBridge.java
|
|
25
|
-
- ext/rjbexception.c
|
|
26
|
-
- ext/rjb.c
|
|
27
22
|
- ext/load.c
|
|
28
23
|
- ext/riconv.c
|
|
24
|
+
- ext/rjb.c
|
|
25
|
+
- ext/rjbexception.c
|
|
29
26
|
- ext/extconf.h
|
|
30
27
|
- ext/jniwrap.h
|
|
31
28
|
- ext/jp_co_infoseek_hp_arton_rjb_RBridge.h
|
|
32
|
-
- ext/rjb.h
|
|
33
29
|
- ext/riconv.h
|
|
30
|
+
- ext/rjb.h
|
|
34
31
|
- ext/depend
|
|
35
32
|
- data/rjb/jp/co/infoseek/hp/arton/rjb/RBridge.class
|
|
36
|
-
- lib/rjbextension.rb
|
|
37
33
|
- lib/rjb.rb
|
|
34
|
+
- lib/rjbextension.rb
|
|
38
35
|
- samples/filechooser.rb
|
|
39
36
|
- samples/unzip.rb
|
|
40
|
-
- test/jartest.rb
|
|
41
|
-
- test/gctest.rb
|
|
42
|
-
- test/test_osxjvm.rb
|
|
43
|
-
- test/test.rb
|
|
44
37
|
- test/exttest.rb
|
|
45
|
-
- test/
|
|
46
|
-
- test/
|
|
38
|
+
- test/gctest.rb
|
|
39
|
+
- test/jartest.rb
|
|
47
40
|
- test/jartest2.rb
|
|
48
41
|
- test/jartest3.rb
|
|
49
|
-
- test/test_unload.rb
|
|
50
42
|
- test/listtest.rb
|
|
51
|
-
- test/
|
|
52
|
-
- test/
|
|
43
|
+
- test/osx_jvmcheck.rb
|
|
44
|
+
- test/test.rb
|
|
45
|
+
- test/test_osxjvm.rb
|
|
46
|
+
- test/test_osxload.rb
|
|
47
|
+
- test/test_unload.rb
|
|
48
|
+
- test/Two.class
|
|
49
|
+
- test/TwoCaller.class
|
|
53
50
|
- test/jp/co/infoseek/hp/arton/rjb/CallbackTest$Callback.class
|
|
54
51
|
- test/jp/co/infoseek/hp/arton/rjb/CallbackTest.class
|
|
55
52
|
- test/jp/co/infoseek/hp/arton/rjb/IBase.class
|
|
56
|
-
- test/
|
|
57
|
-
- test/
|
|
53
|
+
- test/jp/co/infoseek/hp/arton/rjb/Test$TestTypes.class
|
|
54
|
+
- test/jp/co/infoseek/hp/arton/rjb/Test.class
|
|
58
55
|
- test/jartest.jar
|
|
59
56
|
- test/jartest2.jar
|
|
60
57
|
- test/rjbtest.jar
|
|
@@ -65,29 +62,28 @@ files:
|
|
|
65
62
|
- ext/extconf.rb
|
|
66
63
|
homepage: http://rjb.rubyforge.org/
|
|
67
64
|
licenses: []
|
|
65
|
+
metadata: {}
|
|
68
66
|
post_install_message:
|
|
69
67
|
rdoc_options: []
|
|
70
68
|
require_paths:
|
|
71
69
|
- lib
|
|
72
70
|
required_ruby_version: !ruby/object:Gem::Requirement
|
|
73
|
-
none: false
|
|
74
71
|
requirements:
|
|
75
|
-
- -
|
|
72
|
+
- - '>='
|
|
76
73
|
- !ruby/object:Gem::Version
|
|
77
74
|
version: 1.8.2
|
|
78
75
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
79
|
-
none: false
|
|
80
76
|
requirements:
|
|
81
|
-
- -
|
|
77
|
+
- - '>='
|
|
82
78
|
- !ruby/object:Gem::Version
|
|
83
79
|
version: '0'
|
|
84
80
|
requirements:
|
|
85
81
|
- none
|
|
86
82
|
- JDK 5.0
|
|
87
83
|
rubyforge_project: rjb
|
|
88
|
-
rubygems_version:
|
|
84
|
+
rubygems_version: 2.0.2
|
|
89
85
|
signing_key:
|
|
90
|
-
specification_version:
|
|
86
|
+
specification_version: 4
|
|
91
87
|
summary: Ruby Java bridge
|
|
92
88
|
test_files:
|
|
93
89
|
- test/test.rb
|