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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d6a91e1ee77a00b1064990b56b389a42ac5d81941d77165c983b100ec1642d13
4
- data.tar.gz: 56233af1ce48cc32a24aba970d08972760bd9b21c4fe31151bac14ceccae6c8e
3
+ metadata.gz: 3e92a9d840a361de049ef2e4781ea01aadd9c0d01dcc59e797d8aae008130468
4
+ data.tar.gz: 4270db08e6f9a2af1ba3557fa5f4ae5feb5e03737c67ae4111f4ff74dd32ef3d
5
5
  SHA512:
6
- metadata.gz: 3df9df16cc6950d3f58396b722fbcaa78a2d29fbb0ca9a9cebb9dd9d2c4cc1047c0f4a1bcfd8306b48559d6df6bfce327ff319116f0a6fc5ec5451af95578eda
7
- data.tar.gz: bda77fdbe40a60ac3e4d9f681009b745f83769382de0d6d313a685a7545533ae1953b054a7cfdd29e404aab1fe1f22d416e3abae367d7acc9822af67d9ba794b
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
- @options[:output_given] and @options[:output]
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
- pandocomatic_blocks = 0
193
-
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
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 = Hash.new
215
- metadata_blocks
203
+ full_metadata = metadata_blocks
216
204
  .reverse
217
- .each {|block| full_metadata.merge!(block)}
205
+ .reduce(Hash.new) {|metadata, block| metadata.merge!(block)}
218
206
 
219
207
  yaml_string = YAML.dump(full_metadata) + "..."
220
208
 
@@ -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, 1]
50
+ VERSION = [0, 2, 5, 2]
51
51
 
52
52
  # Run pandocomatic given options
53
53
  #
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.1
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-10 00:00:00.000000000 Z
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: 2.7.7
159
+ rubygems_version: 3.0.0.beta1
160
160
  signing_key:
161
161
  specification_version: 4
162
162
  summary: Automate the use of pandoc