pandoc-ruby 2.1.7 → 2.1.9

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: 3f0503e8f6d7bb09848aceb04cb22f8342d3859f6a11149b9fd506a1f96e122f
4
+ data.tar.gz: d3eee89beb253cf547480fcbd46d59dbbb545afccca0e8ff15c3f4fc5e618078
5
5
  SHA512:
6
- metadata.gz: d6d95a2ef03edcaac8a5d8d6c101a5eccd0434c7466369d74e93fa46c09439640dda15400f8f03b040398c350a9ded573ea8fcd3d063b4c082ee7bec93f403a9
7
- data.tar.gz: c578ac85aadd2627361a5e7488d5dce60419ee340dbcd8167a16d9445fc12a8a52e8f01242039e5c87c4a4294c076c44fed7fc58ea4444f3330879c5e8ff95f2
6
+ metadata.gz: dda480f6dcc7ca05700edb31f647f678fac216eb8cb485e4d38affb025ad74f5c5d990c2c7a8f10b4aae7334c3974c6f3c1d777515b206aa1fd48ac1e9874ffa
7
+ data.tar.gz: 0abd2b2e7cf612ff82286df611f2c9a8eda4a8238c104b0c1244a8499452ce7795ae7af80bb7fce4ab3323ec4ac5a44e5c1c22f435daf5084902726ca15781b3
data/Gemfile CHANGED
@@ -10,4 +10,5 @@ group :development, :test do
10
10
  gem 'mocha'
11
11
  gem 'rake'
12
12
  gem 'rdoc'
13
+ gem 'rubocop'
13
14
  end
data/Gemfile.lock CHANGED
@@ -1,10 +1,44 @@
1
1
  GEM
2
2
  remote: http://rubygems.org/
3
3
  specs:
4
- minitest (5.14.4)
5
- mocha (1.13.0)
4
+ ast (2.4.2)
5
+ base64 (0.1.1)
6
+ json (2.6.3)
7
+ language_server-protocol (3.17.0.3)
8
+ minitest (5.20.0)
9
+ mocha (2.1.0)
10
+ ruby2_keywords (>= 0.0.5)
11
+ parallel (1.23.0)
12
+ parser (3.2.2.4)
13
+ ast (~> 2.4.1)
14
+ racc
15
+ psych (5.1.0)
16
+ stringio
17
+ racc (1.7.1)
18
+ rainbow (3.1.1)
6
19
  rake (13.0.6)
7
- rdoc (6.3.3)
20
+ rdoc (6.5.0)
21
+ psych (>= 4.0.0)
22
+ regexp_parser (2.8.1)
23
+ rexml (3.2.6)
24
+ rubocop (1.56.4)
25
+ base64 (~> 0.1.1)
26
+ json (~> 2.3)
27
+ language_server-protocol (>= 3.17.0)
28
+ parallel (~> 1.10)
29
+ parser (>= 3.2.2.3)
30
+ rainbow (>= 2.2.2, < 4.0)
31
+ regexp_parser (>= 1.8, < 3.0)
32
+ rexml (>= 3.2.5, < 4.0)
33
+ rubocop-ast (>= 1.28.1, < 2.0)
34
+ ruby-progressbar (~> 1.7)
35
+ unicode-display_width (>= 2.4.0, < 3.0)
36
+ rubocop-ast (1.29.0)
37
+ parser (>= 3.2.1.0)
38
+ ruby-progressbar (1.13.0)
39
+ ruby2_keywords (0.0.5)
40
+ stringio (3.0.8)
41
+ unicode-display_width (2.5.0)
8
42
 
9
43
  PLATFORMS
10
44
  ruby
@@ -14,6 +48,7 @@ DEPENDENCIES
14
48
  mocha
15
49
  rake
16
50
  rdoc
51
+ rubocop
17
52
 
18
53
  BUNDLED WITH
19
54
  2.2.28
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.9'
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.9
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