relaton-render 0.5.6 → 0.5.8
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 57ebdb614711c3fdca1166a3017396ce04245c92cfb793940efdc9da6d3d4c6d
|
4
|
+
data.tar.gz: e548c4fb11f390c585eaa95c4d7ccc77111d9166ecdf4fad795fa2c4181990e0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f8e53bff23c39d72ecb3d9167f92c9d6570d09148fdb5907fccbc018e974302e591101fe2e491014a6a4fbafff00960ae84de3a477ad6568416c02ab2274d15d
|
7
|
+
data.tar.gz: 6c699eaec0669e07ebb7ac9e1e43a2c31e7b303158d900117abe580fee599a8fde92409c861eca3e4c8b85c750bbab1141087d753dc9ac02be6fa7704871f58a
|
@@ -49,6 +49,11 @@ module Relaton
|
|
49
49
|
end
|
50
50
|
|
51
51
|
def template_process(template)
|
52
|
+
template.is_a?(String) or return template
|
53
|
+
::Liquid::Template.parse(add_field_delim_to_template(template))
|
54
|
+
end
|
55
|
+
|
56
|
+
def add_field_delim_to_template(template)
|
52
57
|
t = template.split(/(\{\{|\}\})/).each_slice(4).map do |a|
|
53
58
|
unless !a[2] || punct_field?(a[2]&.strip)
|
54
59
|
a[1] = "#{FIELD_DELIM}{{"
|
@@ -56,9 +61,8 @@ module Relaton
|
|
56
61
|
end
|
57
62
|
a.join
|
58
63
|
end.join.gsub(/\t/, " ")
|
59
|
-
|
64
|
+
t.gsub(/\}\}#{FIELD_DELIM}\|/o, "}}#{FIELD_DELIM}\t")
|
60
65
|
.gsub(/\|#{FIELD_DELIM}\{\{/o, "\t#{FIELD_DELIM}{{")
|
61
|
-
::Liquid::Template.parse(t1)
|
62
66
|
end
|
63
67
|
|
64
68
|
def render(hash)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: relaton-render
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-12-
|
11
|
+
date: 2022-12-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|