rjb 1.5.8 → 1.5.9

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2786fa639546b77fac490cfd59ce4b41d52ecb65a45365f73b4e56676f5fef5f
4
- data.tar.gz: 97c3c18969a236cb79ea8eadb885245e7e43b99561c878f25bd5da50e2f3433b
3
+ metadata.gz: b8eddc0f7bf9505a5f48e1098dd18f0133253986978599c40e5c39ce6cc48b90
4
+ data.tar.gz: 880d819371d1cb1c738c2db0c0395873d86391ecef8b056c7597aacf930598ce
5
5
  SHA512:
6
- metadata.gz: c336cae68daa9e4839313bb9f8136d28cbda6cb2e65b921b9e79452b84268ea0e75110841fdbd3947d09602694f480f4d4140ec433dc39fb07cb77f093daaf12
7
- data.tar.gz: 70af9504c3bda50cfca5cae4eb0d30910557557b71e5ededddadc7324e215cc7f1fd301eeb3d46885d19f8cbc241491d332b32df6de4fdfaca5b8903f22982b7
6
+ metadata.gz: ad9b557b9ff3d9091663df6041b63672ba96a2e192f23deba2dbe6dfe94edf09f36176e8894b2e71c8194f68e6f4e23b1e67c9a7064c52c5dea5ce0723be9e14
7
+ data.tar.gz: 7da7f62f72373a83ef662ee62cd37c7fdac28a52c6fc059af337970a7249103858442c304b139945118371c2893ac6057404f619016d4cff758a5aabaffd80f2
data/ChangeLog CHANGED
@@ -1,3 +1,12 @@
1
+ Sun Feb 17 2019 lamby / arton
2
+ * ext/rjb.c
3
+ RJB_VERSION -> 1.5.9
4
+ * ext/depend.erb
5
+ it set javah line by ERB
6
+ * ext/extconf.rb
7
+ change javah to javac -h if it does not exist
8
+ * ext/depend
9
+ replaced by depend.erb
1
10
  Thu Jan 17 2019 arton
2
11
  * ext/rjbexception.c
3
12
  restore method_missing for the exception class
@@ -3,7 +3,7 @@ rjb.o : rjb.c jp_co_infoseek_hp_arton_rjb_RBridge.h riconv.h rjb.h
3
3
  rjbexception.o : rjbexception.c jp_co_infoseek_hp_arton_rjb_RBridge.h riconv.h rjb.h
4
4
  load.o : load.c jp_co_infoseek_hp_arton_rjb_RBridge.h
5
5
  jp_co_infoseek_hp_arton_rjb_RBridge.h : jniwrap.h ../data/rjb/jp/co/infoseek/hp/arton/rjb/RBridge.class
6
- javah -classpath ../data/rjb jp.co.infoseek.hp.arton.rjb.RBridge
6
+ <%= javah %>
7
7
  ../data/rjb/jp/co/infoseek/hp/arton/rjb/RBridge.class : RBridge.java
8
8
  mkdir -p ../data/rjb/jp/co/infoseek/hp/arton/rjb
9
9
  javac -d ../data/rjb RBridge.java
@@ -4,5 +4,5 @@
4
4
  #define HAVE_NL_LANGINFO 1
5
5
  #define HAVE_SETLOCALE 1
6
6
  #define HAVE_GETENV 1
7
- #define RJB_RUBY_VERSION_CODE 260
7
+ #define RJB_RUBY_VERSION_CODE 261
8
8
  #endif
@@ -4,6 +4,7 @@
4
4
  # $Date: $
5
5
  #----------------------------------
6
6
  require 'mkmf'
7
+ require 'erb'
7
8
 
8
9
  class Path
9
10
 
@@ -74,4 +75,13 @@ when /mswin32/
74
75
  when /cygwin/, /mingw/
75
76
  $defs << '-DNONAMELESSUNION'
76
77
  end
78
+
79
+ if find_executable('javah')
80
+ javah = 'javah -classpath ../data/rjb jp.co.infoseek.hp.arton.rjb.RBridge'
81
+ else
82
+ javah = 'javac -h . -classpath ../data/rjb RBridge.java'
83
+ end
84
+ File.open('depend', 'w') do |fout|
85
+ fout.write ERB.new(IO::read('depend.erb')).result
86
+ end
77
87
  create_rjb_makefile
data/ext/rjb.c CHANGED
@@ -14,7 +14,7 @@
14
14
  *
15
15
  */
16
16
 
17
- #define RJB_VERSION "1.5.8"
17
+ #define RJB_VERSION "1.5.9"
18
18
 
19
19
  #include "ruby.h"
20
20
  #include "extconf.h"
@@ -37,6 +37,15 @@ static VALUE get_cause(VALUE self)
37
37
  return rb_funcall(rb_ivar_get(self, rb_intern("@cause")), rb_intern("cause"), 0);
38
38
  }
39
39
 
40
+ static VALUE ex_respond_to(int argc, VALUE* argv, VALUE self)
41
+ {
42
+ if (argc < 1 || argc > 2)
43
+ {
44
+ rb_raise(rb_eArgError, "respond_to? require 1 or 2 arguments");
45
+ }
46
+ return rb_to_id(argv[0]) == rb_intern("to_str") ? Qfalse : Qtrue;
47
+ }
48
+
40
49
  /*
41
50
  * handle Java exception
42
51
  * At this time, the Java exception is defined without the package name.
@@ -67,6 +76,7 @@ VALUE rjb_get_exception_class(JNIEnv* jenv, jstring str)
67
76
  rexp = rb_define_class(pcls, rb_eStandardError);
68
77
  rb_define_method(rexp, "cause", get_cause, 0);
69
78
  rb_define_method(rexp, "method_missing", missing_delegate, -1);
79
+ rb_define_method(rexp, "respond_to?", ex_respond_to, -1);
70
80
  #if defined(HAVE_RB_HASH_ASET) || defined(RUBINIUS)
71
81
  rb_hash_aset(rjb_loaded_classes, cname, rexp);
72
82
  #else
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.5.8
4
+ version: 1.5.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - arton
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-01-17 00:00:00.000000000 Z
11
+ date: 2019-02-17 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: 'RJB is a bridge program that connect between Ruby and Java with Java
14
14
  Native Interface.
@@ -24,7 +24,7 @@ files:
24
24
  - ChangeLog
25
25
  - data/rjb/jp/co/infoseek/hp/arton/rjb/RBridge.class
26
26
  - ext/RBridge.java
27
- - ext/depend
27
+ - ext/depend.erb
28
28
  - ext/extconf.h
29
29
  - ext/extconf.rb
30
30
  - ext/jniwrap.h