impression 0.7 → 0.7.1

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: 871b003a25f9dd74ea137c483c2c208bdad9cf505d544c085f1f84eff394a278
4
- data.tar.gz: 55623ee42bbc7213ef37c6632b1d4807b882301d133bc324607878857b7110c4
3
+ metadata.gz: 27ba311a12a9ce237fd7eaef9102d859bd419471815b58ddea49f5d2879965f7
4
+ data.tar.gz: 4bf89153122f79e8c11ebf9f66f6ebc2d1c33858d0393fcfa3ff1698f9feab8f
5
5
  SHA512:
6
- metadata.gz: 29437cfb294efff3d90c7bcfa82bf05bba184b0ea4f68f13097650c2af17440e2d1294d95e06c17b981a4066c58dde70ac77fd3b8fbacb9ca7a676d08dfc71be
7
- data.tar.gz: a787832534b192c37bc936f96a0c7b92c97b516dc2857b49fbefedab3a152c73301b6ce09e6b1bf581a77dd14bd8a2fa455c84e693b1ac29d5eb74208058bf33
6
+ metadata.gz: d49af3a42dd499957344bc1b53275841909b793f3ae0e181fbd4a4ebf46f7ea279ae1ac666ff9692bf57579378fd1441acdb9fff100ed41822d5aef128b7ad93
7
+ data.tar.gz: 0a316777f8a8020da38136f587aed8d29fdae45b2216a85a0a1ece6452ab4439f70ffc198878028d8e50449b1a17bef0b1e5b59e1a6925fe35116ac142a6a6b7
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ # 0.7.1 2022-01-24
2
+
3
+ - Improve YAML front matter loading
4
+
1
5
  # 0.7 2022-01-23
2
6
 
3
7
  - Update Papercraft, Refactor Jamstack resource
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- impression (0.7)
4
+ impression (0.7.1)
5
5
  modulation (~> 1.1)
6
6
  papercraft (~> 0.17)
7
7
  polyphony (~> 0.73.1)
@@ -40,8 +40,10 @@ module Impression
40
40
  MD_EXT_REGEXP = /\.md$/.freeze
41
41
  PAGE_EXT_REGEXP = /^(.+)\.(md|html|rb)$/.freeze
42
42
  INDEX_PAGE_REGEXP = /^(.+)?\/index$/.freeze
43
+
43
44
  YAML_OPTS = {
44
- permitted_classes: [Date]
45
+ permitted_classes: [Date],
46
+ symbolize_names: true
45
47
  }.freeze
46
48
 
47
49
  # Returns the path info for the given file path.
@@ -151,10 +153,8 @@ module Impression
151
153
  front_matter = m[1]
152
154
  content = m.post_match
153
155
 
154
- yaml = YAML.load(front_matter, **YAML_OPTS)
155
- yaml.each_with_object(atts) do |(k, v), h|
156
- h[k.to_sym] = v
157
- end
156
+ yaml = YAML.safe_load(front_matter, **YAML_OPTS)
157
+ atts = atts.merge(yaml)
158
158
  end
159
159
 
160
160
  [atts, content]
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Impression
4
- VERSION = '0.7'
4
+ VERSION = '0.7.1'
5
5
  end
@@ -1,6 +1,9 @@
1
1
  ---
2
2
  title: MMM
3
3
  layout: article
4
+ foo:
5
+ bar:
6
+ baz: 42
4
7
  ---
5
8
 
6
9
  ## BBB
@@ -227,6 +227,11 @@ class JamstackTest < MiniTest::Test
227
227
  ext: '.md',
228
228
  title: 'MMM',
229
229
  layout: 'article',
230
+ foo: {
231
+ bar: {
232
+ baz: 42
233
+ }
234
+ },
230
235
  html_content: "<h2 id=\"bbb\">BBB</h2>\n",
231
236
  date: Date.new(2008, 06, 14)
232
237
  },
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: impression
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.7'
4
+ version: 0.7.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sharon Rosner
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-01-23 00:00:00.000000000 Z
11
+ date: 2022-01-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: polyphony