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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 85ded40d24e588b3548c0a6ba6fa4db163a2685a
4
- data.tar.gz: 530f631fc2d9636b7b99bb69f1a6f0cb22f26abc
3
+ metadata.gz: a0ea0c6cc23d5e09079f09828f159d8cda5e0de7
4
+ data.tar.gz: 7fc9338112314af6481c33eb21237a51443c4893
5
5
  SHA512:
6
- metadata.gz: cdeb5970e309864e4fe0f91a9f560d9823516c5a0fd9d8ec114fab6024fc0cb97b1036adfbe2551dc881a63989461e77bb81ebb162e1037114946943c653aaa6
7
- data.tar.gz: ceaff9abb541fa96e00f064e18c8d016bd600db7dd0f1b83e60e04426a29d0e1efbdd4d6cc7728c8895478a281e8dddce100daf15f5c98804368487cf6f297bd
6
+ metadata.gz: e5fe5e465843b2a68cd2d2e814cfa1021f369bbf6b9a0ad54f040018dfad87470f6d68725a2e1e8acf87c098b7fc4334f01fb7cba66591c0e32eb8f8c59d712f
7
+ data.tar.gz: aae17af68dbe6069021d9b50c380fafdbea2a071deeec780d93d166604af386e620e674b6961be28b561b014f858da5ebc146e8605e29659b414c030cb6c5eaa
@@ -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(/^(-{3}\n.*?\n?)^(-{3}*$\n?)/m))
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Dimples
4
- VERSION = '6.2.3'
4
+ VERSION = '6.2.4'
5
5
  end
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.3
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: 2018-12-05 00:00:00.000000000 Z
11
+ date: 2019-03-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: hashie