review 3.2.0 → 4.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (105) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +26 -4
  3. data/.travis.yml +1 -1
  4. data/NEWS.ja.md +97 -1
  5. data/NEWS.md +97 -1
  6. data/bin/review-catalog-converter +1 -1
  7. data/bin/review-check +5 -5
  8. data/bin/review-checkdep +1 -1
  9. data/bin/review-compile +5 -5
  10. data/bin/review-idgxmlmaker +16 -0
  11. data/bin/review-index +7 -7
  12. data/bin/review-preproc +9 -9
  13. data/bin/review-validate +2 -2
  14. data/bin/review-vol +5 -5
  15. data/doc/config.yml.sample +14 -6
  16. data/doc/config.yml.sample-simple +1 -1
  17. data/doc/format.ja.md +15 -5
  18. data/doc/format.md +30 -18
  19. data/doc/pdfmaker.ja.md +1 -1
  20. data/doc/pdfmaker.md +1 -1
  21. data/lib/review/book.rb +1 -1
  22. data/lib/review/book/base.rb +23 -63
  23. data/lib/review/book/chapter.rb +18 -3
  24. data/lib/review/book/compilable.rb +5 -0
  25. data/lib/review/book/index.rb +26 -65
  26. data/lib/review/book/index/item.rb +40 -0
  27. data/lib/review/book/part.rb +22 -2
  28. data/lib/review/builder.rb +60 -40
  29. data/lib/review/catalog.rb +12 -15
  30. data/lib/review/compiler.rb +68 -36
  31. data/lib/review/configure.rb +10 -7
  32. data/lib/review/epubmaker.rb +5 -2
  33. data/lib/review/htmlbuilder.rb +24 -71
  34. data/lib/review/htmlutils.rb +2 -3
  35. data/lib/review/i18n.rb +2 -2
  36. data/lib/review/idgxmlbuilder.rb +101 -55
  37. data/lib/review/idgxmlmaker.rb +184 -0
  38. data/lib/review/init-web/finish.html +10 -0
  39. data/lib/review/init-web/index.html +190 -0
  40. data/lib/review/init-web/review-layout-design.js +691 -0
  41. data/lib/review/init.rb +110 -26
  42. data/lib/review/latexbuilder.rb +76 -54
  43. data/lib/review/lineinput.rb +1 -1
  44. data/lib/review/logger.rb +4 -8
  45. data/lib/review/makerhelper.rb +6 -4
  46. data/lib/review/markdownbuilder.rb +25 -38
  47. data/lib/review/md2inaobuilder.rb +3 -5
  48. data/lib/review/pdfmaker.rb +15 -15
  49. data/lib/review/plaintextbuilder.rb +67 -76
  50. data/lib/review/preprocessor.rb +13 -13
  51. data/lib/review/rstbuilder.rb +31 -31
  52. data/lib/review/textmaker.rb +13 -3
  53. data/lib/review/textutils.rb +77 -2
  54. data/lib/review/tocparser.rb +17 -17
  55. data/lib/review/tocprinter.rb +8 -8
  56. data/lib/review/topbuilder.rb +76 -57
  57. data/lib/review/update.rb +16 -16
  58. data/lib/review/version.rb +1 -1
  59. data/lib/review/webmaker.rb +2 -2
  60. data/lib/review/yamlloader.rb +3 -0
  61. data/review.gemspec +4 -3
  62. data/samples/sample-book/README.md +7 -2
  63. data/samples/sample-book/src/.gitignore +153 -0
  64. data/samples/sample-book/src/config-jlreq.yml +6 -0
  65. data/samples/sample-book/src/lib/tasks/review.rake +20 -9
  66. data/samples/sample-book/src/lib/tasks/z01_copy_sty.rake +14 -8
  67. data/samples/syntax-book/ch03.re +3 -6
  68. data/samples/syntax-book/config-jlreq.yml +5 -0
  69. data/samples/syntax-book/lib/tasks/review.rake +7 -7
  70. data/samples/syntax-book/lib/tasks/z01_copy_sty.rake +14 -8
  71. data/templates/latex/config.erb +6 -0
  72. data/templates/latex/layout.tex.erb +1 -0
  73. data/templates/latex/review-jlreq/review-base.sty +93 -31
  74. data/templates/latex/review-jlreq/review-jlreq.cls +6 -0
  75. data/templates/latex/review-jlreq/review-style.sty +3 -0
  76. data/templates/latex/review-jsbook/README.md +39 -0
  77. data/templates/latex/review-jsbook/review-base.sty +65 -10
  78. data/templates/latex/review-jsbook/review-jsbook.cls +4 -0
  79. data/templates/latex/review-jsbook/review-style.sty +4 -1
  80. data/test/assets/test_template.tex +11 -3
  81. data/test/assets/test_template_backmatter.tex +11 -3
  82. data/test/test_book.rb +65 -19
  83. data/test/test_catalog.rb +18 -42
  84. data/test/test_catalog_converter_cmd.rb +1 -1
  85. data/test/test_epubmaker_cmd.rb +2 -2
  86. data/test/test_helper.rb +1 -1
  87. data/test/test_htmlbuilder.rb +144 -55
  88. data/test/test_i18n.rb +25 -25
  89. data/test/test_idgxmlbuilder.rb +60 -18
  90. data/test/test_image_finder.rb +6 -6
  91. data/test/test_latexbuilder.rb +128 -24
  92. data/test/test_latexbuilder_v2.rb +23 -23
  93. data/test/test_logger.rb +14 -1
  94. data/test/test_makerhelper.rb +3 -3
  95. data/test/test_markdownbuilder.rb +45 -4
  96. data/test/test_md2inaobuilder.rb +12 -2
  97. data/test/test_pdfmaker.rb +1 -1
  98. data/test/test_pdfmaker_cmd.rb +1 -1
  99. data/test/test_plaintextbuilder.rb +31 -6
  100. data/test/test_rstbuilder.rb +33 -4
  101. data/test/test_textutils.rb +109 -2
  102. data/test/test_topbuilder.rb +35 -7
  103. data/test/test_update.rb +17 -8
  104. data/test/test_yamlloader.rb +13 -0
  105. metadata +26 -2
