pandocomatic 0.2.5.1 → 0.2.5.2
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 +4 -4
- data/lib/pandocomatic/configuration.rb +5 -1
- data/lib/pandocomatic/pandoc_metadata.rb +6 -18
- data/lib/pandocomatic/pandocomatic.rb +1 -1
- metadata +13 -13
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3e92a9d840a361de049ef2e4781ea01aadd9c0d01dcc59e797d8aae008130468
|
4
|
+
data.tar.gz: 4270db08e6f9a2af1ba3557fa5f4ae5feb5e03737c67ae4111f4ff74dd32ef3d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bc6f2c56cb966587b761351649959588388963113fb8dde40dc889e3a6a37b3492a15458a4392fa505e12b0bbe3917c5dd4efd3f0ea47d806d152642d35f38de
|
7
|
+
data.tar.gz: 3abde8331232dd42beac15feccf00d040aed211d501c6aa02dcba6ac7771c2702f299c3dc6c1525017f15af8e3ffb931a6b945309d73ddad8780d4274385c41e
|
@@ -242,7 +242,7 @@ module Pandocomatic
|
|
242
242
|
#
|
243
243
|
# @return [Boolean]
|
244
244
|
def output?()
|
245
|
-
|
245
|
+
not @options.nil? and @options[:output_given] and @options[:output]
|
246
246
|
end
|
247
247
|
|
248
248
|
# Get the output file name
|
@@ -409,6 +409,10 @@ module Pandocomatic
|
|
409
409
|
destination = rename_destination(rename_script, destination)
|
410
410
|
end
|
411
411
|
end
|
412
|
+
|
413
|
+
# If there is a single file input without output specified, set
|
414
|
+
# the output now that we know what the output filename is.
|
415
|
+
@output = destination.delete_prefix "./" if not output?
|
412
416
|
|
413
417
|
destination
|
414
418
|
end
|
@@ -188,21 +188,10 @@ module Pandocomatic
|
|
188
188
|
metadata_blocks = input
|
189
189
|
.scan(METADATA_BLOCK)
|
190
190
|
.map {|match| YAML.load "---#{match.join()}..."}
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
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
|
205
|
-
end
|
191
|
+
.select {|block| not block.nil? and not block.empty?}
|
192
|
+
|
193
|
+
pandocomatic_blocks = metadata_blocks.count do |block|
|
194
|
+
block.key? "pandocomatic_" or block.key? "pandocomatic"
|
206
195
|
end
|
207
196
|
|
208
197
|
# According to the pandoc manual: "A document may contain multiple
|
@@ -211,10 +200,9 @@ module Pandocomatic
|
|
211
200
|
# same field, the value from the first block will be taken."
|
212
201
|
#
|
213
202
|
# Here we do the same
|
214
|
-
full_metadata =
|
215
|
-
metadata_blocks
|
203
|
+
full_metadata = metadata_blocks
|
216
204
|
.reverse
|
217
|
-
.
|
205
|
+
.reduce(Hash.new) {|metadata, block| metadata.merge!(block)}
|
218
206
|
|
219
207
|
yaml_string = YAML.dump(full_metadata) + "..."
|
220
208
|
|
metadata
CHANGED
@@ -1,53 +1,53 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pandocomatic
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.5.
|
4
|
+
version: 0.2.5.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: 2019-04
|
11
|
+
date: 2019-06-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: paru
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "~>"
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: 0.3.2
|
20
17
|
- - ">="
|
21
18
|
- !ruby/object:Gem::Version
|
22
19
|
version: 0.3.2.0
|
20
|
+
- - "~>"
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: 0.3.2
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
26
26
|
requirements:
|
27
|
-
- - "~>"
|
28
|
-
- !ruby/object:Gem::Version
|
29
|
-
version: 0.3.2
|
30
27
|
- - ">="
|
31
28
|
- !ruby/object:Gem::Version
|
32
29
|
version: 0.3.2.0
|
30
|
+
- - "~>"
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: 0.3.2
|
33
33
|
- !ruby/object:Gem::Dependency
|
34
34
|
name: optimist
|
35
35
|
requirement: !ruby/object:Gem::Requirement
|
36
36
|
requirements:
|
37
|
-
- - "
|
37
|
+
- - ">="
|
38
38
|
- !ruby/object:Gem::Version
|
39
39
|
version: 3.0.0
|
40
|
-
- - "
|
40
|
+
- - "~>"
|
41
41
|
- !ruby/object:Gem::Version
|
42
42
|
version: 3.0.0
|
43
43
|
type: :runtime
|
44
44
|
prerelease: false
|
45
45
|
version_requirements: !ruby/object:Gem::Requirement
|
46
46
|
requirements:
|
47
|
-
- - "
|
47
|
+
- - ">="
|
48
48
|
- !ruby/object:Gem::Version
|
49
49
|
version: 3.0.0
|
50
|
-
- - "
|
50
|
+
- - "~>"
|
51
51
|
- !ruby/object:Gem::Version
|
52
52
|
version: 3.0.0
|
53
53
|
- !ruby/object:Gem::Dependency
|
@@ -156,7 +156,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
156
156
|
requirements:
|
157
157
|
- pandoc, a universal document converter
|
158
158
|
rubyforge_project:
|
159
|
-
rubygems_version:
|
159
|
+
rubygems_version: 3.0.0.beta1
|
160
160
|
signing_key:
|
161
161
|
specification_version: 4
|
162
162
|
summary: Automate the use of pandoc
|