jekyll-fm 9.0.0 → 10.0.0

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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/jekyll/fm.rb +20 -1
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b92af64abfe6344b05a393631a22bd0da6e3bbca
4
- data.tar.gz: e159a0166179df4bf36517aa49284cb51ce48d40
3
+ metadata.gz: ea378d28c559ef9175487ff31cf6b995707243cd
4
+ data.tar.gz: bb3ee8a16b91d2b8baf9eb419a20f96b5ed4de24
5
5
  SHA512:
6
- metadata.gz: 7d2a5086546f8abf8a8e3de318da10e2d248ecc857e27076f0f43e0991fb91418eb97c74aa5c9b78b3b002aa37cec7eb6e6429f0ceb059f2479ac14a4dd0f781
7
- data.tar.gz: d599f708288505ee03b690de12f9482f2aa2cc5812358476c0263bc4f7b902120ef957932f9eee06a0f6c2bff85815ec0d941c020f5e651225b23a22c6e85619
6
+ metadata.gz: e4364d349489e865f3f81653be29c5d32618517add1d12fa6bb8e96d13200f71310be69a5df6831a16c2e5c5d7bf46b968a63b2fd0450813181e005743986924
7
+ data.tar.gz: 99eea316290ae1c3f92dbeaccd6b770dabb236aec0a1abc83b24dffa52dc575c37962ea9e144b75ea22a5e2b1f62dc5242434feebdf4d40e84fac80ba6a3eff1
@@ -1,3 +1,22 @@
1
+ require 'yaml'
2
+
3
+ class Yaml
4
+ # @!attribute [r] whitelist_classes
5
+ # Classes that may be parsed by #call.
6
+ attr_reader :whitelist_classes
7
+
8
+ def initialize(whitelist_classes: [])
9
+ @whitelist_classes = whitelist_classes
10
+ end
11
+
12
+ # Loads a hash front matter from a string
13
+ #
14
+ # @param string [String] front matter string representation
15
+ # @return [Hash] front matter hash representation
16
+ def call(string)
17
+ YAML.safe_load(string, whitelist_classes)
18
+ end
19
+ end
1
20
 
2
21
  def syntax_from_pathname(pathname)
3
22
  File.extname(pathname)[1..-1].to_sym
@@ -5,7 +24,7 @@ end
5
24
 
6
25
  def parse_file(pathname)
7
26
  syntax_parser |= syntax_from_pathname(pathname)
8
- loader = Loader::Yaml.new
27
+ loader = Yaml.new
9
28
  File.open(pathname) do |file|
10
29
  new(syntax_parser, loader: loader).call(file.read)
11
30
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-fm
3
3
  version: !ruby/object:Gem::Version
4
- version: 9.0.0
4
+ version: 10.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - A E