pandocomatic 1.0.1 → 1.0.4
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9d2c2e76a3d73359f43d563ea503667606e243d5ac6513fafe5cac1f1f52e43d
|
4
|
+
data.tar.gz: baf4545d3a1415884a6b1f7a5384ffb21e1f0b958b58f0a55110d991995189b9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bfcb9b97e4777d20569d33e25a0e065e9406f1cb240c24ad42752caa9cf10a558331656c252fcaf7deb4ad1e0b2d5d9564edb5d5cf03ed98df9d6c6c6a877b3d
|
7
|
+
data.tar.gz: '082a2d5afca91752ca9c29ed3b620b6294b9c2ada67609c5c4dde5e1cf665cf3c93574c106f3420e5220d01aef7b09e46d7e8fff1c4a04b43867b7f3876c3681'
|
@@ -28,7 +28,7 @@ module Pandocomatic
|
|
28
28
|
require_relative './pandocomatic_yaml'
|
29
29
|
|
30
30
|
# Regular expression to find metadata blocks in a string.
|
31
|
-
METADATA_BLOCK = /^---[ \t]*(\r\n|\r|\n)(.+?)^(?:---|\.\.\.)[ \t]*(\r\n|\r|\n)/m
|
31
|
+
METADATA_BLOCK = /^---[ \t]*(\r\n|\r|\n)(.+?)^(?:---|\.\.\.)[ \t]*(\r\n|\r|\n)/m.freeze
|
32
32
|
|
33
33
|
# PandocMetadata represents the metadata with pandoc options set in
|
34
34
|
# templates and input files.
|
@@ -184,7 +184,7 @@ module Pandocomatic
|
|
184
184
|
# If more than one pandocomatic property is contained in the input,
|
185
185
|
# all but the first are discarded and are not present in the
|
186
186
|
# extracted metadata YAML string.
|
187
|
-
private_class_method def self.extract_metadata(input, path)
|
187
|
+
private_class_method def self.extract_metadata(input, path = nil)
|
188
188
|
metadata_blocks = MetadataBlockList.new input, path
|
189
189
|
|
190
190
|
["#{YAML.dump(metadata_blocks.full)}...", metadata_blocks.count_pandocomatic_blocks]
|
@@ -32,7 +32,7 @@ module Pandocomatic
|
|
32
32
|
PERMITTED_YAML_CLASSES = [Date].freeze
|
33
33
|
|
34
34
|
# Regular expression representing environment variables in templates
|
35
|
-
VAR_PATTERN = /\$\((?<var>[a-zA-Z_][a-zA-Z0-9_]*)\)
|
35
|
+
VAR_PATTERN = /\$\((?<var>[a-zA-Z_][a-zA-Z0-9_]*)\)\$/.freeze
|
36
36
|
|
37
37
|
# Load a string, substitute any variables, and parse as YAML.
|
38
38
|
#
|
@@ -61,7 +61,7 @@ module Pandocomatic
|
|
61
61
|
str.gsub(VAR_PATTERN) do |_match|
|
62
62
|
key = Regexp.last_match(1)
|
63
63
|
|
64
|
-
raise TemplateError.new :environment_variable_does_not_exist, { key
|
64
|
+
raise TemplateError.new :environment_variable_does_not_exist, { key: key, path: path } unless ENV.key? key
|
65
65
|
|
66
66
|
ENV[key]
|
67
67
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pandocomatic
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Huub de Beer
|
@@ -167,7 +167,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
167
167
|
requirements:
|
168
168
|
- - ">="
|
169
169
|
- !ruby/object:Gem::Version
|
170
|
-
version: 2.
|
170
|
+
version: 2.6.8
|
171
171
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
172
172
|
requirements:
|
173
173
|
- - ">="
|