jekyll-page-boilerplate 2.0.0 → 2.1.0

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: 598484bc29508c7785e1dd1e24eb2699b6ecc7aa0ba346ee9c67a4d7530f3cc1
4
- data.tar.gz: e72595d0503e4011384f54fd5d1a076e18796287b380911c1a14a8820d7c33a4
3
+ metadata.gz: cda02e5e566768a18e995b7b409ec9d7563553a2ae576b790e2604bc3200d8d8
4
+ data.tar.gz: 03cad8782fa41bdf0bc26b52739ac0150868c5ae8a5f18aada88004a25d26689
5
5
  SHA512:
6
- metadata.gz: '058701eb91e08f7630642bbcbeeedf3368fc90c533dcb88286570e348207fd12af8a8dab89f0ea56094ff06f097a11c7fc0b061760007c6adcdecf8a16c23483'
7
- data.tar.gz: f2678c628a1fde61096a8c68c61945796881ed190fcbab82af68ea73ed2e06c3cfcd849eec3806946ac0314f1791a63418ae7415e0c657843473a68bfc3c8276
6
+ metadata.gz: f2a77c95e14d5289aeff92bed9cf6d6fa34982c7a4d16585957880fbeee09069cff4df3e9797a5e15cf53b6c4f436cdbbba932719dd8bd2984dac57015fc4e75
7
+ data.tar.gz: fd30ddeacf2a1eef951ba7d4cf28f2996af7961ab707af4548e5872de0be5653501d7be356ad6aa1ea5cb43c10edaedd6abace18d2c2c99c24126bb0c7ccdb8f
data/exe/boilerplate CHANGED
@@ -8,6 +8,8 @@ $LOAD_PATH.unshift gem_dir # Look in gem directory for resources first.
8
8
  require 'jekyll_page_boilerplate'
9
9
  require "mercenary"
10
10
 
11
+
12
+
11
13
  Mercenary.program(:boilerplate) do |p|
12
14
  p.version JekyllPageBoilerplate::VERSION
13
15
  p.description 'jekyll-page-boilerplate is a gem for jekyll that helps you generate new pages'
@@ -7,13 +7,13 @@ module JekyllPageBoilerplate
7
7
 
8
8
  BOILERPLATES_PATH = '_boilerplates'
9
9
  FILE_DATE_FORMATE = '%Y-%m-%d'
10
- READ_CONFIG_REGEX = /^_boilerplate:(\s*^[\t ]{1,2}.+$)+/
11
- READ_FILE_REGEX = /^-{3}\s*$(?<head>[\s\S]*)^-{3}\s$(?<body>[\s\S]*)/
10
+ READ_CONFIG_REGEX = /[\r\n\s]{0,}^_boilerplate:(\s*^[\t ]{1,2}.+$)+[\r\s\n]{0,}(?![^\r\s\n])/
11
+ READ_FILE_REGEX = /^-{3}\s*^(?<head>[\s\S]*)^-{3}\s^(?<body>[\s\S]*)/
12
12
 
13
13
 
14
14
  def initialize boilerplate
15
15
 
16
- plate_path = get_boilerplate_path(boilerplate)
16
+ plate_path = get_boilerplate_path(boilerplate).to_s
17
17
 
18
18
  abort_unless_file_exists( plate_path )
19
19
 
@@ -45,7 +45,7 @@ module JekyllPageBoilerplate
45
45
 
46
46
  open(new_file_path, 'w') do |page|
47
47
  page.puts '---'
48
- page.puts @head
48
+ page.puts @head.lstrip
49
49
  page.puts '---'
50
50
  page.puts @body
51
51
  page.puts ''
@@ -67,7 +67,7 @@ module JekyllPageBoilerplate
67
67
  end
68
68
 
69
69
  def get_head head
70
- return head.gsub READ_CONFIG_REGEX, ''
70
+ return head.gsub( READ_CONFIG_REGEX, '')
71
71
  end
72
72
 
73
73
 
@@ -1,3 +1,3 @@
1
1
  module JekyllPageBoilerplate
2
- VERSION = "2.0.0"
2
+ VERSION = "2.1.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-page-boilerplate
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sean Ferney
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-05-25 00:00:00.000000000 Z
11
+ date: 2021-06-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mercenary