theo-rails 0.5.3 → 0.5.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/theo-rails/theo.rb +6 -6
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8e0ab52b01e897648f607bf041e5359c2806e2b3e5c99ffd235bedd6b8b72409
4
- data.tar.gz: 634201a3d407430d17ae551a1e424d997468a1cdf9653d74197d7be55453a73e
3
+ metadata.gz: 7c6c1ca71ea02d809ef6d878e5602192374becebddf6df67083d15f50b401869
4
+ data.tar.gz: 544f1376468358f72424cb4cb65ca110c924a9ed545ff5372ae6769d0b97874b
5
5
  SHA512:
6
- metadata.gz: 7083141582de9a0c31441f847b5d2058f2bff0622caa14972b65377c8767811525ddbde2b172f4dafeec784633a09913aee9b2bf85cad07d0362dcb42bb442e0
7
- data.tar.gz: 6416d6961d28ae4ae105fad90ca2a3fb1478c19036ecbcd7179bd9ef3b802ef4a0a496a0fa841e185ce978dd39b28e050fb0b2a3b4aeb851f045a7502f340747
6
+ metadata.gz: 67dc84cc9e29f8f024957c0dedb9c4c1412aa7284c05befcce3945d28a92288e1ed4a7f9e477b9e47a539fd0bcd74b96ceb2fc8425562fbf70a84810c4b09c74
7
+ data.tar.gz: c8e7b4efecb66d54e8ccbbb328894c3ddab93950bd1a3087f0b54aa4c6d839d94190952fdeebda7b3b31b24ee8d91eab1b558ca2d5efc6bcbb7e3978de1daa9b
@@ -16,9 +16,9 @@ module Theo
16
16
  ATTRIBUTES = /(?<attrs>(?:\s+#{ATTRIBUTE.source})*)/
17
17
  ATTRIBUTES_INCLUDING_DYNAMIC = /(?<attrs>(?:\s+(?:#{ATTRIBUTE.source}|#{DYNAMIC_ATTRIBUTE.source}))*)/
18
18
  TAG_WITH_DYNAMIC_ATTRIBUTE = /(?:<(?<tagname>\w+)#{ATTRIBUTES_INCLUDING_DYNAMIC.source}\s+#{DYNAMIC_ATTRIBUTE.source}#{ATTRIBUTES_INCLUDING_DYNAMIC.source}\s*\/?>)/m
19
- SPECIAL_ATTRIBUTES = %i[%path %as %yields %collection %if].freeze
19
+ SPECIAL_ATTRIBUTES = %i[t-path t-as t-yields t-collection t-if %path %as %yields %collection %if].freeze
20
20
  VOID_TAGS = %i[area base br col embed hr img input link meta source track wbr]
21
- IF_SPECIAL_ATTRIBUTE = /(?<special>\s%if\s*=\s*#{attribute_value('specvalue')})/
21
+ IF_SPECIAL_ATTRIBUTE = /(?<special>\s(?:t-if|%if)\s*=\s*#{attribute_value('specvalue')})/
22
22
  TAG_WITH_IF_SPECIAL_ATTRIBUTE = /(?:<(?<tag>\w+)#{ATTRIBUTES_INCLUDING_DYNAMIC.source}\s*#{IF_SPECIAL_ATTRIBUTE.source}#{ATTRIBUTES_INCLUDING_DYNAMIC.source}\s*>.*?<\/\k<tag>>)|(?:<(?<tag>\w+)#{ATTRIBUTES_INCLUDING_DYNAMIC.source}\s*#{IF_SPECIAL_ATTRIBUTE.source}#{ATTRIBUTES_INCLUDING_DYNAMIC.source}\s*\/>)|(?:<(?<tag>#{VOID_TAGS.join('|')})#{ATTRIBUTES_INCLUDING_DYNAMIC.source}\s*#{IF_SPECIAL_ATTRIBUTE.source}#{ATTRIBUTES_INCLUDING_DYNAMIC.source}\s*>)/m
23
23
  PARTIAL_TAG = /(?:(?<partial>[A-Z]\w+)|(?<partial>_[\w-]+))/
24
24
  PARTIAL = /(?:<#{PARTIAL_TAG.source}#{ATTRIBUTES.source}\s*>(?<content>.*?)<\/\k<partial>>)|(?:<#{PARTIAL_TAG.source}#{ATTRIBUTES.source}\s*\/>)/m
@@ -88,12 +88,12 @@ module Theo
88
88
 
89
89
  attributes = process_attributes(attributes)
90
90
 
91
- path = attributes.delete(:'%path')
91
+ path = attributes.delete(:'t-path') || attributes.delete(:'%path')
92
92
 
93
- collection = attributes.delete(:'%collection')
94
- as = attributes.delete(:'%as')
93
+ collection = attributes.delete(:'t-collection') || attributes.delete(:'%collection')
94
+ as = attributes.delete(:'t-as') || attributes.delete(:'%as')
95
95
 
96
- yields = attributes.delete(:'%yields')
96
+ yields = attributes.delete(:'t-yields') || attributes.delete(:'%yields')
97
97
  yields = " |#{yields}|" if yields
98
98
 
99
99
  locals = attributes.empty? ? '' : attributes.map { |k, v| "'#{k}': #{v}" }.join(', ')
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: theo-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.3
4
+ version: 0.5.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jarek Lipski