lm_docstache 3.0.6 → 3.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +7 -0
- data/lib/lm_docstache/document.rb +10 -1
- data/lib/lm_docstache/version.rb +1 -1
- data/spec/example_input/ExampleTemplate.docx +0 -0
- data/spec/integration_spec.rb +2 -2
- 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: d27b230b05c9271e1d519b9b946b829da7041d32b1a99a9ae7c29c86326dedd6
|
4
|
+
data.tar.gz: 34798fa630422bfa320deb756c445142d67bf17dcd120b246d3b5ab7290246ba
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1950a09e8be9fc31324f7b94733de31c7eedb99f3867addca8ad9dcc4ce0ac9ad240bbccccf26bcc412b7138fc5e30dca14807452962d1768df3aa8b68ece95c
|
7
|
+
data.tar.gz: 33c5485fb1fc5e5e7fe135bff40a06ca2d24a61412cce787c2f54af089aa90976fd12ba5e4bda8db2a823e692d5c53ff43508fc8e3c825c21fa2e76d7447ac6e
|
data/CHANGELOG.md
CHANGED
@@ -56,7 +56,7 @@ module LMDocstache
|
|
56
56
|
usable_tags.reduce([]) do |memo, tag|
|
57
57
|
next memo if !tag.is_a?(Regexp) && tag =~ ROLES_REGEXP
|
58
58
|
|
59
|
-
tag = tag.source if tag.is_a?(Regexp)
|
59
|
+
tag = unescape_escaped_start_block(tag.source) if tag.is_a?(Regexp)
|
60
60
|
memo << (tag.scan(GENERAL_TAG_REGEX) && $1)
|
61
61
|
end.compact.uniq
|
62
62
|
end
|
@@ -114,6 +114,15 @@ module LMDocstache
|
|
114
114
|
|
115
115
|
private
|
116
116
|
|
117
|
+
def unescape_escaped_start_block(regex_source_string)
|
118
|
+
regex_source_string
|
119
|
+
.gsub('\\{', '{')
|
120
|
+
.gsub('\\#', '#')
|
121
|
+
.gsub('\\}', '}')
|
122
|
+
.gsub('\\^', '^')
|
123
|
+
.gsub('\\ ', ' ')
|
124
|
+
end
|
125
|
+
|
117
126
|
def text_nodes_containing_only_starting_conditionals
|
118
127
|
@documents.values.flat_map do |document|
|
119
128
|
document.css('w|t').select do |paragraph|
|
data/lib/lm_docstache/version.rb
CHANGED
Binary file
|
data/spec/integration_spec.rb
CHANGED
@@ -70,7 +70,7 @@ describe 'integration test', integration: true do
|
|
70
70
|
end
|
71
71
|
|
72
72
|
it 'has the expected amount of usable tags' do
|
73
|
-
expect(document.usable_tags.count).to eq(
|
73
|
+
expect(document.usable_tags.count).to eq(28)
|
74
74
|
end
|
75
75
|
|
76
76
|
it 'has the expected amount of usable roles tags' do
|
@@ -79,7 +79,7 @@ describe 'integration test', integration: true do
|
|
79
79
|
end
|
80
80
|
|
81
81
|
it 'has the expected amount of unique tag names' do
|
82
|
-
expect(document.usable_tag_names.count).to eq(
|
82
|
+
expect(document.usable_tag_names.count).to eq(20)
|
83
83
|
end
|
84
84
|
|
85
85
|
it 'renders file using data' do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lm_docstache
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.
|
4
|
+
version: 3.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Roey Chasman
|
@@ -12,7 +12,7 @@ authors:
|
|
12
12
|
autorequire:
|
13
13
|
bindir: bin
|
14
14
|
cert_chain: []
|
15
|
-
date: 2021-06-
|
15
|
+
date: 2021-06-14 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: nokogiri
|