review 5.3.0 → 5.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (79) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/ruby-tex.yml +1 -1
  3. data/.github/workflows/ruby.yml +1 -1
  4. data/.rubocop.yml +1 -322
  5. data/NEWS.ja.md +48 -0
  6. data/NEWS.md +48 -0
  7. data/README.md +9 -8
  8. data/bin/review +1 -1
  9. data/bin/review-catalog-converter +15 -15
  10. data/bin/review-check +7 -7
  11. data/bin/review-compile +6 -8
  12. data/bin/review-index +1 -1
  13. data/bin/review-preproc +1 -1
  14. data/bin/review-validate +2 -2
  15. data/doc/config.yml.sample +7 -1
  16. data/doc/config.yml.sample-simple +1 -1
  17. data/lib/review/book/base.rb +3 -3
  18. data/lib/review/book/book_unit.rb +1 -1
  19. data/lib/review/book/chapter.rb +1 -1
  20. data/lib/review/book/index.rb +3 -3
  21. data/lib/review/book/part.rb +12 -13
  22. data/lib/review/book/volume.rb +1 -1
  23. data/lib/review/builder.rb +10 -12
  24. data/lib/review/catalog.rb +5 -5
  25. data/lib/review/compiler.rb +13 -13
  26. data/lib/review/configure.rb +5 -2
  27. data/lib/review/epub2html.rb +12 -12
  28. data/lib/review/epubmaker/content.rb +1 -1
  29. data/lib/review/epubmaker/epubcommon.rb +44 -42
  30. data/lib/review/epubmaker/epubv2.rb +2 -1
  31. data/lib/review/epubmaker/epubv3.rb +5 -4
  32. data/lib/review/epubmaker/producer.rb +3 -3
  33. data/lib/review/epubmaker/reviewheaderlistener.rb +1 -1
  34. data/lib/review/epubmaker.rb +32 -31
  35. data/lib/review/extentions/string.rb +1 -1
  36. data/lib/review/htmlbuilder.rb +16 -15
  37. data/lib/review/htmlutils.rb +17 -17
  38. data/lib/review/i18n.rb +3 -3
  39. data/lib/review/idgxmlbuilder.rb +22 -21
  40. data/lib/review/idgxmlmaker.rb +15 -13
  41. data/lib/review/index_builder.rb +4 -20
  42. data/lib/review/init.rb +4 -4
  43. data/lib/review/latexbuilder.rb +30 -32
  44. data/lib/review/lineinput.rb +3 -3
  45. data/lib/review/location.rb +1 -1
  46. data/lib/review/logger.rb +21 -21
  47. data/lib/review/makerhelper.rb +3 -3
  48. data/lib/review/markdownbuilder.rb +6 -6
  49. data/lib/review/pdfmaker.rb +23 -19
  50. data/lib/review/plaintextbuilder.rb +5 -5
  51. data/lib/review/preprocessor/repository.rb +1 -1
  52. data/lib/review/preprocessor.rb +5 -5
  53. data/lib/review/textmaker.rb +20 -18
  54. data/lib/review/textutils.rb +3 -5
  55. data/lib/review/topbuilder.rb +71 -12
  56. data/lib/review/update.rb +16 -8
  57. data/lib/review/version.rb +1 -1
  58. data/lib/review/webmaker.rb +32 -32
  59. data/lib/review/webtocprinter.rb +10 -10
  60. data/lib/review/yamlloader.rb +35 -2
  61. data/review.gemspec +1 -0
  62. data/samples/sample-book/src/config.yml +0 -1
  63. data/templates/html/_titlepage.html.erb +9 -17
  64. data/templates/opf/opf_manifest_epubv2.opf.erb +1 -1
  65. data/templates/opf/opf_manifest_epubv3.opf.erb +1 -1
  66. data/test/book_test_helper.rb +10 -10
  67. data/test/test_epub3maker.rb +3 -3
  68. data/test/test_epubmaker.rb +14 -29
  69. data/test/test_epubmaker_cmd.rb +2 -2
  70. data/test/test_htmlbuilder.rb +4 -5
  71. data/test/test_idgxmlbuilder.rb +10 -10
  72. data/test/test_idgxmlmaker_cmd.rb +1 -1
  73. data/test/test_img_math.rb +11 -2
  74. data/test/test_latexbuilder.rb +2 -3
  75. data/test/test_pdfmaker_cmd.rb +10 -10
  76. data/test/test_textmaker_cmd.rb +1 -1
  77. data/test/test_topbuilder.rb +151 -11
  78. data/test/test_yamlloader.rb +28 -42
  79. metadata +8 -7
