review 1.7.1 → 1.7.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/ChangeLog +4 -0
- data/doc/NEWS.ja.md +6 -0
- data/doc/NEWS.md +6 -0
- data/lib/review/latexbuilder.rb +1 -1
- data/lib/review/markdownbuilder.rb +16 -0
- data/lib/review/version.rb +1 -1
- data/test/test_latexbuilder.rb +25 -0
- data/test/test_markdownbuilder.rb +17 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5449a3e4fd04d6c45855f7858fe37e4b73ed92f8
|
4
|
+
data.tar.gz: f14a9c926fd798eb05456fccec1d377573ec0e98
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4f02063b7744003b7d51b41894c5bc4efba4446c33d7a0990d3054724e5d194109991c4005c083f1a1c1f4bb7fdb92c797cc1a214de8d77d29e664989e434f91
|
7
|
+
data.tar.gz: 0442d498dfbbab961286734b7ef544f86ad79f24a3744e6227f1e00b8d99fef12c81c0a27863b5c465f35b01e116cd4068f2f62fe6e926fad76f61eacec8ee36
|
data/ChangeLog
CHANGED
data/doc/NEWS.ja.md
CHANGED
data/doc/NEWS.md
CHANGED
data/lib/review/latexbuilder.rb
CHANGED
@@ -262,7 +262,7 @@ module ReVIEW
|
|
262
262
|
if highlight_listings?
|
263
263
|
common_code_block_lst(id, lines, 'reviewlistlst', 'caption', caption, lang)
|
264
264
|
else
|
265
|
-
common_code_block(id, lines, 'reviewlist',
|
265
|
+
common_code_block(id, lines, 'reviewlist', caption, lang) do |line, idx|
|
266
266
|
detab(line) + "\n"
|
267
267
|
end
|
268
268
|
end
|
@@ -99,6 +99,22 @@ module ReVIEW
|
|
99
99
|
blank
|
100
100
|
end
|
101
101
|
|
102
|
+
def dl_begin
|
103
|
+
puts '<dl>'
|
104
|
+
end
|
105
|
+
|
106
|
+
def dt(line)
|
107
|
+
puts "<dt>#{line}</dt>"
|
108
|
+
end
|
109
|
+
|
110
|
+
def dd(lines)
|
111
|
+
puts "<dd>#{lines.join}</dd>"
|
112
|
+
end
|
113
|
+
|
114
|
+
def dl_end
|
115
|
+
puts '</dl>'
|
116
|
+
end
|
117
|
+
|
102
118
|
def emlist(lines, caption = nil, lang = nil)
|
103
119
|
blank
|
104
120
|
if caption
|
data/lib/review/version.rb
CHANGED
data/test/test_latexbuilder.rb
CHANGED
@@ -277,6 +277,31 @@ class LATEXBuidlerTest < Test::Unit::TestCase
|
|
277
277
|
assert_equal %Q|\n\\begin{reviewemlist}\n foo\n bar\n\n buz\n\\end{reviewemlist}\n|, actual
|
278
278
|
end
|
279
279
|
|
280
|
+
def test_emlistnum_caption
|
281
|
+
actual = compile_block("//emlistnum[cap1]{\nfoo\nbar\n\nbuz\n//}\n")
|
282
|
+
assert_equal %Q|\n\\reviewemlistcaption{cap1}\n\\begin{reviewemlist}\n 1: foo\n 2: bar\n 3: \n 4: buz\n\\end{reviewemlist}\n|, actual
|
283
|
+
end
|
284
|
+
|
285
|
+
def test_list
|
286
|
+
actual = compile_block("//list[id1][cap1]{\nfoo\nbar\n\nbuz\n//}\n")
|
287
|
+
assert_equal %Q|\\reviewlistcaption{リスト1.1: cap1}\n\\begin{reviewlist}\nfoo\nbar\n\nbuz\n\\end{reviewlist}\n|, actual
|
288
|
+
end
|
289
|
+
|
290
|
+
def test_list_lst
|
291
|
+
@book.config["highlight"] = {}
|
292
|
+
@book.config["highlight"]["latex"] = "listings"
|
293
|
+
actual = compile_block("//list[id1][cap1][sql]{\nSELECT COUNT(*) FROM tests WHERE tests.no > 10 AND test.name LIKE 'ABC%'\n//}\n")
|
294
|
+
assert_equal %Q|\\begin{reviewlistlst}[caption={cap1},language={sql}]\nSELECT COUNT(*) FROM tests WHERE tests.no > 10 AND test.name LIKE 'ABC%'\n\\end{reviewlistlst}\n|, actual
|
295
|
+
end
|
296
|
+
|
297
|
+
def test_list_lst_with_lang
|
298
|
+
@book.config["highlight"] = {}
|
299
|
+
@book.config["highlight"]["latex"] = "listings"
|
300
|
+
@book.config["highlight"]["lang"] = "sql"
|
301
|
+
actual = compile_block("//list[id1][cap1]{\nSELECT COUNT(*) FROM tests WHERE tests.no > 10 AND test.name LIKE 'ABC%'\n//}\n")
|
302
|
+
assert_equal %Q|\\begin{reviewlistlst}[caption={cap1},language={sql}]\nSELECT COUNT(*) FROM tests WHERE tests.no > 10 AND test.name LIKE 'ABC%'\n\\end{reviewlistlst}\n|, actual
|
303
|
+
end
|
304
|
+
|
280
305
|
def test_listnum
|
281
306
|
actual = compile_block("//listnum[test1][ruby]{\nclass Foo\n def foo\n bar\n\n buz\n end\nend\n//}\n")
|
282
307
|
assert_equal %Q|\\reviewlistcaption{リスト1.1: ruby}\n\\begin{reviewlist}\n 1: class Foo\n 2: def foo\n 3: bar\n 4: \n 5: buz\n 6: end\n 7: end\n\\end{reviewlist}\n|, actual
|
@@ -62,6 +62,23 @@ EOS
|
|
62
62
|
assert_equal "```shell-session\nlineA\nlineB\n```\n", actual
|
63
63
|
end
|
64
64
|
|
65
|
+
|
66
|
+
def test_dlist
|
67
|
+
actual = compile_block(": foo\n foo.\n bar.\n")
|
68
|
+
assert_equal %Q|<dl>\n<dt>foo</dt>\n<dd>foo.bar.</dd>\n</dl>\n|, actual
|
69
|
+
end
|
70
|
+
|
71
|
+
def test_dlist_with_bracket
|
72
|
+
actual = compile_block(": foo[bar]\n foo.\n bar.\n")
|
73
|
+
assert_equal %Q|<dl>\n<dt>foo[bar]</dt>\n<dd>foo.bar.</dd>\n</dl>\n|, actual
|
74
|
+
end
|
75
|
+
|
76
|
+
def test_dlist_with_comment
|
77
|
+
source = ": title\n body\n\#@ comment\n\#@ comment\n: title2\n body2\n"
|
78
|
+
actual = compile_block(source)
|
79
|
+
assert_equal %Q|<dl>\n<dt>title</dt>\n<dd>body</dd>\n<dt>title2</dt>\n<dd>body2</dd>\n</dl>\n|, actual
|
80
|
+
end
|
81
|
+
|
65
82
|
def test_list
|
66
83
|
actual = compile_block(<<-EOS)
|
67
84
|
//list[name][caption]{
|