pandocomatic 1.0.2 → 1.0.3
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:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 4c076c8f5e123d032fb9f61b0f7cb2b8db675d496a9171827e34ef5f5b47ddbe
|
|
4
|
+
data.tar.gz: 1e5dfe4ae9c1c47c93b671060da64990649756dd4b2d10e25c77c843cfc23f56
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f71e622fd7e58a44680c7215fd2fa21f33745b86096fa83fdd5afaf1dcff282686314e940b612bc9c20217e01c52f9e716c93057b6790dbd6975dc8ff3e341ae
|
|
7
|
+
data.tar.gz: 0e83c27eec99ae024c7002caca9c063a51d39f621d345c19f4118c3cc1b667bedfc9558d5f4bba1be01d9ae54433d752a472248f9c512b75ecb9b23e22b54f28
|
|
@@ -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.
|
|
@@ -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
|