rjb 1.3.8 → 1.3.9

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.
data/ChangeLog CHANGED
@@ -1,3 +1,8 @@
1
+ Sat Jan 28 arton
2
+ *ext/rjb.c
3
+ RJB_VERSION -> 1.3.9
4
+ *ext/jniwrap.h
5
+ skip __int64 definition if already defined (for latest mingw/gcc).
1
6
  Sat Dec 03 arton
2
7
  *ext/rjb.c
3
8
  RJB_VERSION -> 1.3.8
@@ -0,0 +1,9 @@
1
+ #ifndef EXTCONF_H
2
+ #define EXTCONF_H
3
+ #define HAVE_JNI_H 1
4
+ #define HAVE_RUBY_DL_H 1
5
+ #define HAVE_NL_LANGINFO 1
6
+ #define HAVE_SETLOCALE 1
7
+ #define HAVE_GETENV 1
8
+ #define RJB_RUBY_VERSION_CODE 193
9
+ #endif
@@ -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: jniwrap.h 4 2006-09-11 15:21:38Z arton $
15
+ * $Id: jniwrap.h 181 2012-01-28 05:28:41Z arton $
16
16
  */
17
17
  #ifndef _Included_jniwrap
18
18
  #define _Included_jniwrap
@@ -21,7 +21,9 @@ extern "C" {
21
21
  #endif
22
22
 
23
23
  #if defined(__GNUC__) && (defined(__CYGWIN32__) || defined(__MINGW32__))
24
- typedef long long __int64;
24
+ #if !defined(__int64)
25
+ typedef long long __int64;
26
+ #endif
25
27
  #endif
26
28
 
27
29
  #include <jni.h>
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 167 2011-07-15 17:40:25Z arton $
15
+ * $Id: load.c 180 2011-12-05 16:34:29Z arton $
16
16
  */
17
17
 
18
18
  #include <stdlib.h>
@@ -271,6 +271,15 @@ static int load_bridge(JNIEnv* jenv)
271
271
  return 0;
272
272
  }
273
273
 
274
+ void rjb_unload_vm()
275
+ {
276
+ if (RTEST(jvmdll))
277
+ {
278
+ rb_funcall(jvmdll, rb_intern("close"), 0);
279
+ jvmdll = Qnil;
280
+ }
281
+ }
282
+
274
283
  int rjb_create_jvm(JNIEnv** pjenv, JavaVMInitArgs* vm_args, char* userpath, VALUE argv)
275
284
  {
276
285
  static JavaVMOption soptions[] = {
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 178 2011-12-02 16:14:56Z arton $
15
+ * $Id: rjb.c 181 2012-01-28 05:28:41Z arton $
16
16
  */
17
17
 
18
- #define RJB_VERSION "1.3.8"
18
+ #define RJB_VERSION "1.3.9"
19
19
 
20
20
  #include "ruby.h"
21
21
  #include "extconf.h"
@@ -1892,6 +1892,7 @@ static VALUE rjb_s_unload(int argc, VALUE* argv, VALUE self)
1892
1892
  (*jenv)->ExceptionClear(jenv);
1893
1893
  result = (*rjb_jvm)->DestroyJavaVM(rjb_jvm);
1894
1894
  rjb_jvm = NULL;
1895
+ rjb_unload_vm();
1895
1896
  }
1896
1897
  return INT2NUM(result);
1897
1898
  }
data/ext/rjb.h 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: rjb.h 139 2010-09-21 17:32:57Z arton $
15
+ * $Id: rjb.h 180 2011-12-05 16:34:29Z arton $
16
16
  * $Log: rjb.h,v $
17
17
  * Revision 1.1 2005/01/16 17:36:10 arton
18
18
  * Initial revision
@@ -72,6 +72,7 @@ extern JNIEnv* rjb_attach_current_thread(void);
72
72
  extern jclass rjb_find_class(JNIEnv* jenv, VALUE name);
73
73
  extern void rjb_release_string(JNIEnv *jenv, jstring str, const char* chrs);
