gryphon 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 6677aa017915ce15f99611f557914898ff049a6dbe5f1270ed6b7275176dcc7d
|
|
4
|
+
data.tar.gz: 867d225f62915e3da24f3e802650da288d325380cf3a32102bc9ee449ff4f0cc
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 524b871958bf1ac83366aee8ff6e354256153b837a2eeb02fbe443da8c51a85149962f517b088c7149928748f58a9dbbb18119b8059f5a64d885bde068ec866c
|
|
7
|
+
data.tar.gz: cb62f13ddf2df3f278b4b7c199900e88ab1c33892eb1672b4cb0c1189b4a68188b07b75bfe96189df3aa77c3b06bb3f1a2f9bb34b3f4b43c5adda52607bb6fd3
|
|
@@ -53,11 +53,13 @@ module Gryphon
|
|
|
53
53
|
# @return [String]
|
|
54
54
|
# @raise [Errors::ParseError]
|
|
55
55
|
def build_output(file)
|
|
56
|
+
docs = parse_file(file)
|
|
56
57
|
content =
|
|
57
58
|
if @layout_file.exist?
|
|
58
|
-
|
|
59
|
+
docs[0][:yield] = docs[1]
|
|
60
|
+
@renderer.render(@layout_file.content, docs[0])
|
|
59
61
|
else
|
|
60
|
-
@renderer.
|
|
62
|
+
@renderer.render(docs[1], docs[0])
|
|
61
63
|
end
|
|
62
64
|
|
|
63
65
|
HtmlBeautifier.beautify(content, stop_on_errors: true)
|
|
@@ -73,6 +75,17 @@ module Gryphon
|
|
|
73
75
|
path.dirname.mkpath
|
|
74
76
|
path.write(content)
|
|
75
77
|
end
|
|
78
|
+
|
|
79
|
+
# @param file [Pathname]
|
|
80
|
+
# @return [Array]
|
|
81
|
+
# @raise [Psych::SyntaxError]
|
|
82
|
+
def parse_file(file)
|
|
83
|
+
docs = YAML.safe_load_stream(File.read(file), filename: file)
|
|
84
|
+
|
|
85
|
+
docs = [{}, docs[0]] unless docs[1]
|
|
86
|
+
|
|
87
|
+
docs
|
|
88
|
+
end
|
|
76
89
|
end
|
|
77
90
|
end
|
|
78
91
|
end
|
|
@@ -9,16 +9,8 @@ module Gryphon
|
|
|
9
9
|
class MustacheRenderer < Mustache
|
|
10
10
|
# @param _name [String]
|
|
11
11
|
# @return [String]
|
|
12
|
-
# @raise [Psych::SyntaxError]
|
|
13
12
|
def partial(_name)
|
|
14
|
-
|
|
15
|
-
path = "#{template_path}/#{name}.#{template_extension}"
|
|
16
|
-
docs = YAML.safe_load_stream(File.read(path), filename: name)
|
|
17
|
-
content = docs[1] || docs[0]
|
|
18
|
-
|
|
19
|
-
context.push(docs[0]) unless docs[1].nil?
|
|
20
|
-
|
|
21
|
-
content
|
|
13
|
+
context[:yield]
|
|
22
14
|
end
|
|
23
15
|
end
|
|
24
16
|
end
|
data/lib/gryphon/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: gryphon
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.0.
|
|
4
|
+
version: 1.0.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Christopher Birmingham
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-
|
|
11
|
+
date: 2026-04-06 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: htmlbeautifier
|