pandoc-ruby 2.1.7 → 2.1.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7de1085641b2cab29183ef3ce1f14a8b4086c612b6614949b2f73e5d3667eec4
4
- data.tar.gz: 780ca45e2a5403ed314b1248d552318d3b26ead604a866bc3372042ed5e1ddef
3
+ metadata.gz: 9d9359ca27925935afcdd5599c555064864b1e0d14e5c55f54baf95678ccfba0
4
+ data.tar.gz: d9e80c8530cc6452d0b50b3a60b971bc5d3fed5cc43cb93a35132c30a0973f63
5
5
  SHA512:
6
- metadata.gz: d6d95a2ef03edcaac8a5d8d6c101a5eccd0434c7466369d74e93fa46c09439640dda15400f8f03b040398c350a9ded573ea8fcd3d063b4c082ee7bec93f403a9
7
- data.tar.gz: c578ac85aadd2627361a5e7488d5dce60419ee340dbcd8167a16d9445fc12a8a52e8f01242039e5c87c4a4294c076c44fed7fc58ea4444f3330879c5e8ff95f2
6
+ metadata.gz: 1de8d38e929bc12e5e3e93a22586cdc81740c69071b956dd01685e835f1007e350476851379220bf192a67444afe51bef4b7e19e4f8bb3a59c876360d4fdca95
7
+ data.tar.gz: '0685c4b3c0286942be26232e4767a94f1194d7babbf5493a6ccdef4dfa45e783da51e63818f24e72fb00422d86cbd6b1947af9b56507680691660c9eff6c93b9'
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # PandocRuby
2
2
 