@@ -51,10 +51,10 @@ module ReVIEW
51
51
  end
52
52
 
53
53
  def process(inf, outf)
54
- init_errorutils inf
54
+ init_errorutils(inf)
55
55
  @f = outf
56
56
  begin
57
- preproc inf
57
+ preproc(inf)
58
58
  rescue Errno::ENOENT => e
59
59
  error e.message
60
60
  end
@@ -80,7 +80,7 @@ module ReVIEW
80
80
  direc = parse_directive(line, 1, 'stderr')
81
81
  @f.print line
82
82
  get_output(expand(direc.arg), direc['stderr']).each { |out| @f.print out.string }
83
- skip_list f
83
+ skip_list(f)
84
84
 
85
85
  when /\A\#@mapfile/
86
86
  direc = parse_directive(line, 1, 'eval')
@@ -131,15 +131,15 @@ module ReVIEW
131
131
  @f.print directive_line
132
132
  newlines.each do |line|
133
133
  if with_lineno
134
- print_number line.number
134
+ print_number(line.number)
135
135
  end
136
136
  @f.print line.string
137
137
  end
138
- skip_list f
138
+ skip_list(f)
139
139
  end
140
140
 
141
141
  def print_number(num)
142
- @f.printf '%4s ', (num ? num.to_s : '')
142
+ @f.printf('%4s ', (num ? num.to_s : ''))
143
143
  end
144
144
 
145
145
  def skip_list(f)
@@ -279,7 +279,7 @@ module ReVIEW
279
279
  Open3.popen3(cmd) do |_stdin, stdout, stderr|
280
280
  out = stdout.readlines
281
281
  if use_stderr
282
- out.concat stderr.readlines
282
+ out.concat(stderr.readlines)
283
283
  else
284
284
  err = stderr.readlines
285
285
  end
@@ -361,7 +361,7 @@ module ReVIEW
361
361
  end
362
362
 
363
363
  def parse_file(fname)
364
- File.open(fname, 'r:BOM|utf-8') do |f|
364
+ File.open(fname, 'rt:BOM|utf-8') do |f|
365
365
  init_errorutils f
366
366
  return _parse_file(f)
367
367
  end
@@ -403,14 +403,14 @@ module ReVIEW
403
403
  error "begin x2: #{key}"
404
404
  end
405
405
  (repo[type] ||= {})[spec] = curr[key] = []
406
- opened.push [type, spec]
406
+ opened.push([type, spec])
407
407
 
408
408
  when %r{(?:\A\#@|\#@@)([a-z]+)/(\w+)\}}
409
409
  type = check_type($1)
410
410
  spec = check_spec($2)
411
411
  curr.delete("#{type}/#{spec}") or
412
412
  error "end before begin: #{type}/#{spec}"
413
- opened.delete "#{type}/#{spec}"
413
+ opened.delete("#{type}/#{spec}")
414
414
 
415
415
  when /(?:\A\#@|\#@@)\}/
416
416
  type, spec = opened.last
@@ -423,17 +423,17 @@ module ReVIEW
423
423
 
424
424
  when /\A\#@-/ # does not increment line number.
425
425
  line = canonical($')
426
- curr.each_value { |list| list.push Line.new(nil, line) }
426
+ curr.each_value { |list| list.push(Line.new(nil, line)) }
427
427
 
428
428
  else
429
429
  next if yacchack and line.strip == ';'
430
430
  line = canonical(line)
431
- curr.each_value { |list| list.push Line.new(lineno, line) }
431
+ curr.each_value { |list| list.push(Line.new(lineno, line)) }
432
432
  lineno += 1
433
433
  end
434
434
  end
435
435
  if curr.size > 1
436
- curr.delete 'WHOLE'
436
+ curr.delete('WHOLE')
437
437
  curr.each { |range, lines| @logger.warn "#{filename}: unclosed range: #{range} (begin @#{lines.first.number})" }
438
438
  raise ApplicationError, 'ERROR'
439
439
  end
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2008-2017 Minero Aoki, Kenshi Muto
1
+ # Copyright (c) 2008-2019 Minero Aoki, Kenshi Muto
2
2
  # 2002-2006 Minero Aoki
3
3
  #
4
4
  # This program is free software.
@@ -103,13 +103,13 @@ module ReVIEW
103
103
  blank
104
104
  end
105
105
  puts '=' * caption.size * 2
106
- when 2 then
106
+ when 2
107
107
  p = '='
108
- when 3 then
108
+ when 3
109
109
  p = '-'
110
- when 4 then
110
+ when 4
111
111
  p = '`'
112
- when 5 then
112
+ when 5
113
113
  p = '~'
114
114
  end
115
115
 
@@ -124,7 +124,7 @@ module ReVIEW
124
124
  end
125
125
 
126
126
  def ul_item(lines)
127
- puts ' ' * (@ul_indent - 1) + "* #{lines.join}"
127
+ puts ' ' * (@ul_indent - 1) + "* #{join_lines_to_paragraph(lines)}"
128
128
  end
129
129
 
130
130
  def ul_end
@@ -138,7 +138,7 @@ module ReVIEW
138
138
  end
139
139
 
140
140
  def ol_item(lines, _num)
141
- puts ' ' * (@ol_indent - 1) + "#. #{lines.join}"
141
+ puts ' ' * (@ol_indent - 1) + "#. #{join_lines_to_paragraph(lines)}"
142
142
  end
143
143
 
144
144
  def ol_end
@@ -167,7 +167,7 @@ module ReVIEW
167
167
  if @in_role
168
168
  pre = ' '
169
169
  end
170
- puts pre + lines.join
170
+ puts pre + join_lines_to_paragraph(lines)
171
171
  puts "\n"
172
172
  end
173
173
 
@@ -575,87 +575,87 @@ module ReVIEW
575
575
  end
576
576
 
577
577
  def flushright(lines)
578
- base_parablock 'flushright', lines, nil
578
+ base_parablock('flushright', lines, nil)
579
579
  end
580
580
 
581
581
  def centering(lines)
582
- base_parablock 'centering', lines, nil
582
+ base_parablock('centering', lines, nil)
583
583
  end
584
584
 
585
585
  def note(lines, caption = nil)
586
- base_parablock 'note', lines, caption
586
+ base_parablock('note', lines, caption)
587
587
  end
588
588
 
589
589
  def memo(lines, caption = nil)
590
- base_parablock 'memo', lines, caption
590
+ base_parablock('memo', lines, caption)
591
591
  end
592
592
 
593
593
  def tip(lines, caption = nil)
594
- base_parablock 'tip', lines, caption
594
+ base_parablock('tip', lines, caption)
595
595
  end
596
596
 
597
597
  def info(lines, caption = nil)
598
- base_parablock 'info', lines, caption
598
+ base_parablock('info', lines, caption)
599
599
  end
600
600
 
601
601
  def planning(lines, caption = nil)
602
- base_parablock 'planning', lines, caption
602
+ base_parablock('planning', lines, caption)
603
603
  end
604
604
 
605
605
  def best(lines, caption = nil)
606
- base_parablock 'best', lines, caption
606
+ base_parablock('best', lines, caption)
607
607
  end
608
608
 
609
609
  def important(lines, caption = nil)
610
- base_parablock 'important', lines, caption
610
+ base_parablock('important', lines, caption)
611
611
  end
612
612
 
613
613
  def security(lines, caption = nil)
614
- base_parablock 'security', lines, caption
614
+ base_parablock('security', lines, caption)
615
615
  end
616
616
 
617
617
  def caution(lines, caption = nil)
618
- base_parablock 'caution', lines, caption
618
+ base_parablock('caution', lines, caption)
619
619
  end
620
620
 
621
621
  def term(lines)
622
- base_parablock 'term', lines, nil
622
+ base_parablock('term', lines, nil)
623
623
  end
624
624
 
625
625
  def link(lines, caption = nil)
626
- base_parablock 'link', lines, caption
626
+ base_parablock('link', lines, caption)
627
627
  end
628
628
 
629
629
  def notice(lines, caption = nil)
630
- base_parablock 'notice', lines, caption
630
+ base_parablock('notice', lines, caption)
631
631
  end
632
632
 
633
633
  def point(lines, caption = nil)
634
- base_parablock 'point', lines, caption
634
+ base_parablock('point', lines, caption)
635
635
  end
636
636
 
637
637
  def shoot(lines, caption = nil)
638
- base_parablock 'shoot', lines, caption
638
+ base_parablock('shoot', lines, caption)
639
639
  end
640
640
 
641
641
  def reference(lines)
642
- base_parablock 'reference', lines, nil
642
+ base_parablock('reference', lines, nil)
643
643
  end
644
644
 
645
645
  def practice(lines)
646
- base_parablock 'practice', lines, nil
646
+ base_parablock('practice', lines, nil)
647
647
  end
648
648
 
649
649
  def expert(lines)
650
- base_parablock 'expert', lines, nil
650
+ base_parablock('expert', lines, nil)
651
651
  end
652
652
 
653
653
  def insn(lines, caption = nil)
654
- base_block 'insn', lines, caption
654
+ base_block('insn', lines, caption)
655
655
  end
656
656
 
657
657
  def warning(lines, caption = nil)
658
- base_parablock 'warning', lines, caption
658
+ base_parablock('warning', lines, caption)
659
659
  end
660
660
 
661
661
  alias_method :box, :insn
@@ -682,7 +682,7 @@ module ReVIEW
682
682
  end
683
683
 
684
684
  def bpo(lines)
685
- base_block 'bpo', lines, nil
685
+ base_block('bpo', lines, nil)
686
686
  end
687
687
 
688
688
  def inline_dtp(_str)
@@ -714,7 +714,7 @@ module ReVIEW
714
714
  end
715
715
 
716
716
  def source(lines, caption = nil, _lang = nil)
717
- base_block 'source', lines, caption
717
+ base_block('source', lines, caption)
718
718
  end
719
719
 
720
720
  def inline_ttibold(str)
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2018 Kenshi Muto
1
+ # Copyright (c) 2018-2019 Kenshi Muto
2
2
  #
3
3
  # This program is free software.
4
4
  # You can distribute or modify this program under the terms of
@@ -15,9 +15,12 @@ require 'review/book'
15
15
  require 'review/yamlloader'
16
16
  require 'review/topbuilder'
17
17
  require 'review/version'
18
+ require 'review/makerhelper'
18
19
 
19
20
  module ReVIEW
20
21
  class TEXTMaker
22
+ include MakerHelper
23
+
21
24
  attr_accessor :config, :basedir
22
25
 
23
26
  def initialize
@@ -27,12 +30,12 @@ module ReVIEW
27
30
  end
28
31
 
29
32
  def error(msg)
30
- @logger.error "#{File.basename($PROGRAM_NAME, '.*')}: #{msg}"
33
+ @logger.error msg
31
34
  exit 1
32
35
  end
33
36
 
34
37
  def warn(msg)
35
- @logger.warn "#{File.basename($PROGRAM_NAME, '.*')}: #{msg}"
38
+ @logger.warn msg
36
39
  end
37
40
 
38
41
  def self.execute(*args)
@@ -65,6 +68,7 @@ module ReVIEW
65
68
  end
66
69
 
67
70
  def remove_old_files(path)
71
+ cleanup_mathimg('_review_math_text')
68
72
  FileUtils.rm_rf(path)
69
73
  end
70
74
 
@@ -80,6 +84,7 @@ module ReVIEW
80
84
  rescue => e
81
85
  error "yaml error #{e.message}"
82
86
  end
87
+
83
88
  # YAML configs will be overridden by command line options.
84
89
  @config.deep_merge!(cmd_config)
85
90
  I18n.setup(@config['language'])
@@ -89,6 +94,11 @@ module ReVIEW
89
94
  raise if @config['debug']
90
95
  error(e.message)
91
96
  end
97
+
98
+ math_dir = "./#{@config['imagedir']}/_review_math_text"
99
+ if @config['imgmath'] && File.exist?(File.join(math_dir, '__IMGMATH_BODY__.tex'))
100
+ make_math_images(math_dir)
101
+ end
92
102
  end
93
103
 
94
104
  def generate_text_files(yamlfile)
@@ -1,4 +1,13 @@
1
+ # Copyright (c) 2008-2019 Minero Aoki, Kenshi Muto, Masayoshi Takahashi,
2
+ # KADO Masanori
3
+ # 2002-2007 Minero Aoki
4
+ #
5
+ # This program is free software.
6
+ # You can distribute or modify this program under the terms of
7
+ # the GNU LGPL, Lesser General Public License version 2.1.
8
+ #
1
9
  require 'nkf'
10
+ require 'digest'
2
11
 
3
12
  module ReVIEW
4
13
  module TextUtils
@@ -26,10 +35,76 @@ module ReVIEW
26
35
  end
27
36
  end
28
37
 
38
+ blocked_lines.map! { |i| join_lines_to_paragraph(i) }
39
+
29
40
  if pre && post
30
- blocked_lines.map! { |i| [pre] + i + [post] }
41
+ blocked_lines.map! { |i| pre + i + post }
42
+ end
43
+
44
+ blocked_lines
45
+ end
46
+
47
+ def add_space?(line1, line2, lang, lazy = nil)
48
+ # https://drafts.csswg.org/css-text-3/#line-break-transform
49
+ tail = line1[-1]
50
+ head = line2[0]
51
+ if tail.nil? || head.nil?
52
+ return nil
53
+ end
54
+ space = true
55
+ # rule 2
56
+ if %i[F W H].include?(Unicode::Eaw.property(tail)) &&
57
+ %i[F W H].include?(Unicode::Eaw.property(head)) &&
58
+ tail !~ /\p{Hangul}/ && head !~ /\p{Hangul}/
59
+ space = nil
60
+ end
61
+
62
+ if %w[ja zh zh_CN zh_TW yi].include?(lang)
63
+ # rule 3
64
+ if (%i[F W H].include?(Unicode::Eaw.property(tail)) &&
65
+ tail !~ /\p{Hangul}/ &&
66
+ (head =~ /\p{P}/ || head =~ /\p{S}/ || Unicode::Eaw.property(head) == :A)) ||
67
+ (%i[F W H].include?(Unicode::Eaw.property(head)) &&
68
+ head !~ /\p{Hangul}/ &&
69
+ (tail =~ /\p{P}/ || head =~ /\p{S}/ || Unicode::Eaw.property(tail) == :A))
70
+ space = nil
71
+ end
72
+
73
+ # lazy than rule 3, but it looks better
74
+ if lazy &&
75
+ (%i[F W H].include?(Unicode::Eaw.property(tail)) &&
76
+ tail !~ /\p{Hangul}/) ||
77
+ (%i[F W H].include?(Unicode::Eaw.property(head)) &&
78
+ head !~ /\p{Hangul}/)
79
+ space = nil
80
+ end
81
+ end
82
+ space
83
+ end
84
+
85
+ def join_lines_to_paragraph(lines)
86
+ unless @book.config['join_lines_by_lang']
87
+ return lines.join
88
+ end
89
+ lazy = true
90
+ lang = 'ja'
91
+ 0.upto(lines.size - 2) do |n|
92
+ if add_space?(lines[n], lines[n + 1], lang, lazy)
93
+ lines[n] += ' '
94
+ end
95
+ end
96
+ lines.join
97
+ end
98
+
99
+ def defer_math_image(str, path, key)
100
+ # for Re:VIEW >3
101
+ File.open(File.join(File.dirname(path), '__IMGMATH_BODY__.tex'), 'a+') do |f|
102
+ f.puts str
103
+ f.puts '\\clearpage'
104
+ end
105
+ File.open(File.join(File.dirname(path), '__IMGMATH_BODY__.map'), 'a+') do |f|
106
+ f.puts key
31
107
  end
32
- blocked_lines.map(&:join)
33
108
  end
34
109
 
35
110
  private
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright (c) 2008-2017 Minero Aoki, Kenshi Muto
2
+ # Copyright (c) 2008-2019 Minero Aoki, Kenshi Muto
3
3
  # 2002-2007 Minero Aoki
4
4
  #
5
5
  # This program is free software.
@@ -15,7 +15,7 @@ require 'review/textbuilder'
15
15
  module ReVIEW
16
16
  class TOCParser
17
17
  def self.parse(chap)
18
- stream = StringIO.new(chap.content, 'r:BOM|utf-8')
18
+ stream = StringIO.new(chap.content, 'rt:BOM|utf-8')
19
19
  new.parse(stream, chap).map do |root|
20
20
  root.number = chap.number
21
21
  root
@@ -43,40 +43,40 @@ module ReVIEW
43
43
  when /\A(={2,})[\[\s\{]/
44
44
  lev = $1.size
45
45
  if lev > 5
46
- error! filename, f.lineno, "section level too deep: #{lev}"
46
+ error!(filename, f.lineno, "section level too deep: #{lev}")
47
47
  end
48
48
  label = get_label(line)
49
49
  if node_stack.empty?
50
50
  # missing chapter label
51
51
  dummy_chapter = Chapter.new(label, chap)
52
- node_stack.push dummy_chapter
53
- roots.push dummy_chapter
52
+ node_stack.push(dummy_chapter)
53
+ roots.push(dummy_chapter)
54
54
  end
55
55
  next if label =~ %r{\A\[/} # ex) "[/column]"
56
56
  sec = Section.new(lev, label.gsub(/\A\{.*?\}\s?/, ''))
57
57
  node_stack.pop until node_stack.last.level < sec.level
58
- node_stack.last.add_child sec
59
- node_stack.push sec
58
+ node_stack.last.add_child(sec)
59
+ node_stack.push(sec)
60
60
 
61
61
  when /\A=[^=]/
62
62
  label = get_label(line)
63
63
  node_stack.clear
64
64
  new_chapter = Chapter.new(label, chap)
65
- node_stack.push new_chapter
66
- roots.push new_chapter
65
+ node_stack.push(new_chapter)
66
+ roots.push(new_chapter)
67
67
 
68
68
  when %r{\A//\w+(?:\[.*?\])*\{\s*\z}
69
69
  if node_stack.empty?
70
- error! filename, f.lineno, 'list found before section label'
70
+ error!(filename, f.lineno, 'list found before section label')
71
71
  end
72
72
  node_stack.last.add_child(list = List.new)
73
73
  beg = f.lineno
74
- list.add line
74
+ list.add(line)
75
75
  while line = f.gets
76
76
  break if %r{\A//\}} =~ line
77
- list.add line
77
+ list.add(line)
78
78
  end
79
- error! filename, beg, 'unterminated list' unless line
79
+ error!(filename, beg, 'unterminated list') unless line
80
80
 
81
81
  when %r{\A//\w}
82
82
  # do nothing
@@ -87,10 +87,10 @@ module ReVIEW
87
87
  # end
88
88
  next if node_stack.empty?
89
89
  node_stack.last.add_child(par = Paragraph.new(chap))
90
- par.add line
90
+ par.add(line)
91
91
  while line = f.gets
92
92
  break if /\A\s*\z/ =~ line
93
- par.add line
93
+ par.add(line)
94
94
  end
95
95
  end
96
96
  end
@@ -124,7 +124,7 @@ module ReVIEW
124
124
  attr_reader :children
125
125
 
126
126
  def add_child(c)
127
- @children.push c
127
+ @children.push(c)
128
128
  end
129
129
 
130
130
  def each_node(&block)
@@ -196,7 +196,7 @@ module ReVIEW
196
196
 
197
197
  class Chapter < Section
198
198
  def initialize(label, chap)
199
- super 1, label, chap.path
199
+ super(1, label, chap.path)
200
200
  @chapter = chap
201
201
  @chapter_id = chap.id
202
202
  @path = chap.path