paru 0.4.1.1 → 0.4.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/paru.rb +1 -1
- data/lib/paru/pandoc.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: cd33d3d1738034e8ffeb4edcf0430d51f8f0dc05f23511535a4ba3e33c923d23
|
4
|
+
data.tar.gz: c430452f484459c451088ad84db7b603748ed67b3397250c6ad0e1c1773fb89d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 89f884fd65ffa81c1be750c5d5ad82d96805c81cfedd3d52c9481e817f9d3cdc47d4a4c79f8d396264d18e9ac4d5dc574e7e5a720ce288a38441eefbc32649e7
|
7
|
+
data.tar.gz: 3c12fd5b577195595dec08a398a01dcec4d1297b41a97768fa3077b13c224a385aa0eec624275b98c2db5a938a12efccdc6cfc984f968331ddaf1b6b98c9bf48
|
data/lib/paru.rb
CHANGED
data/lib/paru/pandoc.rb
CHANGED
@@ -92,8 +92,8 @@ module Paru
|
|
92
92
|
# directory. This method is typically used in scripts that use Paru to
|
93
93
|
# automate the use of pandoc.
|
94
94
|
#
|
95
|
-
# @return [Hash{:version =>
|
96
|
-
# version, such as "
|
95
|
+
# @return [Hash{:version => Array<Integer>, :data_dir => String}] Pandoc's
|
96
|
+
# version, such as "[2.10.1]" and the data directory, such as "/home/huub/.pandoc".
|
97
97
|
def self.info()
|
98
98
|
@@info
|
99
99
|
end
|
@@ -226,9 +226,13 @@ module Paru
|
|
226
226
|
throw Error.new "Unable to run pandoc via command '#{@@pandoc_exec} --version': #{err.message}"
|
227
227
|
end
|
228
228
|
|
229
|
-
version = version_string
|
229
|
+
version = version_string
|
230
|
+
.match(/pandoc.* (\d+\.\d+.*)$/)[1]
|
231
|
+
.split(".")
|
232
|
+
.map {|s| s.to_i}
|
233
|
+
major_version, minor_version = version
|
230
234
|
|
231
|
-
if
|
235
|
+
if major_version >= 2 and minor_version >= 7 then
|
232
236
|
# Pandoc version 2.7 introduced a new default data dir to comply
|
233
237
|
# with XDG Base Directory Specification
|
234
238
|
xdg_data_dir, old_data_dir = version_string.match(/Default user data directory: (.+)$/)[1].split(" or ")
|
@@ -254,8 +258,6 @@ module Paru
|
|
254
258
|
}
|
255
259
|
|
256
260
|
# Load the options for the appropriate major version of pandoc
|
257
|
-
major_version = @@info[:version].split(".").first.to_i
|
258
|
-
|
259
261
|
if not [1, 2].include? major_version
|
260
262
|
throw Error.new "Unknown major pandoc version: '#{major_version}'. Expected the major version to be '1' or '2'. Please check the pandoc path: '#{@@pandoc_exec}'."
|
261
263
|
# defaults to version 1
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: paru
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.1.
|
4
|
+
version: 0.4.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Huub de Beer
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-07-
|
11
|
+
date: 2020-07-16 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Control pandoc with Ruby and write pandoc filters in Ruby
|
14
14
|
email: Huub@heerdebeer.org
|