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 +4 -4
- data/exe/boilerplate +2 -0
- data/lib/jekyll_page_boilerplate/page.rb +5 -5
- data/lib/jekyll_page_boilerplate/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cda02e5e566768a18e995b7b409ec9d7563553a2ae576b790e2604bc3200d8d8
|
4
|
+
data.tar.gz: 03cad8782fa41bdf0bc26b52739ac0150868c5ae8a5f18aada88004a25d26689
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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 =
|
11
|
-
READ_FILE_REGEX = /^-{3}\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
|
|
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.
|
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-
|
11
|
+
date: 2021-06-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mercenary
|