sanzang 1.0.5 → 1.0.6
Sign up to get free protection for your applications and to get access to all the features.
- data/HACKING.rdoc +7 -3
- data/lib/sanzang/command/reflow.rb +2 -2
- data/lib/sanzang/command/translate.rb +2 -2
- data/lib/sanzang/version.rb +1 -1
- metadata +2 -2
data/HACKING.rdoc
CHANGED
@@ -3,8 +3,9 @@
|
|
3
3
|
== Supported platforms
|
4
4
|
|
5
5
|
These programs should work on all platforms with Ruby 1.9 or later. Regular
|
6
|
-
testing takes place on GNU/Linux operating systems. \Sanzang
|
7
|
-
|
6
|
+
testing takes place on GNU/Linux operating systems. \Sanzang also runs on
|
7
|
+
JRuby, although the runtime performance is usually slower than MRI. \Sanzang
|
8
|
+
has not been tested on other Ruby implementations such as Rubinius.
|
8
9
|
|
9
10
|
== Languages and scope
|
10
11
|
|
@@ -27,9 +28,12 @@ fork(2) perfectly, so Ruby 1.9+ on Cygwin can utilize the fork method, so
|
|
27
28
|
it supports standard multiprocessing. Therefore, Cygwin is the most robust
|
28
29
|
environment for running \Sanzang on a computer with Windows.
|
29
30
|
|
31
|
+
For JRuby, \Sanzang does not use fork(2) and multiprocessing, but rather uses
|
32
|
+
Java threads to achieve high performance for batch processing.
|
33
|
+
|
30
34
|
== Text encoding quirks
|
31
35
|
|
32
|
-
Converters for several encodings have not yet been implemented by
|
36
|
+
Converters for several encodings have not yet been implemented by MRI. Most of
|
33
37
|
these are obscure and not widely used. Perhaps the most notable is EUC-TW,
|
34
38
|
which is an old Unix encoding for traditional Chinese. Text encodings that
|
35
39
|
cannot be converted to and from UTF-8 are not currently supported.
|
@@ -63,10 +63,10 @@ module Sanzang::Command
|
|
63
63
|
fout.binmode.set_encoding(@encoding)
|
64
64
|
fout.write(Sanzang::TextFormatter.new.reflow_cjk(fin.read))
|
65
65
|
ensure
|
66
|
-
if defined?(fin) and fin
|
66
|
+
if defined?(fin) and fin.class == File
|
67
67
|
fin.close if not fin.closed?
|
68
68
|
end
|
69
|
-
if defined?(fout) and
|
69
|
+
if defined?(fout) and fout.class == File
|
70
70
|
fout.close if not fout.closed?
|
71
71
|
end
|
72
72
|
end
|
@@ -67,10 +67,10 @@ module Sanzang::Command
|
|
67
67
|
fout.binmode.set_encoding(@encoding)
|
68
68
|
translator.translate_io(fin, fout)
|
69
69
|
ensure
|
70
|
-
if defined?(fin) and fin
|
70
|
+
if defined?(fin) and fin.class == File
|
71
71
|
fin.close if not fin.closed?
|
72
72
|
end
|
73
|
-
if defined?(fout) and
|
73
|
+
if defined?(fout) and fout.class == File
|
74
74
|
fout.close if not fout.closed?
|
75
75
|
end
|
76
76
|
end
|
data/lib/sanzang/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sanzang
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.6
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-
|
12
|
+
date: 2013-11-08 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: parallel
|