rjb 1.1.7 → 1.1.8
Sign up to get free protection for your applications and to get access to all the features.
- data/ChangeLog +5 -0
- data/ext/load.c +23 -7
- data/ext/rjb.c +2 -2
- metadata +46 -40
- data/ext/extconf.h +0 -9
data/ChangeLog
CHANGED
data/ext/load.c
CHANGED
@@ -12,7 +12,7 @@
|
|
12
12
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
13
13
|
* Lesser General Public License for more details.
|
14
14
|
*
|
15
|
-
* $Id: load.c
|
15
|
+
* $Id: load.c 91 2009-09-07 14:13:17Z arton $
|
16
16
|
*/
|
17
17
|
|
18
18
|
#include <stdlib.h>
|
@@ -45,7 +45,7 @@
|
|
45
45
|
#endif
|
46
46
|
#define CLASSPATH_SEP ';'
|
47
47
|
#elif defined(__APPLE__) && defined(__MACH__)
|
48
|
-
|
48
|
+
static char* JVMDLL = "%s/Libraries/libjvm_compat.dylib";
|
49
49
|
#define DIRSEPARATOR '/'
|
50
50
|
#define CLASSPATH_SEP ':'
|
51
51
|
#define HOME_NAME "/Home"
|
@@ -82,6 +82,14 @@
|
|
82
82
|
#define CLASSPATH_SEP ':'
|
83
83
|
#endif
|
84
84
|
|
85
|
+
#if defined(__APPLE__) && defined(__MACH__)
|
86
|
+
static char* CREATEJVM = "JNI_CreateJavaVM";
|
87
|
+
static char* GETDEFAULTJVMINITARGS = "JNI_GetDefaultJavaVMInitArgs";
|
88
|
+
#else
|
89
|
+
#define CREATEJVM "JNI_CreateJavaVM"
|
90
|
+
#define GETDEFAULTJVMINITARGS "JNI_GetDefaultJavaVMInitArgs"
|
91
|
+
#endif
|
92
|
+
|
85
93
|
typedef int (*GETDEFAULTJAVAVMINITARGS)(void*);
|
86
94
|
typedef int (*CREATEJAVAVM)(JavaVM**, JNIEnv**, void*);
|
87
95
|
|
@@ -172,11 +180,11 @@ static int load_jvm(char* jvmtype)
|
|
172
180
|
}
|
173
181
|
/* get function pointers of JNI */
|
174
182
|
#if RJB_RUBY_VERSION_CODE < 190
|
175
|
-
getdefaultjavavminitargsfunc = rb_funcall(rb_funcall(rb_funcall(jvmdll, rb_intern("[]"), 2, rb_str_new2(
|
176
|
-
createjavavmfunc = rb_funcall(rb_funcall(rb_funcall(jvmdll, rb_intern("[]"), 2, rb_str_new2(
|
183
|
+
getdefaultjavavminitargsfunc = rb_funcall(rb_funcall(rb_funcall(jvmdll, rb_intern("[]"), 2, rb_str_new2(GETDEFAULTJVMINITARGS), rb_str_new2("IP")), rb_intern("to_ptr"), 0), rb_intern("to_i"), 0);
|
184
|
+
createjavavmfunc = rb_funcall(rb_funcall(rb_funcall(jvmdll, rb_intern("[]"), 2, rb_str_new2(CREATEJVM), rb_str_new2("IPPP")), rb_intern("to_ptr"), 0), rb_intern("to_i"), 0);
|
177
185
|
#else
|
178
|
-
getdefaultjavavminitargsfunc = rb_funcall(jvmdll, rb_intern("[]"), 1, rb_str_new2(
|
179
|
-
createjavavmfunc = rb_funcall(jvmdll, rb_intern("[]"), 1, rb_str_new2(
|
186
|
+
getdefaultjavavminitargsfunc = rb_funcall(jvmdll, rb_intern("[]"), 1, rb_str_new2(GETDEFAULTJVMINITARGS));
|
187
|
+
createjavavmfunc = rb_funcall(jvmdll, rb_intern("[]"), 1, rb_str_new2(CREATEJVM));
|
180
188
|
#endif
|
181
189
|
return 1;
|
182
190
|
}
|
@@ -256,7 +264,15 @@ int rjb_create_jvm(JNIEnv** pjenv, JavaVMInitArgs* vm_args, char* userpath, VALU
|
|
256
264
|
|
257
265
|
if (!RTEST(jvmdll))
|
258
266
|
{
|
259
|
-
|
267
|
+
#if defined(__APPLE__) && defined(__MACH__)
|
268
|
+
if (!(load_jvm(JVM_TYPE) || load_jvm(ALT_JVM_TYPE)))
|
269
|
+
{
|
270
|
+
JVMDLL = "%s/Libraries/libjvm.dylib";
|
271
|
+
CREATEJVM = "JNI_CreateJavaVM_Impl";
|
272
|
+
GETDEFAULTJVMINITARGS = "JNI_GetDefaultJavaVMInitArgs_Impl";
|
273
|
+
}
|
274
|
+
#endif
|
275
|
+
if (!(load_jvm(JVM_TYPE) || load_jvm(ALT_JVM_TYPE)))
|
260
276
|
{
|
261
277
|
return -1;
|
262
278
|
}
|
data/ext/rjb.c
CHANGED
@@ -12,10 +12,10 @@
|
|
12
12
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
13
13
|
* Lesser General Public License for more details.
|
14
14
|
*
|
15
|
-
* $Id: rjb.c
|
15
|
+
* $Id: rjb.c 91 2009-09-07 14:13:17Z arton $
|
16
16
|
*/
|
17
17
|
|
18
|
-
#define RJB_VERSION "1.1.
|
18
|
+
#define RJB_VERSION "1.1.8"
|
19
19
|
|
20
20
|
#include "ruby.h"
|
21
21
|
#include "extconf.h"
|
metadata
CHANGED
@@ -1,43 +1,35 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
|
-
rubygems_version: 0.9.0
|
3
|
-
specification_version: 1
|
4
2
|
name: rjb
|
5
3
|
version: !ruby/object:Gem::Version
|
6
|
-
version: 1.1.
|
7
|
-
date: 2009-02-15 00:00:00 +09:00
|
8
|
-
summary: Ruby Java bridge
|
9
|
-
require_paths:
|
10
|
-
- lib
|
11
|
-
email: artonx@gmail.com
|
12
|
-
homepage: http://rjb.rubyforge.org/
|
13
|
-
rubyforge_project:
|
14
|
-
description: RJB is a bridge program that connect between Ruby and Java with Java Native Interface.
|
15
|
-
autorequire:
|
16
|
-
default_executable:
|
17
|
-
bindir: bin
|
18
|
-
has_rdoc: false
|
19
|
-
required_ruby_version: !ruby/object:Gem::Version::Requirement
|
20
|
-
requirements:
|
21
|
-
- - ">="
|
22
|
-
- !ruby/object:Gem::Version
|
23
|
-
version: 1.8.2
|
24
|
-
version:
|
4
|
+
version: 1.1.8
|
25
5
|
platform: ruby
|
26
|
-
signing_key:
|
27
|
-
cert_chain:
|
28
|
-
post_install_message:
|
29
6
|
authors:
|
30
7
|
- arton
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
|
12
|
+
date: 2009-09-07 00:00:00 +09:00
|
13
|
+
default_executable:
|
14
|
+
dependencies: []
|
15
|
+
|
16
|
+
description: RJB is a bridge program that connect between Ruby and Java with Java Native Interface.
|
17
|
+
email: artonx@gmail.com
|
18
|
+
executables: []
|
19
|
+
|
20
|
+
extensions:
|
21
|
+
- ext/extconf.rb
|
22
|
+
extra_rdoc_files: []
|
23
|
+
|
31
24
|
files:
|
32
25
|
- ext/RBridge.java
|
33
|
-
- ext/rjbexception.c
|
34
|
-
- ext/riconv.c
|
35
26
|
- ext/load.c
|
27
|
+
- ext/riconv.c
|
36
28
|
- ext/rjb.c
|
29
|
+
- ext/rjbexception.c
|
37
30
|
- ext/jniwrap.h
|
38
|
-
- ext/riconv.h
|
39
31
|
- ext/jp_co_infoseek_hp_arton_rjb_RBridge.h
|
40
|
-
- ext/
|
32
|
+
- ext/riconv.h
|
41
33
|
- ext/rjb.h
|
42
34
|
- ext/depend
|
43
35
|
- data/rjb/jp/co/infoseek/hp/arton/rjb/RBridge.class
|
@@ -45,27 +37,41 @@ files:
|
|
45
37
|
- samples/filechooser.rb
|
46
38
|
- test/gctest.rb
|
47
39
|
- test/test.rb
|
40
|
+
- test/jp/co/infoseek/hp/arton/rjb/Base.class
|
48
41
|
- test/jp/co/infoseek/hp/arton/rjb/ExtBase.class
|
49
|
-
- test/jp/co/infoseek/hp/arton/rjb/Test.class
|
50
42
|
- test/jp/co/infoseek/hp/arton/rjb/IBase.class
|
51
|
-
- test/jp/co/infoseek/hp/arton/rjb/Base.class
|
52
43
|
- test/jp/co/infoseek/hp/arton/rjb/Test$TestTypes.class
|
44
|
+
- test/jp/co/infoseek/hp/arton/rjb/Test.class
|
53
45
|
- COPYING
|
54
46
|
- ChangeLog
|
55
47
|
- readme.sj
|
56
48
|
- readme.txt
|
57
|
-
|
58
|
-
|
49
|
+
has_rdoc: false
|
50
|
+
homepage: http://rjb.rubyforge.org/
|
51
|
+
post_install_message:
|
59
52
|
rdoc_options: []
|
60
53
|
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
-
|
54
|
+
require_paths:
|
55
|
+
- lib
|
56
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
57
|
+
requirements:
|
58
|
+
- - ">="
|
59
|
+
- !ruby/object:Gem::Version
|
60
|
+
version: 1.8.2
|
61
|
+
version:
|
62
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
63
|
+
requirements:
|
64
|
+
- - ">="
|
65
|
+
- !ruby/object:Gem::Version
|
66
|
+
version: "0"
|
67
|
+
version:
|
67
68
|
requirements:
|
68
69
|
- none
|
69
70
|
- JDK 5.0
|
70
|
-
|
71
|
-
|
71
|
+
rubyforge_project:
|
72
|
+
rubygems_version: 1.3.1
|
73
|
+
signing_key:
|
74
|
+
specification_version: 2
|
75
|
+
summary: Ruby Java bridge
|
76
|
+
test_files:
|
77
|
+
- test/test.rb
|