@@ -14,12 +14,11 @@ class YAMLLoaderTest < Test::Unit::TestCase
14
14
  def test_load_file
15
15
  Dir.mktmpdir do |dir|
16
16
  yaml_file = File.join(dir, 'test.yml')
17
- File.open(yaml_file, 'w') do |f|
18
- f.write <<EOB
17
+ File.write(yaml_file, <<EOB
19
18
  foo:
20
19
  bar: "test"
21
20
  EOB
22
- end
21
+ )
23
22
  yaml = @loader.load_file(yaml_file)
24
23
  assert_equal yaml, 'foo' => { 'bar' => 'test' }
25
24
  end
@@ -29,24 +28,22 @@ EOB
29
28
  Dir.mktmpdir do |dir|
30
29
  yaml_file = File.join(dir, 'test.yml')
31
30
  yaml_file2 = File.join(dir, 'test2.yml')
32
- File.open(yaml_file, 'w') do |f|
33
- f.write <<EOB
31
+ File.write(yaml_file, <<EOB
34
32
  k0: 2
35
33
  k1:
36
34
  name: "test"
37
35
  array: [{name: "N", val: "V"}]
38
36
  inherit: ["test2.yml"]
39
37
  EOB
40
- end
41
- File.open(yaml_file2, 'w') do |f|
42
- f.write <<EOB
38
+ )
39
+ File.write(yaml_file2, <<EOB
43
40
  k1:
44
41
  name: "test2"
45
42
  name2: "value2"
46
43
  array: [{name: "shoudoverridden_name", val: "shouldoverridden_val"}]
47
44
  k2: "3"
48
45
  EOB
49
- end
46
+ )
50
47
  yaml = @loader.load_file(yaml_file)
