rjb 1.1.1-x86-mswin32-60 → 1.1.2-x86-mswin32-60

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,9 +1,17 @@
1
+ Fri Feb 22 arton
2
+ *ext/rjb.c
3
+ mark version 1.1.3 for the next release.
4
+ Fri Feb 22 arton
5
+ *ext/rjb.c
6
+ fix field reference (bug# 18238)
1
7
  Wed Jan 9 arton
2
8
  *ext/rjb.h
3
9
  add some ruby macros that defined after 1.8.6 for compatibility
4
10
  Change RBridge.class by 1.4.2
5
11
  *data/rjb/jp/co/infoseek/hp/arton/rjb/RBridge.class
6
12
  compiled by 1.4.2 version of Java
13
+ *rjb.c
14
+ mark version 1.1.2 for the next release.
7
15
  Tue Dec 27 Kuwashima
8
16
  *test/Test.java
9
17
  *test/test.rb
@@ -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 60 2008-02-21 20:11:37Z arton $
16
16
  */
17
17
  #ifndef _Included_jniwrap
18
18
  #define _Included_jniwrap
@@ -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: riconv.c 45 2007-12-26 20:03:21Z kuwa1 $
15
+ * $Id: riconv.c 58 2008-01-14 08:25:07Z kuwa1 $
16
16
  */
17
17
 
18
18
  #include "ruby.h"
@@ -176,21 +176,21 @@ VALUE exticonv_local_to_utf8(VALUE local_string)
176
176
  return local_string;
177
177
  }
178
178
  #else
179
- VALUE rb_cEncoding, default_external, encoding, ascii8bit;
179
+ VALUE rb_cEncoding, encoding, sjis, eucjp, iso2022jp;
180
180
  rb_cEncoding = rb_const_get(rb_cObject, rb_intern("Encoding"));
181
- default_external = rb_funcall(rb_cEncoding, rb_intern("default_external"), 0);
182
- ascii8bit = rb_const_get(rb_cEncoding, rb_intern("ASCII_8BIT"));
181
+ sjis = rb_const_get(rb_cEncoding, rb_intern("SHIFT_JIS"));
182
+ eucjp = rb_const_get(rb_cEncoding, rb_intern("EUC_JP"));
183
+ iso2022jp = rb_const_get(rb_cEncoding, rb_intern("ISO_2022_JP"));
183
184
  encoding = rb_funcall(local_string, rb_intern("encoding"), 0);
184
185
 
185
- if (ascii8bit == encoding && ascii8bit == default_external)
186
+ if (encoding == sjis || encoding == eucjp || encoding == iso2022jp)
186
187
  {
187
- return local_string; //don't know default encoding
188
+ return rb_funcall(local_string, rb_intern("encode"), 1, rb_str_new2("utf-8"));
188
189
  }
189
- else if (encoding == ascii8bit)
190
+ else
190
191
  {
191
- local_string = rb_funcall(local_string, rb_intern("force_encoding"), 1, default_external);
192
+ return local_string;
192
193
  }
193
- return rb_funcall(local_string, rb_intern("encode"), 1, rb_str_new2("utf-8"));
194
194
  #endif
195
195
  }
196
196
 
@@ -207,19 +207,6 @@ VALUE exticonv_utf8_to_local(VALUE utf8_string)
207
207
  return utf8_string;
208
208
  }
209
209
  #else
210
- VALUE rb_cEncoding, encoding, ascii8bit;
211
- rb_cEncoding = rb_const_get(rb_cObject, rb_intern("Encoding"));
212
- encoding = rb_funcall(rb_cEncoding, rb_intern("default_external"), 0);
213
- ascii8bit = rb_const_get(rb_cEncoding, rb_intern("ASCII_8BIT"));
214
-
215
- utf8_string = rb_funcall(utf8_string, rb_intern("force_encoding"), 1, rb_str_new2("utf-8"));
216
- if (ascii8bit == encoding)
217
- {
218
- return utf8_string; //don't know default encoding
219
- }
220
- else
221
- {
222
- return rb_funcall(utf8_string, rb_intern("encode"), 1, encoding);
223
- }
210
+ return rb_funcall(utf8_string, rb_intern("force_encoding"), 1, rb_str_new2("utf-8"));
224
211
  #endif
