review 1.0.0 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.travis.yml +1 -2
- data/ChangeLog +65 -0
- data/Gemfile +5 -0
- data/README.rdoc +6 -1
- data/Rakefile +14 -28
- data/bin/review-check +9 -21
- data/bin/review-compile +45 -12
- data/bin/review-epubmaker +477 -220
- data/bin/review-epubmaker-ng +5 -14
- data/bin/review-index +4 -2
- data/bin/review-init +94 -0
- data/bin/review-pdfmaker +70 -287
- data/bin/review-preproc +5 -2
- data/bin/review-vol +4 -11
- data/debian/changelog +3 -3
- data/debian/copyright +5 -3
- data/debian/docs +1 -0
- data/doc/format.rdoc +57 -11
- data/doc/quickstart.rdoc +4 -4
- data/doc/sample.yaml +11 -7
- data/lib/epubmaker.rb +1 -1
- data/lib/epubmaker/epubv2.rb +26 -27
- data/lib/epubmaker/epubv3.rb +13 -13
- data/lib/epubmaker/producer.rb +1 -1
- data/lib/review.rb +3 -4
- data/lib/review/book.rb +17 -581
- data/lib/review/book/base.rb +247 -0
- data/lib/review/book/chapter.rb +81 -0
- data/lib/review/book/compilable.rb +163 -0
- data/lib/review/book/index.rb +339 -0
- data/lib/review/book/page_metric.rb +38 -0
- data/lib/review/book/parameters.rb +97 -0
- data/lib/review/book/part.rb +44 -0
- data/lib/review/book/volume.rb +65 -0
- data/lib/review/builder.rb +34 -40
- data/lib/review/compiler.rb +32 -13
- data/lib/review/configure.rb +38 -0
- data/lib/review/ewbbuilder.rb +23 -21
- data/lib/review/extentions.rb +3 -0
- data/lib/review/extentions/object.rb +9 -0
- data/lib/review/{compat.rb → extentions/string.rb} +11 -0
- data/lib/review/htmlbuilder.rb +162 -74
- data/lib/review/htmlutils.rb +28 -1
- data/lib/review/i18n.yaml +11 -0
- data/lib/review/idgxmlbuilder.rb +119 -35
- data/lib/review/inaobuilder.rb +355 -0
- data/lib/review/latexbuilder.rb +133 -59
- data/lib/review/latexutils.rb +15 -6
- data/lib/review/makerhelper.rb +59 -0
- data/lib/review/markdownbuilder.rb +129 -0
- data/lib/review/preprocessor.rb +20 -7
- data/lib/review/review.tex.erb +250 -0
- data/lib/review/textutils.rb +28 -3
- data/lib/review/tocparser.rb +20 -12
- data/lib/review/tocprinter.rb +7 -3
- data/lib/review/topbuilder.rb +44 -27
- data/lib/review/version.rb +3 -0
- data/review.gemspec +20 -117
- data/test/book_test_helper.rb +35 -0
- data/test/sample-book/README.md +5 -0
- data/test/sample-book/src/CHAPS +2 -0
- data/test/sample-book/src/PREDEF +1 -0
- data/test/sample-book/src/Rakefile +26 -0
- data/test/sample-book/src/_cover.html +3 -0
- data/test/sample-book/src/ch01.re +71 -0
- data/test/sample-book/src/ch02.re +3 -0
- data/test/sample-book/src/config.yml +55 -0
- data/test/sample-book/src/images/ch01-imgsample.jpg +0 -0
- data/test/sample-book/src/images/cover.jpg +0 -0
- data/test/sample-book/src/main.css +251 -0
- data/test/sample-book/src/preface.re +15 -0
- data/test/sample-book/src/sty/jumoline.sty +310 -0
- data/test/sample-book/src/sty/samplemacro.sty +21 -0
- data/test/sample-book/src/vendor/jumoline/README +29 -0
- data/test/sample-book/src/vendor/jumoline/jumoline.dtx +2988 -0
- data/test/sample-book/src/vendor/jumoline/jumoline.ins +6 -0
- data/test/test_book.rb +26 -646
- data/test/test_book_chapter.rb +418 -0
- data/test/test_book_parameter.rb +42 -0
- data/test/test_book_part.rb +53 -0
- data/test/test_builder.rb +17 -10
- data/test/test_compiler.rb +46 -0
- data/test/test_epubmaker.rb +1 -1
- data/test/test_epubmaker_cmd.rb +36 -0
- data/test/test_helper.rb +17 -0
- data/test/test_htmlbuilder.rb +156 -24
- data/test/test_htmlutils.rb +4 -0
- data/test/test_i18n.rb +6 -2
- data/test/test_idgxmlbuilder.rb +33 -11
- data/test/test_inaobuilder.rb +247 -0
- data/test/test_index.rb +31 -0
- data/test/test_latexbuilder.rb +115 -35
- data/test/test_makerhelper.rb +50 -0
- data/test/test_pdfmaker_cmd.rb +36 -0
- data/test/test_preprocessor.rb +7 -7
- data/test/test_topbuilder.rb +6 -7
- data/test/test_uuid.rb +1 -0
- metadata +117 -12
- data/lib/review/index.rb +0 -323
- data/lib/review/volume.rb +0 -66
data/lib/review/volume.rb
DELETED
@@ -1,66 +0,0 @@
|
|
1
|
-
#
|
2
|
-
# $Id: volume.rb 3883 2008-02-10 11:48:23Z aamine $
|
3
|
-
#
|
4
|
-
# Copyright (c) 2002-2007 Minero Aoki
|
5
|
-
#
|
6
|
-
# This program is free software.
|
7
|
-
# You can distribute or modify this program under the terms of
|
8
|
-
# the GNU LGPL, Lesser General Public License version 2.1.
|
9
|
-
# For details of the GNU LGPL, see the file "COPYING".
|
10
|
-
#
|
11
|
-
|
12
|
-
module ReVIEW
|
13
|
-
|
14
|
-
class Volume
|
15
|
-
|
16
|
-
def Volume.count_file(path)
|
17
|
-
b = c = l = 0
|
18
|
-
File.foreach(path) do |line|
|
19
|
-
next if %r<\A\#@> =~ line
|
20
|
-
text = line.gsub(/\s+/, '')
|
21
|
-
b += text.bytesize
|
22
|
-
c += text.charsize
|
23
|
-
l += 1
|
24
|
-
end
|
25
|
-
new(b, c, l)
|
26
|
-
end
|
27
|
-
|
28
|
-
def Volume.sum(vols)
|
29
|
-
vols.inject(new()) {|sum, i| sum + i }
|
30
|
-
end
|
31
|
-
|
32
|
-
def Volume.dummy
|
33
|
-
new(-1, -1, -1)
|
34
|
-
end
|
35
|
-
|
36
|
-
def initialize(bytes = 0, chars = 0, lines = 0)
|
37
|
-
@bytes = bytes
|
38
|
-
@chars = chars
|
39
|
-
@lines = lines
|
40
|
-
end
|
41
|
-
|
42
|
-
attr_reader :bytes
|
43
|
-
attr_reader :chars
|
44
|
-
attr_accessor :lines
|
45
|
-
|
46
|
-
def kbytes
|
47
|
-
(@bytes.to_f / 1024).ceil
|
48
|
-
end
|
49
|
-
|
50
|
-
def page
|
51
|
-
(kbytes.to_f/ReVIEW.book.page_metric.page_per_kbyte).ceil
|
52
|
-
end
|
53
|
-
|
54
|
-
def to_s
|
55
|
-
"#{kbytes()}KB #{@chars}C #{@lines}L #{page()}P"
|
56
|
-
end
|
57
|
-
|
58
|
-
def +(other)
|
59
|
-
Volume.new(@bytes + other.bytes,
|
60
|
-
@chars + other.chars,
|
61
|
-
@lines + other.lines)
|
62
|
-
end
|
63
|
-
|
64
|
-
end
|
65
|
-
|
66
|
-
end
|