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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b6cfff2de9e1f983ece8fd82d5dd91dcfe108341
4
- data.tar.gz: d5e51269b8342a2e4c73d5043b691246daf46539
3
+ metadata.gz: 69f585eb774610409f4a56b1645bc2ebdf71ce35
4
+ data.tar.gz: c2c28ed11b58ca3d6df952f3b5709d14184e48f4
5
5
  SHA512:
6
- metadata.gz: 3dacc3786ae5dc1aaeaf2584a13950412699889f4ec8c9cdce81e3236cf8fde9bfc789b3f1d817477dfc0bf44883180178676352d66cf5e147b715387b085dbb
7
- data.tar.gz: 386bc597c40cd6db861759894448b82dc0b16aa53fb79be334efdf2cb67ba27c71b5d548eec6291a005e9fbaca1a1c7cb5d9571532f10da119e36166ab97a83f
6
+ metadata.gz: 9291546c4ff8e76d64e0e1eaa32474efcea5c6d952e8215841d2a0d1da0beccae37d01a4dd8d1689ebd9ff962b6511d1811e6e3b4d3b381be8d102ccd63356b4
7
+ data.tar.gz: 23235e3da67c52b05cfb648275888ee82239f94e1f47d3a78261188ae4eaa110e1ca18dc5d9b8af1113e054e00f56586976fb5fb7fb99628175c2f0c2625d4ce
@@ -5,3 +5,8 @@ rvm:
5
5
  - 2.0
6
6
  - 2.1
7
7
  - 2.2
8
+ - 2.3.1
9
+
10
+ branches:
11
+ only:
12
+ - master
@@ -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
- spec.add_development_dependency "guard"
32
- spec.add_development_dependency "guard-test"
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
@@ -6,8 +6,10 @@ install:
6
6
  - bundle install
7
7
  build_script:
8
8
  - bundle exec rake test
9
- artifacts:
10
- - path: pkg\*.gem
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"
@@ -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
@@ -1,3 +1,3 @@
1
1
  class Aozora2Html
2
- VERSION = "0.7.0"
2
+ VERSION = "0.7.1"
3
3
  end
@@ -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*")
@@ -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.0
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: 2016-03-26 00:00:00.000000000 Z
11
+ date: 2017-02-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rubyzip