225
212
  }
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 52 2007-12-28 07:44:41Z arton $
15
+ * $Id: rjb.c 60 2008-02-21 20:11:37Z arton $
16
16
  */
17
17
 
18
- #define RJB_VERSION "1.1.1"
18
+ #define RJB_VERSION "1.1.2"
19
19
 
20
20
  #include "ruby.h"
21
21
  #include "extconf.h"
@@ -2534,25 +2534,28 @@ static VALUE invoke_by_instance(ID rmid, int argc, VALUE* argv,
2534
2534
  {
2535
2535
  ret = getter(jenv, pf, ptr);
2536
2536
  }
2537
- else if (argc == 1 && *(tname + strlen(tname) - 1) == '=')
2537
+ else
2538
2538
  {
2539
- char* fname = ALLOCA_N(char, strlen(tname) + 1);
2540
- strcpy(fname, tname);
2541
- fname[strlen(tname) - 1] = '\0';
2542
- if (st_lookup(ptr->fields, rb_intern(fname), (st_data_t*)&pf))
2543
- {
2544
- setter(jenv, pf, ptr, *argv);
2545
- return ret;
2539
+ if (argc == 1 && *(tname + strlen(tname) - 1) == '=')
2540
+ {
2541
+ char* fname = ALLOCA_N(char, strlen(tname) + 1);
2542
+ strcpy(fname, tname);
2543
+ fname[strlen(tname) - 1] = '\0';
2544
+ if (st_lookup(ptr->fields, rb_intern(fname), (st_data_t*)&pf))
2545
+ {
2546
+ setter(jenv, pf, ptr, *argv);
2547
+ return ret;
2548
+ }
2549
+ // fall through for the setter alias name
2550
+ }
2551
+ if (st_lookup(ptr->methods, rmid, (st_data_t*)&pm))
2552
+ {
2553
+ ret = invoke(jenv, pm, ptr, argc, argv, sig);
2554
+ }
2555
+ else
2556
+ {
2557
+ rb_raise(rb_eRuntimeError, "Fail: unknown method name `%s'", tname);
2546
2558
  }
2547
- // fall through for the setter alias name
2548
- }
2549
- if (st_lookup(ptr->methods, rmid, (st_data_t*)&pm))
2550
- {
2551
- ret = invoke(jenv, pm, ptr, argc, argv, sig);
2552
- }
2553
- else
2554
- {
2555
- rb_raise(rb_eRuntimeError, "Fail: unknown method name `%s'", tname);
2556
2559
  }
2557
2560
  return ret;
2558
2561
  }
Binary file
@@ -1,5 +1,5 @@
1
1
  #!/usr/local/env ruby
2
- # $Id: test.rb 45 2007-12-26 20:03:21Z kuwa1 $
2
+ # $Id: test.rb 58 2008-01-14 08:25:07Z kuwa1 $
3
3
 
4
4
  require 'test/unit'
5
5
  require 'rjb'
@@ -135,27 +135,33 @@ class TestRjb < Test::Unit::TestCase
135
135
 
136
136
  def test_kjconv()
137
137
  if Object::const_defined?(:Encoding)
138
- euc_kj = "\xb4\xc1\xbb\xfa\xa5\xc6\xa5\xad\xa5\xb9\xa5\xc8".force_encoding "euc-jp"
138
+ test = import('jp.co.infoseek.hp.arton.rjb.Test').new
139
+ euc_kj = "\xb4\xc1\xbb\xfa\xa5\xc6\xa5\xad\xa5\xb9\xa5\xc8".force_encoding Encoding::EUC_JP
139
140
  s = @jString.new(euc_kj)
140
141
  assert_equal(s.toString().encoding, Encoding::UTF_8)
141
- assert_equal(s.toString().encode("euc-jp"), euc_kj)
142
- sjis_kj = "\x8a\xbf\x8e\x9a\x83\x65\x83\x4c\x83\x58\x83\x67".force_encoding "shift_jis"
142
+ assert(test.isSameString(s))
143
+ assert(test.isSameString(euc_kj))
144
+ assert_equal(s.toString().encode(Encoding::EUC_JP), euc_kj)
145
+ sjis_kj = "\x8a\xbf\x8e\x9a\x83\x65\x83\x4c\x83\x58\x83\x67".force_encoding Encoding::SHIFT_JIS
143
146
  s = @jString.new(sjis_kj)
144
- assert_equal(s.toString().encode("shift_jis"), sjis_kj)
145
- utf8_kj = "\xE6\xBC\xA2\xE5\xAD\x97\xE3\x83\x86\xE3\x82\xAD\xE3\x82\xB9\xE3\x83\x88".force_encoding "utf-8"
146
- s = @jString.new(utf8_kj.encode("utf-8"))
147
- assert_equal(s.toString(), utf8_kj)
148
- if /mswin(?!ce)|mingw|cygwin|bccwin/ =~ RUBY_PLATFORM
149
- #expecting shift_jis on windows
150
- none_kj = "\x8a\xbf\x8e\x9a\x83\x65\x83\x4c\x83\x58\x83\x67" #.force_encoding "shift_jis"
151
- s = @jString.new(none_kj)
152
- assert_equal(s.toString().encode("shift_jis"), none_kj)
153
- else
154
- #expecting utf-8 unless windows
155
- none_kj = "\xE6\xBC\xA2\xE5\xAD\x97\xE3\x83\x86\xE3\x82\xAD\xE3\x82\xB9\xE3\x83\x88".force_encoding "utf-8"
156
- s = @jString.new(none_kj)
157
- assert_equal(s.toString(), none_kj)
158
- end
147
+ assert_equal(s.toString().encoding, Encoding::UTF_8)
148
+ assert(test.isSameString(s))
149
+ assert(test.isSameString(sjis_kj))
150
+ assert_equal(s.toString().encode(Encoding::SHIFT_JIS), sjis_kj)
151
+ utf8_kj = "\xE6\xBC\xA2\xE5\xAD\x97\xE3\x83\x86\xE3\x82\xAD\xE3\x82\xB9\xE3\x83\x88".force_encoding Encoding::UTF_8
152
+ s = @jString.new(utf8_kj)
153
+ assert_equal(s.toString().encoding, Encoding::UTF_8)
154
+ assert(test.isSameString(s))
155
+ assert(test.isSameString(utf8_kj))
156
+ assert_equal(s.toString().encode(Encoding::UTF_8), utf8_kj)
157
+ iso2022jp_kj = "\x1b\x24\x42\x34\x41\x3b\x7a\x25\x46\x25\x2d\x25\x39\x25\x48\x1b\x28\x42".force_encoding Encoding::ISO_2022_JP
158
+ s = @jString.new(iso2022jp_kj)
159
+ assert_equal(s.toString().encoding, Encoding::UTF_8)
160
+ assert(test.isSameString(s))
161
+ assert(test.isSameString(iso2022jp_kj))
162
+ assert_equal(s.toString().encode(Encoding::ISO_2022_JP), iso2022jp_kj)
163
+ assert_equal(@jString.new("abcdef".force_encoding(Encoding::ASCII_8BIT)).toString(), "abcdef")
164
+ assert_equal(@jString.new("abcdef".force_encoding(Encoding::find("us-ascii"))).toString(), "abcdef")
159
165
  else
160
166
  $KCODE = 'euc'
161
167
  euc_kj = "\xb4\xc1\xbb\xfa\xa5\xc6\xa5\xad\xa5\xb9\xa5\xc8"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rjb
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.1.2
5
5
  platform: x86-mswin32-60
6
6
  authors:
7
7
  - arton
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2008-01-09 00:00:00 +09:00
12
+ date: 2008-02-22 00:00:00 +09:00
13
13
  default_executable:
14
14
  dependencies: []
15
15
 
@@ -49,7 +49,7 @@ files:
49
49
  - readme.txt
50
50
  - lib/rjbcore.so
51
51
  has_rdoc: false
52
- homepage: http://arton.no-ip.info/collabo/backyard/?RubyJavaBridge
52
+ homepage: http://rjb.rubyforge.org/
53
53
  post_install_message:
54
54
  rdoc_options: []
55
55