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: e435d5e708267a647124289aceaede648c297fd6a488c37d8c53e44b7b9c9706
4
- data.tar.gz: 60fd5761776d2573c80b2694e4cc30956416aad1b5fff62426f14ee3cd7c92fc
3
+ metadata.gz: 9d2c2e76a3d73359f43d563ea503667606e243d5ac6513fafe5cac1f1f52e43d
4
+ data.tar.gz: baf4545d3a1415884a6b1f7a5384ffb21e1f0b958b58f0a55110d991995189b9
5
5
  SHA512:
6
- metadata.gz: c3dd28212e932b9b62ba012008a972c6b9666624444e689d7aeb64ba961c2849a643f6c644b02a4427e3262bdc6c6e155d1b3698d5927ffc5a0f39bc1dcee2bb
7
- data.tar.gz: 1cc12f1cceaa6facf2455c6268e8dbda82b80c7580178f6b9f95de8e297207863c5cf953e63c0706113dab45960c9598d28a57d98487dedfd728b9f61814f268
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]
@@ -48,7 +48,7 @@ module Pandocomatic
48
48
  ERROR_STATUS = 1266 # This is the sum of the ASCII values of the characters in 'pandocomatic'
49
49
 
50
50
  # Pandocomatic's current version
51
- VERSION = [1, 0, 1].freeze
51
+ VERSION = [1, 0, 4].freeze
52
52
 
53
53
  # rubocop:disable Metrics
54
54
 
@@ -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:, path: } unless ENV.key? 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.1
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.7.6
170
+ version: 2.6.8
171
171
  required_rubygems_version: !ruby/object:Gem::Requirement
172
172
  requirements:
173
173
  - - ">="