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.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/paru.rb +1 -1
  3. data/lib/paru/pandoc.rb +8 -6
  4. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0c8e2c7d691eaaea71734ab1934a67f2a32890bd63d688ca0b6130143aa19093
4
- data.tar.gz: 7fa3ac4f409b8efc0a9803ac59b51223f71c8e50bd74ff10c569ee05da0bf69c
3
+ metadata.gz: cd33d3d1738034e8ffeb4edcf0430d51f8f0dc05f23511535a4ba3e33c923d23
4
+ data.tar.gz: c430452f484459c451088ad84db7b603748ed67b3397250c6ad0e1c1773fb89d
5
5
  SHA512:
6
- metadata.gz: 3e721edcff3239553dc40c970b077da4a23fc9fa21785cc0ce9234c8ef7599a9a9b6b5d8a2e6ffb57648100eea4e1cde0414b19c270e72cf4ee83881492224cf
7
- data.tar.gz: 577821db0a3656f5a1ee0a667457249090fee45f269f2a8c24bbb5900a662cf1a564a1be17f1768f97372b232acc94804e78fb69a9d653e0aef49121f8414141
6
+ metadata.gz: 89f884fd65ffa81c1be750c5d5ad82d96805c81cfedd3d52c9481e817f9d3cdc47d4a4c79f8d396264d18e9ac4d5dc574e7e5a720ce288a38441eefbc32649e7
7
+ data.tar.gz: 3c12fd5b577195595dec08a398a01dcec4d1297b41a97768fa3077b13c224a385aa0eec624275b98c2db5a938a12efccdc6cfc984f968331ddaf1b6b98c9bf48
@@ -18,5 +18,5 @@
18
18
  #++
19
19
  module Paru
20
20
  # Paru's current version
21
- VERSION = [0, 4, 1, 0]
21
+ VERSION = [0, 4, 1, 2]
22
22
  end
@@ -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 => String, :data_dir => String}] Pandoc's
96
- # version, such as "1.17.0.4" and the data directory, such as "/home/huub/.pandoc".
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.match(/pandoc.* (\d+\.\d+.*)$/)[1]
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 "2.7" <= version then
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.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-13 00:00:00.000000000 Z
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