pandoc-ruby 2.1.5 → 2.1.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/pandoc-ruby.rb +27 -12
- data/pandoc-ruby.gemspec +2 -2
- data/test/test_pandoc_ruby.rb +22 -7
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7de1085641b2cab29183ef3ce1f14a8b4086c612b6614949b2f73e5d3667eec4
|
4
|
+
data.tar.gz: 780ca45e2a5403ed314b1248d552318d3b26ead604a866bc3372042ed5e1ddef
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d6d95a2ef03edcaac8a5d8d6c101a5eccd0434c7466369d74e93fa46c09439640dda15400f8f03b040398c350a9ded573ea8fcd3d063b4c082ee7bec93f403a9
|
7
|
+
data.tar.gz: c578ac85aadd2627361a5e7488d5dce60419ee340dbcd8167a16d9445fc12a8a52e8f01242039e5c87c4a4294c076c44fed7fc58ea4444f3330879c5e8ff95f2
|
data/lib/pandoc-ruby.rb
CHANGED
@@ -12,12 +12,17 @@ class PandocRuby
|
|
12
12
|
# The available readers and their corresponding names. The keys are used to
|
13
13
|
# generate methods and specify options to Pandoc.
|
14
14
|
READERS = {
|
15
|
+
'biblatex' => 'BibLaTeX bibliography',
|
16
|
+
'bibtex' => 'BibTeX bibliography',
|
15
17
|
'commonmark' => 'CommonMark Markdown',
|
18
|
+
'commonmark_x' => 'CommonMark Markdown with extensions',
|
16
19
|
'creole' => 'Creole 1.0',
|
20
|
+
'csljson' => 'CSL JSON bibliography',
|
17
21
|
'csv' => 'CSV table',
|
18
22
|
'docbook' => 'DocBook',
|
19
23
|
'docx' => 'Word docx',
|
20
24
|
'dokuwiki' => 'DokuWiki markup',
|
25
|
+
'endnotexml' => 'EndNote XML bibliography',
|
21
26
|
'epub' => 'EPUB',
|
22
27
|
'fb2' => 'FictionBook2 e-book',
|
23
28
|
'gfm' => 'GitHub-Flavored Markdown',
|
@@ -39,10 +44,13 @@ class PandocRuby
|
|
39
44
|
'odt' => 'ODT',
|
40
45
|
'opml' => 'OPML',
|
41
46
|
'org' => 'Emacs Org mode',
|
47
|
+
'ris' => 'RIS bibliography',
|
42
48
|
'rst' => 'reStructuredText',
|
49
|
+
'rtf' => 'Rich Text Format',
|
43
50
|
't2t' => 'txt2tags',
|
44
51
|
'textile' => 'Textile',
|
45
52
|
'tikiwiki' => 'TikiWiki markup',
|
53
|
+
'tsv' => 'TSV table',
|
46
54
|
'twiki' => 'TWiki markup',
|
47
55
|
'vimwiki' => 'Vimwiki'
|
48
56
|
}.freeze
|
@@ -53,8 +61,12 @@ class PandocRuby
|
|
53
61
|
'asciidoc' => 'AsciiDoc',
|
54
62
|
'asciidoctor' => 'AsciiDoctor',
|
55
63
|
'beamer' => 'LaTeX beamer slide show',
|
64
|
+
'biblatex' => 'BibLaTeX bibliography',
|
65
|
+
'bibtex' => 'BibTeX bibliography',
|
56
66
|
'commonmark' => 'CommonMark Markdown',
|
67
|
+
'commonmark_x' => 'CommonMark Markdown with extensions',
|
57
68
|
'context' => 'ConTeXt',
|
69
|
+
'csljson' => 'CSL JSON bibliography',
|
58
70
|
'docbook' => 'DocBook 4',
|
59
71
|
'docbook4' => 'DocBook 4',
|
60
72
|
'docbook5' => 'DocBook 5',
|
@@ -79,6 +91,7 @@ class PandocRuby
|
|
79
91
|
'markdown_mmd' => 'MultiMarkdown',
|
80
92
|
'markdown_phpextra' => 'PHP Markdown Extra',
|
81
93
|
'markdown_strict' => 'original unextended Markdown',
|
94
|
+
'markua' => 'Markua',
|
82
95
|
'mediawiki' => 'MediaWiki markup',
|
83
96
|
'ms' => 'roff ms',
|
84
97
|
'muse' => 'Muse',
|
@@ -108,7 +121,7 @@ class PandocRuby
|
|
108
121
|
BINARY_WRITERS = {
|
109
122
|
'odt' => 'OpenOffice text document',
|
110
123
|
'docx' => 'Word docx',
|
111
|
-
'epub' => 'EPUB
|
124
|
+
'epub' => 'EPUB v3',
|
112
125
|
'epub2' => 'EPUB v2',
|
113
126
|
'epub3' => 'EPUB v3'
|
114
127
|
}.freeze
|
@@ -272,20 +285,22 @@ class PandocRuby
|
|
272
285
|
@timeout ||= 31_557_600
|
273
286
|
|
274
287
|
Open3.popen3(command) do |stdin, stdout, stderr, wait_thr|
|
275
|
-
|
276
|
-
|
288
|
+
begin
|
289
|
+
Timeout.timeout(@timeout) do
|
290
|
+
stdin.puts self.input_string
|
277
291
|
|
278
|
-
|
292
|
+
stdin.close
|
279
293
|
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
294
|
+
output = stdout.read
|
295
|
+
error = stderr.read
|
296
|
+
exit_status = wait_thr.value
|
297
|
+
end
|
298
|
+
rescue Timeout::Error => ex
|
299
|
+
Process.kill 9, wait_thr.pid
|
286
300
|
|
287
|
-
|
288
|
-
|
301
|
+
maybe_ex = "\n#{ex}" if ex
|
302
|
+
error = "Pandoc timed out after #{@timeout} seconds.#{maybe_ex}"
|
303
|
+
end
|
289
304
|
end
|
290
305
|
|
291
306
|
raise error unless exit_status && exit_status.success?
|
data/pandoc-ruby.gemspec
CHANGED
@@ -5,9 +5,9 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = 'pandoc-ruby'
|
8
|
-
s.version = '2.1.
|
8
|
+
s.version = '2.1.7'
|
9
9
|
s.authors = ['William Melody']
|
10
|
-
s.date = '
|
10
|
+
s.date = '2022-10-30'
|
11
11
|
s.description = 'Ruby wrapper for Pandoc'
|
12
12
|
s.email = 'hi@williammelody.com'
|
13
13
|
s.extra_rdoc_files = [
|
data/test/test_pandoc_ruby.rb
CHANGED
@@ -318,13 +318,15 @@ describe PandocRuby do
|
|
318
318
|
end
|
319
319
|
|
320
320
|
it 'runs more than 400 times without error' do
|
321
|
-
|
322
|
-
|
321
|
+
begin
|
322
|
+
400.times do
|
323
|
+
PandocRuby.convert(@string)
|
324
|
+
end
|
325
|
+
|
326
|
+
assert true
|
327
|
+
rescue Errno::EMFILE, Errno::EAGAIN => e
|
328
|
+
flunk e
|
323
329
|
end
|
324
|
-
|
325
|
-
assert true
|
326
|
-
rescue Errno::EMFILE, Errno::EAGAIN => e
|
327
|
-
flunk e
|
328
330
|
end
|
329
331
|
|
330
332
|
it 'gracefully times out when pandoc hangs due to malformed input' do
|
@@ -344,12 +346,17 @@ describe PandocRuby do
|
|
344
346
|
it 'has reader and writer constants' do
|
345
347
|
assert_equal(
|
346
348
|
PandocRuby::READERS,
|
349
|
+
'biblatex' => 'BibLaTeX bibliography',
|
350
|
+
'bibtex' => 'BibTeX bibliography',
|
347
351
|
'commonmark' => 'CommonMark Markdown',
|
352
|
+
'commonmark_x' => 'CommonMark Markdown with extensions',
|
348
353
|
'creole' => 'Creole 1.0',
|
354
|
+
'csljson' => 'CSL JSON bibliography',
|
349
355
|
'csv' => 'CSV table',
|
350
356
|
'docbook' => 'DocBook',
|
351
357
|
'docx' => 'Word docx',
|
352
358
|
'dokuwiki' => 'DokuWiki markup',
|
359
|
+
'endnotexml' => 'EndNote XML bibliography',
|
353
360
|
'epub' => 'EPUB',
|
354
361
|
'fb2' => 'FictionBook2 e-book',
|
355
362
|
'gfm' => 'GitHub-Flavored Markdown',
|
@@ -371,10 +378,13 @@ describe PandocRuby do
|
|
371
378
|
'odt' => 'ODT',
|
372
379
|
'opml' => 'OPML',
|
373
380
|
'org' => 'Emacs Org mode',
|
381
|
+
'ris' => 'RIS bibliography',
|
374
382
|
'rst' => 'reStructuredText',
|
383
|
+
'rtf' => 'Rich Text Format',
|
375
384
|
't2t' => 'txt2tags',
|
376
385
|
'textile' => 'Textile',
|
377
386
|
'tikiwiki' => 'TikiWiki markup',
|
387
|
+
'tsv' => 'TSV table',
|
378
388
|
'twiki' => 'TWiki markup',
|
379
389
|
'vimwiki' => 'Vimwiki'
|
380
390
|
)
|
@@ -384,8 +394,12 @@ describe PandocRuby do
|
|
384
394
|
'asciidoc' => 'AsciiDoc',
|
385
395
|
'asciidoctor' => 'AsciiDoctor',
|
386
396
|
'beamer' => 'LaTeX beamer slide show',
|
397
|
+
'biblatex' => 'BibLaTeX bibliography',
|
398
|
+
'bibtex' => 'BibTeX bibliography',
|
387
399
|
'commonmark' => 'CommonMark Markdown',
|
400
|
+
'commonmark_x' => 'CommonMark Markdown with extensions',
|
388
401
|
'context' => 'ConTeXt',
|
402
|
+
'csljson' => 'CSL JSON bibliography',
|
389
403
|
'docbook' => 'DocBook 4',
|
390
404
|
'docbook4' => 'DocBook 4',
|
391
405
|
'docbook5' => 'DocBook 5',
|
@@ -410,6 +424,7 @@ describe PandocRuby do
|
|
410
424
|
'markdown_mmd' => 'MultiMarkdown',
|
411
425
|
'markdown_phpextra' => 'PHP Markdown Extra',
|
412
426
|
'markdown_strict' => 'original unextended Markdown',
|
427
|
+
'markua' => 'Markua',
|
413
428
|
'mediawiki' => 'MediaWiki markup',
|
414
429
|
'ms' => 'roff ms',
|
415
430
|
'muse' => 'Muse',
|
@@ -438,7 +453,7 @@ describe PandocRuby do
|
|
438
453
|
PandocRuby::BINARY_WRITERS,
|
439
454
|
'odt' => 'OpenOffice text document',
|
440
455
|
'docx' => 'Word docx',
|
441
|
-
'epub' => 'EPUB
|
456
|
+
'epub' => 'EPUB v3',
|
442
457
|
'epub2' => 'EPUB v2',
|
443
458
|
'epub3' => 'EPUB v3'
|
444
459
|
)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pandoc-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1.
|
4
|
+
version: 2.1.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- William Melody
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-10-30 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Ruby wrapper for Pandoc
|
14
14
|
email: hi@williammelody.com
|