relaton-render 0.5.6 → 0.5.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/relaton/render/template/template.rb +6 -2
- data/lib/relaton/render/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: f0f0cf15017a8c117f7a8fde7567564f61138760cfeb89b506e5c2848ff6899d
|
4
|
+
data.tar.gz: 2d5bdd64aeb924e67b2c4f823e60033a1a51018542deb4596f32533038919e00
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2f05f38566cf4f94bad2152db2cb2c71c0d2f2a63939c7bac0039fbaa0e21314aba6288640ec9a7c1248b6548342ba21ccff47e0b360902055ed1f026f52eabc
|
7
|
+
data.tar.gz: e787ce6357bfd515b9d7a975027f798ec027fa2845a6495ea53c0c2032abb8e90f7881736bf1f0c947cf30e0b82e5aeb259ba9f9f20877823828cc6c3d987277
|
@@ -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.7
|
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-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|