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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 32932b369254e26404e4c1aabbddaef0ce65ed73a06e340f4cbef0c9fc495f5d
4
- data.tar.gz: 6979b799f3c67d3a0d8b2eeaa247b843a62a6cd92945d49ec3a489e9853fa8df
3
+ metadata.gz: d27b230b05c9271e1d519b9b946b829da7041d32b1a99a9ae7c29c86326dedd6
4
+ data.tar.gz: 34798fa630422bfa320deb756c445142d67bf17dcd120b246d3b5ab7290246ba
5
5
  SHA512:
6
- metadata.gz: 90f0aa2257a42051c415dbb930bcd1a9fd2931a2fb07a2842ef6486230dd20bc9f4aac8c507bc8eb21a0c45e6fcdbc9d28d1f5d75dc01596629103c7e5aa6f2e
7
- data.tar.gz: 9192ff9c6940c40f52256a259a445d83439f18f7bb8b24b05d32f722a893f1e2493dc1f5b9f0a287f390810ce2cdbcf2ec0eb3b3d22366fceea92330a9f26d64
6
+ metadata.gz: 1950a09e8be9fc31324f7b94733de31c7eedb99f3867addca8ad9dcc4ce0ac9ad240bbccccf26bcc412b7138fc5e30dca14807452962d1768df3aa8b68ece95c
7
+ data.tar.gz: 33c5485fb1fc5e5e7fe135bff40a06ca2d24a61412cce787c2f54af089aa90976fd12ba5e4bda8db2a823e692d5c53ff43508fc8e3c825c21fa2e76d7447ac6e
data/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## 3.0.7
4
+
5
+ #### Bug fixes
6
+
7
+ * Fix a bug on `usable_tag_names` method, so it now properly and expectedly
8
+ includes conditional tag names as well, as before.
9
+
3
10
  ## 3.0.6
4
11
 
5
12
  #### Bug fixes
@@ -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|
@@ -1,3 +1,3 @@
1
1
  module LMDocstache
2
- VERSION = "3.0.6"
2
+ VERSION = "3.0.7"
3
3
  end
@@ -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(21)
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(14)
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.6
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-10 00:00:00.000000000 Z
15
+ date: 2021-06-14 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: nokogiri