tzispa_rig 0.2.9 → 0.3.0

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
  SHA1:
3
- metadata.gz: 6afaf56cd198b00340644368828a0727b3da7bb8
4
- data.tar.gz: ebb745a0b564a73834c87b51d992c1db2726e818
3
+ metadata.gz: 708d90bb94a81f1397c06164861b26975526e3ef
4
+ data.tar.gz: 57f5d6f6f9d76deac46e8290450d317f695c7746
5
5
  SHA512:
6
- metadata.gz: 6c702cc00b5efcc7850ee465003c147b87790c13b30b0ed84f1d53254cf97a16544e3bdb3dd41de9b8545faa15c7fb40e92244690fcd3c4dd9c3778e205b0549
7
- data.tar.gz: c4b39a521c21fc2ba7e6fba446d079ed207555d76e407f16523c6a831cf1c6f95f07867ff6f0262890c64ee41b18aaaf64032f6ba8b6786085ee9d6ee667ea34
6
+ metadata.gz: c141e157fb0cd26f877c63c9ad08558456e4186dabac95fa97beb947ed7cecbf7933c0645f2f13805265d15b8b236ec5b2e386b8ede161cb9afff78d96d6d542
7
+ data.tar.gz: cc85b3bb9a08de8cc34397ce0bf138ed9e9e9339c9ec1676ecfc9a9a7e55b12876ecdb735bea5c97e8e677fd1d22fb9586fe840f9c59668455d3ea84efd5d3cc
data/CHANGELOG.md CHANGED
@@ -2,6 +2,11 @@ Tzispa Rig
2
2
 
3
3
  Rig templates implementation
4
4
 
5
+ ## 0.3.0
6
+ - Separate engine class into independant ruby file
7
+ - Move rig url builder tags into independant parser category
8
+ - Now static blocks can parse url builder tags: url, purl & api
9
+
5
10
  ## v0.2.9
6
11
  - Fix bugs in template cache engine causing modified template files are not reloading
7
12
  - Replaces Tzispa::Utils::Cache with lru_redex gem
@@ -31,13 +31,9 @@ module Tzispa
31
31
 
32
32
  def rig_template(name, type, tpl_format, params, parent)
33
33
  if @cache
34
- if @mutex.owned?
35
- cache_template(name, type, tpl_format, params, parent)
36
- else
37
- @mutex.synchronize {
38
- cache_template(name, type, tpl_format, params, parent)
39
- }
40
- end
34
+ @mutex.owned? ?
35
+ cache_template(name, type, tpl_format, params, parent) :
36
+ @mutex.synchronize { cache_template(name, type, tpl_format, params, parent) }
41
37
  else
42
38
  Template.new(name: name, type: type, format: format, domain: @app.domain, params: params, parent: parent, engine: self).load!.parse!
43
39
  end
@@ -356,6 +356,7 @@ module Tzispa
356
356
  parse_statements
357
357
  parse_expressions
358
358
  end
359
+ parse_url_builder
359
360
  parse_templates
360
361
  self
361
362
  end
@@ -391,6 +392,16 @@ module Tzispa
391
392
  }
392
393
  end
393
394
 
395
+ def parse_url_builder
396
+ RIG_URL_BUILDER.each_key { |kre|
397
+ @inner_text.gsub!(RIG_URL_BUILDER[kre]) { |match|
398
+ pe = ParsedEntity.instance(self, kre, Regexp.last_match )
399
+ @the_parsed << pe
400
+ pe.anchor
401
+ }
402
+ }
403
+ end
404
+
394
405
  def parse_expressions
395
406
  RIG_EXPRESSIONS.each_key { |kre|
396
407
  @inner_text.gsub!(RIG_EXPRESSIONS[kre]) { |match|
@@ -8,11 +8,14 @@ module Tzispa
8
8
 
9
9
  RIG_EXPRESSIONS = {
10
10
  :meta => /\{%([^%]+?)%\}/,
11
- :var => /<var(\[%[A-Z]?[0-9]*[a-z]\])?:(\w+)\/>/,
11
+ :var => /<var(\[%[A-Z]?[0-9]*[a-z]\])?:(\w+)\/>/
12
+ }.freeze
13
+
14
+ RIG_URL_BUILDER = {
12
15
  :purl => /<purl:(\w+(?:\.\w+)?)(\[(\w+=[^,\]]+(,\w+=[^,\]]+)*?)\])?\/>/,
13
16
  :url => /<url:(\w+(?:\.\w+)?)(\[(\w+=[^,\]]+(,\w+=[^,\]]+)*?)\])?\/>/,
14
17
  :api => /<api:([^:\.]+(?:\.[^:]+)?):([^:\/]+)(?::([^:\/]+))?(?::([^\/]+))?\/>/
15
- }.freeze
18
+ }
16
19
 
17
20
  RIG_STATEMENTS = /(<(loop):(\w+)>(.*?)<\/loop:\3>)|(<(ife):(\w+)>(.*?)(<else:\7\/>(.*?))?<\/ife:\7>)/m
18
21
 
@@ -3,7 +3,7 @@
3
3
  module Tzispa
4
4
  module Rig
5
5
 
6
- VERSION = '0.2.9'
6
+ VERSION = '0.3.0'
7
7
  GEM_NAME = 'tzispa_rig'
8
8
 
9
9
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tzispa_rig
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.9
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Juan Antonio Piñero
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-04-21 00:00:00.000000000 Z
11
+ date: 2016-05-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: tzispa_helpers
@@ -91,7 +91,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
91
91
  version: '0'
92
92
  requirements: []
93
93
  rubyforge_project:
94
- rubygems_version: 2.4.8
94
+ rubygems_version: 2.5.1
95
95
  signing_key:
96
96
  specification_version: 4
97
97
  summary: General purpose template engine