liquidum 1.1.1 → 1.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/liquidum/version.rb +1 -1
- data/lib/liquidum.rb +25 -24
- data/liquidum.gemspec +3 -2
- metadata +20 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 07f82032cfc0adb076d2e0ed424c2eb19747e85322bfdebbb668d6995f7cdb2b
|
4
|
+
data.tar.gz: 3933ec803077049700a2f5ed63599968f6477dd679a29b0c2a9e89ca81373fd7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0ab256dde0cbce5bdf1615a72e519350066f506063caae818ed0e4b2d99028360c85da1b039a546ba284800a6c0fc56c6d828c31472d80b116f09760877906e2
|
7
|
+
data.tar.gz: 1b52586a9e4fa54c80b35dda4c4af75eef3a2b16a1761490d931fa9d18170934c0fedd454fb1c59fd84607fe4dc527ece70671a382c4055a0eb08248a0de3419
|
data/lib/liquidum/version.rb
CHANGED
data/lib/liquidum.rb
CHANGED
@@ -1,25 +1,26 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require
|
4
|
-
require
|
5
|
-
require
|
6
|
-
require
|
7
|
-
|
8
|
-
require
|
9
|
-
require
|
10
|
-
require
|
11
|
-
require
|
12
|
-
|
13
|
-
require
|
14
|
-
require
|
15
|
-
require
|
16
|
-
require
|
17
|
-
require
|
3
|
+
require "liquid"
|
4
|
+
require "tilt"
|
5
|
+
require "sassc"
|
6
|
+
require "addressable/uri"
|
7
|
+
|
8
|
+
require "liquidum/version"
|
9
|
+
require "liquidum/engine"
|
10
|
+
require "liquidum/configuration"
|
11
|
+
require "liquidum/drop"
|
12
|
+
|
13
|
+
require "liquidum/liquid/liquid_helpers"
|
14
|
+
require "liquidum/liquid/liquid_template_extensions"
|
15
|
+
require "liquidum/liquid/liquidum_block"
|
16
|
+
require "liquidum/liquid/liquidum_tag"
|
17
|
+
require "liquidum/liquid/parser"
|
18
18
|
|
19
19
|
module Liquidum
|
20
20
|
extend Configurable
|
21
21
|
|
22
22
|
class Error < StandardError; end
|
23
|
+
|
23
24
|
class UnknownStepTypeError < Error; end
|
24
25
|
|
25
26
|
class LiquidumFileSystem
|
@@ -30,12 +31,12 @@ module Liquidum
|
|
30
31
|
end
|
31
32
|
|
32
33
|
def read_template_file(template_path)
|
33
|
-
current_content = registers[
|
34
|
+
current_content = registers["content"]
|
34
35
|
|
35
36
|
contents = current_content.site.contents.published
|
36
37
|
|
37
38
|
content = contents.include(template_path).first
|
38
|
-
content&.data ||
|
39
|
+
content&.data || ""
|
39
40
|
end
|
40
41
|
end
|
41
42
|
|
@@ -44,20 +45,20 @@ module Liquidum
|
|
44
45
|
template = Liquid::Template.parse(content)
|
45
46
|
options[:assigns] ||= {}
|
46
47
|
options[:registers] ||= {}
|
47
|
-
options[:registers][
|
48
|
+
options[:registers]["file_system"] =
|
48
49
|
Liquidum.config.liquidum_file_system.constantize.new(options[:registers])
|
49
50
|
result = template.render(options[:context] || options[:assigns].stringify_keys,
|
50
|
-
|
51
|
+
registers: options[:registers])
|
51
52
|
|
52
53
|
if template.errors.present?
|
53
|
-
Liquidum.config.logger.error
|
54
|
+
Liquidum.config.logger.error "--- Template rendering errors: " + "-" * 49
|
54
55
|
template.errors.map do |error|
|
55
56
|
next unless error.cause
|
56
57
|
|
57
58
|
Liquidum.config.logger.error error
|
58
|
-
Liquidum.config.logger.error
|
59
|
+
Liquidum.config.logger.error "=> " + error.cause.backtrace.first.to_s + ": " + error.cause.message
|
59
60
|
end
|
60
|
-
Liquidum.config.logger.error
|
61
|
+
Liquidum.config.logger.error "-" * 80
|
61
62
|
end
|
62
63
|
|
63
64
|
assigns = options[:assigns].deep_stringify_keys
|
@@ -70,8 +71,8 @@ module Liquidum
|
|
70
71
|
end.render
|
71
72
|
end
|
72
73
|
if options[:layout].present?
|
73
|
-
result = render(options[:layout], assigns: assigns.merge(
|
74
|
-
|
74
|
+
result = render(options[:layout], assigns: assigns.merge("content" => result),
|
75
|
+
registers: options[:registers])
|
75
76
|
end
|
76
77
|
|
77
78
|
result
|
data/liquidum.gemspec
CHANGED
@@ -28,17 +28,18 @@ Gem::Specification.new do |spec|
|
|
28
28
|
spec.add_runtime_dependency("i18n", ["~> 1.8"])
|
29
29
|
spec.add_runtime_dependency("kramdown", ["~> 2.1"])
|
30
30
|
spec.add_runtime_dependency("kramdown-parser-gfm", ["~> 1.0"])
|
31
|
-
spec.add_runtime_dependency("liquid", ["
|
31
|
+
spec.add_runtime_dependency("liquid", ["< 5.4"])
|
32
32
|
spec.add_runtime_dependency("parslet", [">= 0"])
|
33
33
|
spec.add_runtime_dependency("pg", [">= 0"])
|
34
34
|
spec.add_runtime_dependency("rails", [">= 5.2"])
|
35
35
|
spec.add_runtime_dependency("sassc", ["~> 2.2"])
|
36
36
|
spec.add_runtime_dependency "slim-rails", "~> 3.6"
|
37
|
+
|
37
38
|
spec.add_development_dependency("minitest", ["~> 5.11"])
|
38
39
|
spec.add_development_dependency("minitest-reporters", ["~> 1.1"])
|
39
40
|
spec.add_development_dependency("pry", ["> 0"])
|
40
41
|
spec.add_development_dependency("pry-rails", ["~> 0.3"])
|
41
42
|
spec.add_development_dependency "rubocop", "~> 1"
|
42
|
-
|
43
43
|
spec.add_development_dependency "standard", "~> 1"
|
44
|
+
spec.add_development_dependency "debug", "~> 1"
|
44
45
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: liquidum
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tom de Grunt
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-04-
|
11
|
+
date: 2024-04-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: addressable
|
@@ -84,16 +84,16 @@ dependencies:
|
|
84
84
|
name: liquid
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
|
-
- - "
|
87
|
+
- - "<"
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version: '5.
|
89
|
+
version: '5.4'
|
90
90
|
type: :runtime
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
|
-
- - "
|
94
|
+
- - "<"
|
95
95
|
- !ruby/object:Gem::Version
|
96
|
-
version: '5.
|
96
|
+
version: '5.4'
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
98
|
name: parslet
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
@@ -248,6 +248,20 @@ dependencies:
|
|
248
248
|
- - "~>"
|
249
249
|
- !ruby/object:Gem::Version
|
250
250
|
version: '1'
|
251
|
+
- !ruby/object:Gem::Dependency
|
252
|
+
name: debug
|
253
|
+
requirement: !ruby/object:Gem::Requirement
|
254
|
+
requirements:
|
255
|
+
- - "~>"
|
256
|
+
- !ruby/object:Gem::Version
|
257
|
+
version: '1'
|
258
|
+
type: :development
|
259
|
+
prerelease: false
|
260
|
+
version_requirements: !ruby/object:Gem::Requirement
|
261
|
+
requirements:
|
262
|
+
- - "~>"
|
263
|
+
- !ruby/object:Gem::Version
|
264
|
+
version: '1'
|
251
265
|
description: Ready made set of tags, parsings and awesomeness
|
252
266
|
email:
|
253
267
|
- tom@degrunt.nl
|