3
- [![Build Status](https://travis-ci.org/xwmx/pandoc-ruby.svg?branch=master)](https://travis-ci.org/xwmx/pandoc-ruby)
3
+ [![Build Status](https://img.shields.io/github/actions/workflow/status/xwmx/pandoc-ruby/tests.yml?branch=master)](https://github.com/xwmx/pandoc-ruby/actions)
4
4
  [![Gem Version](https://img.shields.io/gem/v/pandoc-ruby)](http://rubygems.org/gems/pandoc-ruby)
5
5
  [![Gem Downloads](https://img.shields.io/gem/dt/pandoc-ruby)](http://rubygems.org/gems/pandoc-ruby)
6
6
 
data/lib/pandoc-ruby.rb CHANGED
@@ -63,6 +63,7 @@ class PandocRuby
63
63
  'beamer' => 'LaTeX beamer slide show',
64
64
  'biblatex' => 'BibLaTeX bibliography',
65
65
  'bibtex' => 'BibTeX bibliography',
66
+ 'chunkedhtml' => 'zip archive of multiple linked HTML files',
66
67
  'commonmark' => 'CommonMark Markdown',
67
68
  'commonmark_x' => 'CommonMark Markdown with extensions',
68
69
  'context' => 'ConTeXt',
@@ -178,7 +179,7 @@ class PandocRuby
178
179
  when String
179
180
  self.input_string = args.shift
180
181
  when Array
181
- self.input_files = args.shift.join(' ')
182
+ self.input_files = args.shift.map { |f| "'#{f}'" }.join(' ')
182
183
  end
183
184
 
184
185
  self.options = args
@@ -285,22 +286,20 @@ class PandocRuby
285
286
  @timeout ||= 31_557_600
286
287
 
287
288
  Open3.popen3(command) do |stdin, stdout, stderr, wait_thr|
288
- begin
289
- Timeout.timeout(@timeout) do
290
- stdin.puts self.input_string
289
+ Timeout.timeout(@timeout) do
290
+ stdin.puts self.input_string
291
291
 
292
- stdin.close
292
+ stdin.close
293
293
 
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
300
-
301
- maybe_ex = "\n#{ex}" if ex
302
- error = "Pandoc timed out after #{@timeout} seconds.#{maybe_ex}"
294
+ output = stdout.read
295
+ error = stderr.read
296
+ exit_status = wait_thr.value
303
297
  end
298
+ rescue Timeout::Error => ex
299
+ Process.kill 9, wait_thr.pid
300
+
301
+ maybe_ex = "\n#{ex}" if ex
302
+ error = "Pandoc timed out after #{@timeout} seconds.#{maybe_ex}"
304
303
  end
305
304
 
306
305
  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.7'
8
+ s.version = '2.1.8'
9
9
  s.authors = ['William Melody']
10
- s.date = '2022-10-30'
10
+ s.date = '2023-10-04'
11
11
  s.description = 'Ruby wrapper for Pandoc'
12
12
  s.email = 'hi@williammelody.com'
13
13
  s.extra_rdoc_files = [
@@ -25,7 +25,8 @@ Gem::Specification.new do |s|
25
25
  pandoc-ruby.gemspec
26
26
  test/benchmark.rb
27
27
  test/files/benchmark.txt
28
- test/files/test.md
28
+ test/files/Test\ File\ 1.md
29
+ test/files/Test\ File\ 2.md
29
30
  test/helper.rb
30
31
  test/test_conversions.rb
31
32
  test/test_pandoc_ruby.rb
@@ -0,0 +1 @@
1
+ # A Second Title
@@ -2,8 +2,8 @@ require 'helper'
2
2
 
3
3
  describe PandocRuby do
4
4
  before do
5
- @file = File.join(File.dirname(__FILE__), 'files', 'test.md')
6
- @file2 = File.join(File.dirname(__FILE__), 'files', 'test2.md')
5
+ @file = File.join(File.dirname(__FILE__), 'files', 'Test File 1.md')
6
+ @file2 = File.join(File.dirname(__FILE__), 'files', 'Test File 2.md')
7
7
  @string = '# Test String'
8
8
  @converter = PandocRuby.new(@string, :t => :rst)
9
9
  end
@@ -318,15 +318,13 @@ describe PandocRuby do
318
318
  end
319
319
 
320
320
  it 'runs more than 400 times without error' do
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
321
+ 400.times do
322
+ PandocRuby.convert(@string)
329
323
  end
324
+
325
+ assert true
326
+ rescue Errno::EMFILE, Errno::EAGAIN => e
327
+ flunk e
330
328
  end
331
329
 
332
330
  it 'gracefully times out when pandoc hangs due to malformed input' do
@@ -396,6 +394,7 @@ describe PandocRuby do
396
394
  'beamer' => 'LaTeX beamer slide show',
397
395
  'biblatex' => 'BibLaTeX bibliography',
398
396
  'bibtex' => 'BibTeX bibliography',
397
+ 'chunkedhtml' => 'zip archive of multiple linked HTML files',
399
398
  'commonmark' => 'CommonMark Markdown',
400
399
  'commonmark_x' => 'CommonMark Markdown with extensions',
401
400
  'context' => 'ConTeXt',
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.7
4
+ version: 2.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - William Melody
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-10-30 00:00:00.000000000 Z
11
+ date: 2023-10-04 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Ruby wrapper for Pandoc
14
14
  email: hi@williammelody.com
@@ -27,8 +27,9 @@ files:
27
27
  - lib/pandoc-ruby.rb
28
28
  - pandoc-ruby.gemspec
29
29
  - test/benchmark.rb
30
+ - test/files/Test File 1.md
31
+ - test/files/Test File 2.md
30
32
  - test/files/benchmark.txt
31
- - test/files/test.md
32
33
  - test/helper.rb
33
34
  - test/test_conversions.rb
34
35
  - test/test_pandoc_ruby.rb
@@ -51,7 +52,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
51
52
  - !ruby/object:Gem::Version
52
53
  version: '0'
53
54
  requirements: []
54
- rubygems_version: 3.2.22
55
+ rubygems_version: 3.4.1
55
56
  signing_key:
56
57
  specification_version: 4
57
58
  summary: PandocRuby
File without changes