74
74
  extern VALUE rjb_load_vm_default();
75
+ extern void rjb_unload_vm();
75
76
  extern VALUE rjb_safe_funcall(VALUE args);
76
77
  extern VALUE jv2rv(JNIEnv* jenv, jvalue val);
77
78
  extern jobject get_systemloader(JNIEnv* jenv);
data/readme.txt CHANGED
@@ -1,28 +1,35 @@
1
- Rjb is Ruby-Java bridge using Java Native Interface.
2
-
3
- How to install
4
-
5
- you need to install Java2 sdk, and setup JAVA_HOME enviromental varible except for OS X.
6
- I assume that OS X's JAVA_HOME is fixed as '/System/Library/Frameworks/JavaVM.framework'.
7
-
8
- then,
9
-
10
- ruby setup.rb config
11
- ruby setup.rb setup
12
-
13
- (in Unix)
14
- sudo ruby setup.rb install
15
- or
16
- (in win32)
17
- ruby setup.rb install
18
-
19
- How to test
20
- in Win32
21
- cd test
22
- ruby test.rb
23
-
24
- in Unix
25
- see test/readme.unix
26
- you must set LD_LIBRARY_PATH environmental variable to run rjb.
27
-
28
- artonx@yahoo.co.jp
1
+ Rjb is Ruby-Java bridge using Java Native Interface.
2
+
3
+ How to install
4
+
5
+ you need to install Java2 sdk, and setup JAVA_HOME enviromental varible except for OS X.
6
+ I assume that OS X's JAVA_HOME is fixed as '/System/Library/Frameworks/JavaVM.framework'.
7
+
8
+ then,
9
+
10
+ ruby setup.rb config
11
+ ruby setup.rb setup
12
+
13
+ (in Unix)
14
+ sudo ruby setup.rb install
15
+ or
16
+ (in win32)
17
+ ruby setup.rb install
18
+
19
+ How to test
20
+ in Win32
21
+ cd test
22
+ ruby test.rb
23
+
24
+ in Unix
25
+ see test/readme.unix
26
+ you must set LD_LIBRARY_PATH environmental variable to run rjb.
27
+
28
+ -- Notice for opening non-ASCII 7bit filename
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
+ For example in Rails, set above line in production.rb as your environment.
31
+ ENV['LC_ALL'] = 'en_us.utf8' # or ja_JP.utf8 etc.
32
+ cf: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4733494
33
+ (Thanks Paul for this information).
34
+
35
+ artonx@yahoo.co.jp
File without changes
File without changes
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: rjb
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 1.3.8
5
+ version: 1.3.9
6
6
  platform: ruby
7
7
  authors:
8
8
  - arton
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-12-02 00:00:00 Z
13
+ date: 2012-01-28 00:00:00 Z
14
14
  dependencies: []
15
15
 
16
16
  description: |
@@ -31,6 +31,7 @@ files:
31
31
  - ext/rjb.c
32
32
  - ext/jp_co_infoseek_hp_arton_rjb_RBridge.h
33
33
  - ext/riconv.h
34
+ - ext/extconf.h
34
35
  - ext/jniwrap.h
35
36
  - ext/rjb.h
36
37
  - ext/depend
@@ -44,11 +45,9 @@ files:
44
45
  - test/test_unload.rb
45
46
  - test/test_osxjvm.rb
46
47
  - test/gctest.rb
47
- - test/jp/co/infoseek/hp/arton/rjb/Base.class
48
48
  - test/jp/co/infoseek/hp/arton/rjb/IBase.class
49
49
  - test/jp/co/infoseek/hp/arton/rjb/Test.class
50
50
  - test/jp/co/infoseek/hp/arton/rjb/Test$TestTypes.class
51
- - test/jp/co/infoseek/hp/arton/rjb/ExtBase.class
52
51
  - test/TwoCaller.class
53
52
  - test/Two.class
54
53
  - test/rjbtest.jar