aozora2html 0.7.0 → 0.7.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +5 -0
- data/aozora2html.gemspec +4 -2
- data/appveyor.yml +6 -2
- data/bin/aozora2html +1 -1
- data/lib/aozora2html/version.rb +1 -1
- data/lib/t2hs.rb +3 -3
- data/test/test_aozora2html.rb +16 -0
- data/test/test_multiline_midashi_tag.rb +16 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 69f585eb774610409f4a56b1645bc2ebdf71ce35
|
4
|
+
data.tar.gz: c2c28ed11b58ca3d6df952f3b5709d14184e48f4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9291546c4ff8e76d64e0e1eaa32474efcea5c6d952e8215841d2a0d1da0beccae37d01a4dd8d1689ebd9ff962b6511d1811e6e3b4d3b381be8d102ccd63356b4
|
7
|
+
data.tar.gz: 23235e3da67c52b05cfb648275888ee82239f94e1f47d3a78261188ae4eaa110e1ca18dc5d9b8af1113e054e00f56586976fb5fb7fb99628175c2f0c2625d4ce
|
data/.travis.yml
CHANGED
data/aozora2html.gemspec
CHANGED
@@ -28,6 +28,8 @@ Gem::Specification.new do |spec|
|
|
28
28
|
spec.add_development_dependency "test-unit-rr"
|
29
29
|
# spec.add_development_dependency "test-unit-notify"
|
30
30
|
# spec.add_development_dependency "terminal-notifier"
|
31
|
-
|
32
|
-
|
31
|
+
if RUBY_VERSION > "2.2.0"
|
32
|
+
spec.add_development_dependency "guard"
|
33
|
+
spec.add_development_dependency "guard-test"
|
34
|
+
end
|
33
35
|
end
|
data/appveyor.yml
CHANGED
@@ -6,8 +6,10 @@ install:
|
|
6
6
|
- bundle install
|
7
7
|
build_script:
|
8
8
|
- bundle exec rake test
|
9
|
-
|
10
|
-
|
9
|
+
|
10
|
+
branches:
|
11
|
+
only:
|
12
|
+
- master
|
11
13
|
|
12
14
|
environment:
|
13
15
|
matrix:
|
@@ -17,3 +19,5 @@ environment:
|
|
17
19
|
- ruby_version: "21-x64"
|
18
20
|
- ruby_version: "22"
|
19
21
|
- ruby_version: "22-x64"
|
22
|
+
- ruby_version: "23"
|
23
|
+
- ruby_version: "23-x64"
|
data/bin/aozora2html
CHANGED
@@ -36,7 +36,7 @@ class Aozora2Html
|
|
36
36
|
try_emb = kuten2png(command)
|
37
37
|
if try_emb != command
|
38
38
|
try_emb
|
39
|
-
elsif command.match(/U\+([0-9A-F]{4,5})/)
|
39
|
+
elsif command.match(/U\+([0-9A-F]{4,5})/) && Embed_Gaiji_tag.use_unicode
|
40
40
|
unicode_num = $1
|
41
41
|
ch = Embed_Gaiji_tag.new(self, nil, nil, command)
|
42
42
|
ch.unicode = unicode_num
|
data/lib/aozora2html/version.rb
CHANGED
data/lib/t2hs.rb
CHANGED
@@ -669,9 +669,9 @@ end
|
|
669
669
|
# �ϊ���{��
|
670
670
|
class Aozora2Html
|
671
671
|
# �S�p�o�b�N�X���b�V�����o���Ȃ����璼�ł�
|
672
|
-
@@ku = ["18e5"].pack("h*")
|
673
|
-
@@noji = ["18f5"].pack("h*")
|
674
|
-
@@dakuten = ["18d8"].pack("h*")
|
672
|
+
@@ku = ["18e5"].pack("h*").force_encoding("shift_jis")
|
673
|
+
@@noji = ["18f5"].pack("h*").force_encoding("shift_jis")
|
674
|
+
@@dakuten = ["18d8"].pack("h*").force_encoding("shift_jis")
|
675
675
|
# @@kunoji = ["18e518f5"].pack("h*")
|
676
676
|
# utf8 ["fecbf8fecbcb"].pack("h*")
|
677
677
|
# @@dakutenkunoji = ["18e518d818f5"].pack("h*")
|
data/test/test_aozora2html.rb
CHANGED
@@ -97,6 +97,22 @@ class Aozora2HtmlTest < Test::Unit::TestCase
|
|
97
97
|
end
|
98
98
|
end
|
99
99
|
|
100
|
+
def test_read_char
|
101
|
+
Dir.mktmpdir do |dir|
|
102
|
+
input = File.join(dir,'dummy.txt')
|
103
|
+
output = File.join(dir,'dummy2.txt')
|
104
|
+
File.binwrite(input, "/\\r\n".encode("shift_jis"))
|
105
|
+
parser = Aozora2Html.new(input, output)
|
106
|
+
begin
|
107
|
+
char = parser.read_char
|
108
|
+
assert_equal "/".encode("shift_jis"), char
|
109
|
+
assert_equal Aozora2Html.class_eval("@@ku"), char
|
110
|
+
ensure
|
111
|
+
parser.close
|
112
|
+
end
|
113
|
+
end
|
114
|
+
end
|
115
|
+
|
100
116
|
def teardown
|
101
117
|
end
|
102
118
|
end
|
@@ -33,6 +33,22 @@ class MultilineMidashiTagTest < Test::Unit::TestCase
|
|
33
33
|
assert_equal "</a></h3>", tag.close_tag
|
34
34
|
end
|
35
35
|
|
36
|
+
def test_undeined_midashi
|
37
|
+
begin
|
38
|
+
Multiline_midashi_tag.new(@parser,"あ".encode("shift_jis"),:mado)
|
39
|
+
rescue Aozora_Error => e
|
40
|
+
assert_equal e.message(123).encode("utf-8"), "エラー(123行目):未定義な見出しです. \r\n処理を停止します"
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
def test_undeined_midashi2
|
45
|
+
begin
|
46
|
+
Multiline_midashi_tag.new(@parser,"大".encode("shift_jis"),:madoo)
|
47
|
+
rescue Aozora_Error => e
|
48
|
+
assert_equal e.message(123).encode("utf-8"), "エラー(123行目):未定義な見出しです. \r\n処理を停止します"
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
36
52
|
def teardown
|
37
53
|
end
|
38
54
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: aozora2html
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- aozorahack team
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-02-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rubyzip
|