dimples 6.2.3 → 6.2.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/dimples/frontable.rb +3 -1
- data/lib/dimples/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a0ea0c6cc23d5e09079f09828f159d8cda5e0de7
|
4
|
+
data.tar.gz: 7fc9338112314af6481c33eb21237a51443c4893
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e5fe5e465843b2a68cd2d2e814cfa1021f369bbf6b9a0ad54f040018dfad87470f6d68725a2e1e8acf87c098b7fc4334f01fb7cba66591c0e32eb8f8c59d712f
|
7
|
+
data.tar.gz: aae17af68dbe6069021d9b50c380fafdbea2a071deeec780d93d166604af386e620e674b6961be28b561b014f858da5ebc146e8605e29659b414c030cb6c5eaa
|
data/lib/dimples/frontable.rb
CHANGED
@@ -3,10 +3,12 @@
|
|
3
3
|
module Dimples
|
4
4
|
# Adds the ability to read frontmatter from a file.
|
5
5
|
module Frontable
|
6
|
+
FRONT_MATTER_PATTERN = /^(-{3}\n.*?\n?)^(-{3}*$\n?)/m.freeze
|
7
|
+
|
6
8
|
def read_with_front_matter(path)
|
7
9
|
contents = File.read(path)
|
8
10
|
|
9
|
-
if (matches = contents.match(
|
11
|
+
if (matches = contents.match(FRONT_MATTER_PATTERN))
|
10
12
|
metadata = Hashie.symbolize_keys(YAML.safe_load(matches[1]))
|
11
13
|
contents = matches.post_match.strip
|
12
14
|
else
|
data/lib/dimples/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dimples
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 6.2.
|
4
|
+
version: 6.2.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel Bogan
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-03-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: hashie
|