pandoc-ruby 2.1.5 → 2.1.6
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 +13 -11
- data/pandoc-ruby.gemspec +2 -2
- data/test/test_pandoc_ruby.rb +8 -6
- 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: 0fc72faf981a6e87e6ae3e6023dfd41111ee7fa8d72441a87eeb9c41ff0c0ed1
|
4
|
+
data.tar.gz: 1d8d925c3480800fee1701164081d96cdc8159b9dabb8008a6b19fdf678f4c05
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ec5fd20766af6c1ba8beb17a885748850bf04c103bed37a1de9128e7b778f36553a7d93ef9d928a644830b33536247c6ea40f5af0c4f2301ef3531543d2fa8a9
|
7
|
+
data.tar.gz: 636bae03cfcf24bbb6404554917464c589856f3c2dd4f4dd5e44f5183c4396cf31a3459581bf42063bbcbc34a7dccfd2622e8a8984429f25d0a5dd82644b3373
|
data/lib/pandoc-ruby.rb
CHANGED
@@ -272,20 +272,22 @@ class PandocRuby
|
|
272
272
|
@timeout ||= 31_557_600
|
273
273
|
|
274
274
|
Open3.popen3(command) do |stdin, stdout, stderr, wait_thr|
|
275
|
-
|
276
|
-
|
275
|
+
begin
|
276
|
+
Timeout.timeout(@timeout) do
|
277
|
+
stdin.puts self.input_string
|
277
278
|
|
278
|
-
|
279
|
+
stdin.close
|
279
280
|
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
281
|
+
output = stdout.read
|
282
|
+
error = stderr.read
|
283
|
+
exit_status = wait_thr.value
|
284
|
+
end
|
285
|
+
rescue Timeout::Error => ex
|
286
|
+
Process.kill 9, wait_thr.pid
|
286
287
|
|
287
|
-
|
288
|
-
|
288
|
+
maybe_ex = "\n#{ex}" if ex
|
289
|
+
error = "Pandoc timed out after #{@timeout} seconds.#{maybe_ex}"
|
290
|
+
end
|
289
291
|
end
|
290
292
|
|
291
293
|
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.6'
|
9
9
|
s.authors = ['William Melody']
|
10
|
-
s.date = '2021-11-
|
10
|
+
s.date = '2021-11-22'
|
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
|
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.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- William Melody
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-11-
|
11
|
+
date: 2021-11-22 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Ruby wrapper for Pandoc
|
14
14
|
email: hi@williammelody.com
|