51
48
  assert_equal({ 'k0' => 2,
52
49
  'k1' => { 'name' => 'test', 'name2' => 'value2',
@@ -61,31 +58,28 @@ EOB
61
58
  yaml_file = File.join(dir, 'test.yml')
62
59
  yaml_file2 = File.join(dir, 'test2.yml')
63
60
  yaml_file3 = File.join(dir, 'test3.yml')
64
- File.open(yaml_file, 'w') do |f|
65
- f.write <<EOB
61
+ File.write(yaml_file, <<EOB
66
62
  k0: 2
67
63
  k1:
68
64
  name1: "value1-1"
69
65
  inherit: ["test3.yml", "test2.yml"]
70
66
  EOB
71
- end
72
- File.open(yaml_file2, 'w') do |f|
73
- f.write <<EOB
67
+ )
68
+ File.write(yaml_file2, <<EOB
74
69
  k1:
75
70
  name1: "value1-2"
76
71
  name2: "value2-2"
77
72
  k2: "B"
78
73
  EOB
79
- end
80
- File.open(yaml_file3, 'w') do |f|
81
- f.write <<EOB
74
+ )
75
+ File.write(yaml_file3, <<EOB
82
76
  k1:
83
77
  name1: "value1-3"
84
78
  name2: "value2-3"
85
79
  name3: "value3-3"
86
80
  k3: "C"
87
81
  EOB
88
- end
82
+ )
89
83
  yaml = @loader.load_file(yaml_file)
90
84
  assert_equal({
91
85
  'k0' => 2,
@@ -106,40 +100,35 @@ EOB
106
100
  yaml_file5 = File.join(dir, 'test5.yml')
107
101
  yaml_file6 = File.join(dir, 'test6.yml')
108
102
  yaml_file7 = File.join(dir, 'test7.yml')
109
- File.open(yaml_file7, 'w') do |f|
110
- f.write <<EOB
103
+ File.write(yaml_file7, <<EOB
111
104
  k1:
112
105
  name1: "N7"
113
106
  inherit: ["test3.yml", "test6.yml"]
114
107
  EOB
115
- end
116
- File.open(yaml_file6, 'w') do |f|
117
- f.write <<EOB
108
+ )
109
+ File.write(yaml_file6, <<EOB
118
110
  k1:
119
111
  name1: "N6"
120
112
  name2: "N6"
121
113
  inherit: ["test4.yml", "test5.yml"]
122
114
  EOB
123
- end
124
- File.open(yaml_file5, 'w') do |f|
125
- f.write <<EOB
115
+ )
116
+ File.write(yaml_file5, <<EOB
126
117
  k1:
127
118
  name1: "N5"
128
119
  name2: "N5"
129
120
  name3: "N5"
130
121
  EOB
131
- end
132
- File.open(yaml_file4, 'w') do |f|
133
- f.write <<EOB
122
+ )
123
+ File.write(yaml_file4, <<EOB
134
124
  k1:
135
125
  name1: "N4"
136
126
  name2: "N4"
137
127
  name3: "N4"
138
128
  name4: "N4"
139
129
  EOB
140
- end
141
- File.open(yaml_file3, 'w') do |f|
142
- f.write <<EOB
130
+ )
131
+ File.write(yaml_file3, <<EOB
143
132
  k1:
144
133
  name1: "N3"
145
134
  name2: "N3"
@@ -148,9 +137,8 @@ k1:
148
137
  name5: "N3"
149
138
  inherit: ["test1.yml", "test2.yml"]
150
139
  EOB
151
- end
152
- File.open(yaml_file2, 'w') do |f|
153
- f.write <<EOB
140
+ )
141
+ File.write(yaml_file2, <<EOB
154
142
  k1:
155
143
  name1: "N2"
156
144
  name2: "N2"
@@ -159,9 +147,8 @@ k1:
159
147
  name5: "N2"
160
148
  name6: "N2"
161
149
  EOB
162
- end
163
- File.open(yaml_file1, 'w') do |f|
164
- f.write <<EOB
150
+ )
151
+ File.write(yaml_file1, <<EOB
165
152
  k1:
166
153
  name1: "N1"
167
154
  name2: "N1"
@@ -171,7 +158,7 @@ k1:
171
158
  name6: "N1"
172
159
  name7: "N1"
173
160
  EOB
174
- end
161
+ )
175
162
 
176
163
  yaml = @loader.load_file(yaml_file7)
177
164
  assert_equal({ 'k1' => { 'name1' => 'N7',
@@ -188,11 +175,10 @@ EOB
188
175
  def test_empty_file
189
176
  Dir.mktmpdir do |dir|
190
177
  yaml_file = File.join(dir, 'test.yml')
191
- File.open(yaml_file, 'w') do |f|
192
- f.write <<EOB
178
+ File.write(yaml_file, <<EOB
193
179
  #
194
180
  EOB
195
- end
181
+ )
196
182
  e = assert_raise(RuntimeError) { @loader.load_file(yaml_file) }
197
183
  assert_match('test.yml is malformed.', e.message)
198
184
  end
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: review
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.3.0
4
+ version: 5.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - kmuto
8
8
  - takahashim
9
- autorequire:
9
+ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2021-10-29 00:00:00.000000000 Z
12
+ date: 2022-02-27 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: image_size
@@ -624,8 +624,9 @@ files:
624
624
  homepage: http://github.com/kmuto/review
625
625
  licenses:
626
626
  - LGPL
627
- metadata: {}
628
- post_install_message:
627
+ metadata:
628
+ rubygems_mfa_required: 'true'
629
+ post_install_message:
629
630
  rdoc_options: []
630
631
  require_paths:
631
632
  - lib
@@ -640,8 +641,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
640
641
  - !ruby/object:Gem::Version
641
642
  version: '0'
642
643
  requirements: []
643
- rubygems_version: 3.2.15
644
- signing_key:
644
+ rubygems_version: 3.1.6
645
+ signing_key:
645
646
  specification_version: 4
646
647
  summary: 'Re:VIEW: a easy-to-use digital publishing system'
647
648
  test_files: