review 0.6.0 → 0.9.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (68) hide show
  1. data/ChangeLog +441 -0
  2. data/README.rdoc +25 -0
  3. data/Rakefile +13 -1
  4. data/VERSION +1 -1
  5. data/bin/review-check +1 -1
  6. data/bin/review-compile +19 -10
  7. data/bin/review-epubmaker +114 -17
  8. data/bin/review-index +8 -1
  9. data/bin/review-pdfmaker +378 -0
  10. data/bin/review-preproc +2 -3
  11. data/bin/review-vol +1 -2
  12. data/debian/README.Debian +12 -0
  13. data/debian/README.source +5 -0
  14. data/debian/changelog +5 -0
  15. data/debian/compat +1 -0
  16. data/debian/control +22 -0
  17. data/debian/copyright +60 -0
  18. data/debian/docs +5 -0
  19. data/debian/manpage.1.ex +59 -0
  20. data/debian/patches/path.diff +91 -0
  21. data/debian/patches/series +1 -0
  22. data/debian/review.install +13 -0
  23. data/debian/review.links +4 -0
  24. data/debian/rules +13 -0
  25. data/debian/source/format +1 -0
  26. data/doc/format.rdoc +477 -0
  27. data/doc/format.re +19 -0
  28. data/doc/format_idg.rdoc +180 -0
  29. data/doc/ruby-uuid/README +11 -0
  30. data/doc/ruby-uuid/README.ja +34 -0
  31. data/doc/sample.css +17 -0
  32. data/doc/sample.yaml +8 -4
  33. data/lib/lineinput.rb +1 -1
  34. data/lib/review/book.rb +43 -36
  35. data/lib/review/builder.rb +78 -33
  36. data/lib/review/compiler.rb +45 -48
  37. data/lib/review/epubbuilder.rb +1 -675
  38. data/lib/review/exception.rb +1 -1
  39. data/lib/review/htmlbuilder.rb +627 -49
  40. data/lib/review/htmlutils.rb +5 -0
  41. data/lib/review/idgxmlbuilder.rb +239 -250
  42. data/lib/review/index.rb +84 -7
  43. data/lib/review/latexbuilder.rb +261 -42
  44. data/lib/review/latexutils.rb +15 -6
  45. data/lib/review/preprocessor.rb +40 -6
  46. data/lib/review/textutils.rb +22 -0
  47. data/lib/review/topbuilder.rb +4 -1
  48. data/lib/uuid.rb +312 -0
  49. data/review.gemspec +44 -12
  50. data/test/CHAPS +2 -0
  51. data/test/bib.re +13 -0
  52. data/test/test.re +43 -0
  53. data/test/test_book.rb +1191 -0
  54. data/test/test_builder.rb +147 -0
  55. data/test/test_htmlbuilder.rb +191 -10
  56. data/test/test_htmlutils.rb +24 -0
  57. data/test/test_idgxmlbuilder.rb +310 -0
  58. data/test/test_index.rb +15 -0
  59. data/test/test_latexbuilder.rb +217 -6
  60. data/test/test_lineinput.rb +198 -0
  61. data/test/test_textutils.rb +68 -0
  62. data/test/test_uuid.rb +156 -0
  63. metadata +43 -10
  64. data/doc/format.txt +0 -434
  65. data/doc/format_idg.txt +0 -194
  66. data/doc/format_sjis.txt +0 -313
  67. data/setup.rb +0 -1587
  68. data/test/test_epubbuilder.rb +0 -73
@@ -1,73 +0,0 @@
1
- require 'test_helper'
2
- require 'review/compiler'
3
- require 'review/book'
4
- require 'review/epubbuilder'
5
-
6
- class EPUBBuidlerTest < Test::Unit::TestCase
7
- include ReVIEW
8
-
9
- def setup
10
- @builder = EPUBBuilder.new()
11
- @param = {
12
- "secnolevel" => 2, # for IDGXMLBuilder, EPUBBuilder
13
- "inencoding" => "UTF-8",
14
- "outencoding" => "UTF-8",
15
- "subdirmode" => nil,
16
- "stylesheet" => nil, # for EPUBBuilder
17
- }
18
- compiler = ReVIEW::Compiler.new(@builder)
19
- compiler.setParameter(@param)
20
- chapter = Chapter.new(nil, 1, '-', nil, StringIO.new)
21
- chapter.setParameter(@param)
22
- location = Location.new(nil, nil)
23
- @builder.bind(compiler, chapter, location)
24
- end
25
-
26
- def test_headline_level1
27
- @builder.headline(1,"test","this is test.")
28
- assert_equal %Q|<h1 id='test'><a id="h1" />第1章 this is test.</h1>\n|, @builder.raw_result
29
- end
30
-
31
- def test_headline_level1_without_secno
32
- @param["secnolevel"] = 0
33
- @builder.headline(1,"test","this is test.")
34
- assert_equal %Q|<h1 id='test'><a id="h1" />this is test.</h1>\n|, @builder.raw_result
35
- end
36
-
37
- def test_headline_level2
38
- @builder.headline(2,"test","this is test.")
39
- assert_equal %Q|\n<h2 id='test'><a id="h1-1" />1.1 this is test.</h2>\n|, @builder.raw_result
40
- end
41
-
42
- def test_headline_level3
43
- @builder.headline(3,"test","this is test.")
44
- assert_equal %Q|\n<h3 id='test'><a id="h1-0-1" />this is test.</h3>\n|, @builder.raw_result
45
- end
46
-
47
-
48
- def test_headline_level3_with_secno
49
- @param["secnolevel"] = 3
50
- @builder.headline(3,"test","this is test.")
51
- assert_equal %Q|\n<h3 id='test'><a id="h1-0-1" />1.0.1 this is test.</h3>\n|, @builder.raw_result
52
- end
53
-
54
- def test_label
55
- @builder.label("label_test")
56
- assert_equal %Q|<a id="label_test" />\n|, @builder.raw_result
57
- end
58
-
59
- def test_href
60
- ret = @builder.compile_href("http://github.com", "GitHub")
61
- assert_equal %Q|<a href="http://github.com" class="link">GitHub</a>|, ret
62
- end
63
-
64
- def test_href_without_label
65
- ret = @builder.compile_href("http://github.com",nil)
66
- assert_equal %Q|<a href="http://github.com" class="link">http://github.com</a>|, ret
67
- end
68
-
69
- def test_inline_raw
70
- ret = @builder.inline_raw("@<tt>{inline}")
71
- assert_equal %Q|@&lt;tt&gt;{inline}|, ret
72
- end
73
- end