pandocomatic 0.0.10 → 0.0.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: efffec683c3637d515e38f52cb5bae086b6370fb
4
- data.tar.gz: 0eaee541072d94c45269d15a922d4d9c7ff64d59
3
+ metadata.gz: bb7b5f8d314027e1992b652298a0b0a51a15c0f6
4
+ data.tar.gz: dddff694243f9ef06a50bb96c58807f948c9d7bd
5
5
  SHA512:
6
- metadata.gz: 015290673a49536d9201f385fcb6b33dc8d2d9242d1592607a01cd868c3f740b498824756cc177888f4cbdec11a2ff1b9c5a054b25070d843e7a28ca1cb7d107
7
- data.tar.gz: db20487b149bca4f44634b2f675e11940e94bb364c4bb7427fce399bbf72461178f7060a5290e7070551e161acd688d360699718d60bde269c286efd9d9f212f
6
+ metadata.gz: fa659496dfb9041e85b0ecf536686f421b77dd2f4b7d8ff35c350a1a364f6b6cfb0b743adc31678d959565e1256846bf3165210580f613350ec49017f006f281
7
+ data.tar.gz: fea66ce86d26b5ff986417813ab62b9f40590effdc3f26d854153bbab35b14f2c22216010f225050381b6f0d14799bbbfad84f1463e5d8d5c2ef725b4516f768
data/bin/pandocomatic CHANGED
@@ -8,7 +8,7 @@ require_relative '../lib/pandocomatic/file_converter.rb'
8
8
  require_relative '../lib/pandocomatic/configuration.rb'
9
9
 
10
10
  opts = Trollop::options do
11
- version "pandocomatic 0.0.3"
11
+ version "pandocomatic 0.0.12"
12
12
  banner <<-EOB
13
13
 
14
14
  Pandocomatic automates the use of pandoc (<http://www.pandoc.org>). It can be
@@ -66,6 +66,7 @@ module Pandocomatic
66
66
  converter.send option, value unless option == 'output'
67
67
  # don't let pandoc write the output to enable postprocessing
68
68
  end
69
+
69
70
  converter << input
70
71
  end
71
72
 
@@ -5,7 +5,7 @@ module Pandocomatic
5
5
  require 'paru/pandoc'
6
6
 
7
7
  class PandocMetadata < Hash
8
-
8
+
9
9
  # Paru converters:
10
10
  # Note. When converting metadata back to the pandoc markdown format, you have
11
11
  # to use the option "standalone", otherwise the metadata is skipped
@@ -26,39 +26,39 @@ module Pandocomatic
26
26
  # Collect the metadata embedded in the src file
27
27
  def self.load_file src
28
28
  begin
29
- yaml_metadata = pandoc2yaml File.read(src)
29
+ yaml_metadata = PandocMetadata.pandoc2yaml src
30
30
  if yaml_metadata.empty? then
31
- return PandocMetadata.new
31
+ return PandocMetadata.new
32
32
  else
33
- return PandocMetadata.new YAML.load(yaml_metadata)
33
+ return PandocMetadata.new YAML.load(yaml_metadata)
34
34
  end
35
35
  rescue Exception => e
36
36
  raise "Error while reading metadata from #{src}; Are you sure it is a pandoc markdown file?\n#{e.message}"
37
37
  end
38
38
  end
39
39
 
40
- def self.pandoc2yaml document
41
- json = JSON.parse(PANDOC_2_JSON << File.read(document))
42
- yaml = ""
40
+ def self.pandoc2yaml path
41
+ json = JSON.parse(PANDOC_2_JSON << File.read(path))
42
+ yaml = ""
43
43
 
44
- version, metadata = json.values_at(VERSION, META)
44
+ version, metadata = json.values_at(VERSION, META)
45
45
 
46
- if not metadata.empty? then
47
- metadata_document = {
48
- VERSION => version,
49
- META => metadata,
50
- BLOCKS => []
51
- }
46
+ if not metadata.empty? then
47
+ metadata_document = {
48
+ VERSION => version,
49
+ META => metadata,
50
+ BLOCKS => []
51
+ }
52
52
 
53
- yaml = JSON_2_PANDOC << JSON.generate(metadata_document)
54
- end
53
+ yaml = JSON_2_PANDOC << JSON.generate(metadata_document)
54
+ end
55
55
 
56
- yaml
56
+ yaml
57
57
  end
58
58
 
59
59
  def has_template?
60
60
  self['pandocomatic'] and self['pandocomatic']['use-template'] and
61
- not self['pandocomatic']['use-template'].empty?
61
+ not self['pandocomatic']['use-template'].empty?
62
62
  end
63
63
 
64
64
  def template_name
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pandocomatic
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.10
4
+ version: 0.0.12
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: 2016-11-09 00:00:00.000000000 Z
11
+ date: 2016-12-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: paru
@@ -19,7 +19,7 @@ dependencies:
19
19
  version: '0.2'
20
20
  - - ">="
21
21
  - !ruby/object:Gem::Version
22
- version: 0.2.0
22
+ version: 0.2.1
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
@@ -29,7 +29,7 @@ dependencies:
29
29
  version: '0.2'
30
30
  - - ">="
31
31
  - !ruby/object:Gem::Version
32
- version: 0.2.0
32
+ version: 0.2.1
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: trollop
35
35
  requirement: !ruby/object:Gem::Requirement