pandocomatic 0.2.5.0 → 0.2.5.1

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
  SHA256:
3
- metadata.gz: c06eec24affb54e4be5ef0001947cdcd926cf6633d178d22214ef1c069d6ef4f
4
- data.tar.gz: 213c8c84c92573b2a0120243a64a0071b6b38382aefc7084a4bb744e2376d68a
3
+ metadata.gz: d6a91e1ee77a00b1064990b56b389a42ac5d81941d77165c983b100ec1642d13
4
+ data.tar.gz: 56233af1ce48cc32a24aba970d08972760bd9b21c4fe31151bac14ceccae6c8e
5
5
  SHA512:
6
- metadata.gz: 90e7117da32ff9bb5af3c5e9d2c15cd0147af94b96a477faf4ab694022082ec1adcdd3dd29796c929c9ad6cf672d2582a36f44a8c852c34e4fb19dc6063a8d59
7
- data.tar.gz: 906b949a52464bc6df6433c8c7bd8c69b49141e3657c2bc263e26eb1af9c317648d2815365df3450c9af30cb632c2f7708f3c20018c80bdeab9c2099342f3608
6
+ metadata.gz: 3df9df16cc6950d3f58396b722fbcaa78a2d29fbb0ca9a9cebb9dd9d2c4cc1047c0f4a1bcfd8306b48559d6df6bfce327ff319116f0a6fc5ec5451af95578eda
7
+ data.tar.gz: bda77fdbe40a60ac3e4d9f681009b745f83769382de0d6d313a685a7545533ae1953b054a7cfdd29e404aab1fe1f22d416e3abae367d7acc9822af67d9ba794b
@@ -191,21 +191,32 @@ module Pandocomatic
191
191
 
192
192
  pandocomatic_blocks = 0
193
193
 
194
- metadata_blocks = metadata_blocks.each do |metadata|
195
- metadata.delete_if do |key|
196
- if key == "pandocomatic_" or key == "pandocomatic"
197
- pandocomatic_blocks += 1
198
-
199
- 1 < pandocomatic_blocks
200
- else
201
- false
202
- end
194
+ metadata_blocks = metadata_blocks
195
+ .select {|m| not m.nil? and not m.empty?}
196
+ .each do |metadata|
197
+ metadata.delete_if do |key|
198
+ if key == "pandocomatic_" or key == "pandocomatic"
199
+ pandocomatic_blocks += 1
200
+
201
+ 1 < pandocomatic_blocks
202
+ else
203
+ false
204
+ end
203
205
  end
204
206
  end
205
207
 
206
- yaml_string = metadata_blocks
207
- .map {|metadata| YAML.dump(metadata)}
208
- .join("\n")
208
+ # According to the pandoc manual: "A document may contain multiple
209
+ # metadata blocks. The metadata fields will be combined through a
210
+ # left-biased union: if two metadata blocks attempt to set the
211
+ # same field, the value from the first block will be taken."
212
+ #
213
+ # Here we do the same
214
+ full_metadata = Hash.new
215
+ metadata_blocks
216
+ .reverse
217
+ .each {|block| full_metadata.merge!(block)}
218
+
219
+ yaml_string = YAML.dump(full_metadata) + "..."
209
220
 
210
221
  return [yaml_string, pandocomatic_blocks]
211
222
  end
@@ -47,7 +47,7 @@ module Pandocomatic
47
47
  ERROR_STATUS = 1266 # This is the sum of the ascii values of the characters in 'pandocomatic'
48
48
 
49
49
  # Pandocomatic's current version
50
- VERSION = [0, 2, 5, 0]
50
+ VERSION = [0, 2, 5, 1]
51
51
 
52
52
  # Run pandocomatic given options
53
53
  #
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.2.5.0
4
+ version: 0.2.5.1
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: 2019-04-06 00:00:00.000000000 Z
11
+ date: 2019-04-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: paru
@@ -78,9 +78,9 @@ dependencies:
78
78
  - - "~>"
79
79
  - !ruby/object:Gem::Version
80
80
  version: 0.9.18
81
- description: Pandocomatic is a tool to automate using pandoc (<http://pandoc.org>).
82
- With pandocomatic you can express common patterns of using pandoc for generating
83
- your documents. Applied to a directory, pandocomatic can act as a static site generator.
81
+ description: Pandocomatic is a tool to automate using pandoc. With pandocomatic you
82
+ can express common patterns of using pandoc for generating your documents. Applied
83
+ to a directory, pandocomatic can act as a static site generator.
84
84
  email: Huub@heerdebeer.org
85
85
  executables:
86
86
  - pandocomatic
@@ -154,10 +154,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
154
154
  - !ruby/object:Gem::Version
155
155
  version: '0'
156
156
  requirements:
157
- - pandoc, a universal document converer <http://pandoc.org>
157
+ - pandoc, a universal document converter
158
158
  rubyforge_project:
159
159
  rubygems_version: 2.7.7
160
160
  signing_key:
161
161
  specification_version: 4
162
- summary: Automating the use of pandoc
162
+ summary: Automate the use of pandoc
163
163
  test_files: []