paru 0.2.2 → 0.2.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/paru/pandoc.rb +17 -0
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1f9744e21c17335e591270f4332e03a7fcbd7230
4
- data.tar.gz: 250f63c5dd1858e568b57613824c27676d0b4220
3
+ metadata.gz: a4c10cfc64027013b5ce47891486bb4420b7d5ad
4
+ data.tar.gz: c4db7b91a605c04c628bade971783713137ca98e
5
5
  SHA512:
6
- metadata.gz: 73498311b6eef5f2edea155981816aa529f84b8adb1097d4625f73e2afc0dd1d2808acd5bc14e9a010903a1304c297136ee51d2959634344f38ef1a3ed61960f
7
- data.tar.gz: 012ba505e5af505770b98647e8e2585a3a36330f7f48aa3072d03debdbfee7c8d1712869cdd5465048ef38554298d67e0ea366399cf470cffcd7638b5a497faa
6
+ metadata.gz: 749e3acf6c0bd0c3618a988d55f1febfda28e18de72192af80e84ac5f142596fc466c0c0805c241af2dd2595bfa654bda4798a7ffd6fa47b64f32b541a915137
7
+ data.tar.gz: e873c7d78748a3cdb192625c2fc5b3f0870d9fb6e257f4ff87adc62542ed7e09f6953ef2ff2e3887a31058ca90865e77688fe1bb12fe16dd69019d33e7af4813
data/lib/paru/pandoc.rb CHANGED
@@ -27,6 +27,23 @@ module Paru
27
27
 
28
28
  class Pandoc
29
29
 
30
+ # Gather information about pandoc. It runs `pandoc --version` and extracts
31
+ # pandoc's version number and default data directory.
32
+ def self.info
33
+ output = ''
34
+ IO.popen('pandoc --version', 'r+') do |p|
35
+ p.close_write
36
+ output << p.read
37
+ end
38
+ version = output.match(/pandoc (\d+\.\d+)$/)[1]
39
+ data_dir = output.match(/Default user data directory: (.+)$/)[1]
40
+
41
+ {
42
+ :version => version,
43
+ :data_dir => data_dir
44
+ }
45
+ end
46
+
30
47
  def initialize &block
31
48
  @options = {}
32
49
  configure(&block) if block_given?
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: paru
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Huub de Beer