tzispa_rig 0.3.0 → 0.3.1
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/lib/tzispa/rig/engine.rb +12 -5
- data/lib/tzispa/rig/syntax.rb +1 -1
- data/lib/tzispa/rig/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1b1464a9fd319fa56702a54567f45ff6a0d00275
|
4
|
+
data.tar.gz: 969265c272c7eee232fcbfd4c5f224db95419362
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2a4391839a2537d75c974374b292c4b952285f8c64ca0312f149d59a5a5e90c177a5a1e0d93fbf382c0b698998cf073007d54f4b47736b510b8b5cc4bb6d61f7
|
7
|
+
data.tar.gz: c5c030ed0ee930be9ddeadc8ad1613d6011d574041fbac399553ed12c8a2cba61410f8a2ef0c1786bcbff0bfee70875a2efd37aba01dd18d6fa7d14704b9898d
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,9 @@ Tzispa Rig
|
|
2
2
|
|
3
3
|
Rig templates implementation
|
4
4
|
|
5
|
+
## 0.3.1
|
6
|
+
- Fix error in engine template cache that was losing template params when a template was recovered form cache
|
7
|
+
|
5
8
|
## 0.3.0
|
6
9
|
- Separate engine class into independant ruby file
|
7
10
|
- Move rig url builder tags into independant parser category
|
data/lib/tzispa/rig/engine.rb
CHANGED
@@ -31,9 +31,13 @@ module Tzispa
|
|
31
31
|
|
32
32
|
def rig_template(name, type, tpl_format, params, parent)
|
33
33
|
if @cache
|
34
|
-
@mutex.owned?
|
35
|
-
cache_template(name, type, tpl_format,
|
36
|
-
|
34
|
+
if @mutex.owned?
|
35
|
+
cache_template(name, type, tpl_format, parent, params)
|
36
|
+
else
|
37
|
+
@mutex.synchronize {
|
38
|
+
cache_template(name, type, tpl_format, parent, params)
|
39
|
+
}
|
40
|
+
end
|
37
41
|
else
|
38
42
|
Template.new(name: name, type: type, format: format, domain: @app.domain, params: params, parent: parent, engine: self).load!.parse!
|
39
43
|
end
|
@@ -41,16 +45,19 @@ module Tzispa
|
|
41
45
|
|
42
46
|
private
|
43
47
|
|
44
|
-
def cache_template(name, type, tpl_format,
|
48
|
+
def cache_template(name, type, tpl_format, parent, params)
|
45
49
|
ktpl = "#{type}__#{name}".to_sym
|
46
50
|
tpl = @cache.getset(ktpl) {
|
47
|
-
Template.new(name: name, type: type, format: tpl_format, domain: @app.domain,
|
51
|
+
Template.new(name: name, type: type, format: tpl_format, domain: @app.domain, parent: parent, engine: self).load!.parse!
|
48
52
|
}
|
49
53
|
if tpl.modified?
|
50
54
|
@cache[ktpl] = tpl.load!.parse!
|
51
55
|
else
|
52
56
|
tpl
|
53
57
|
end
|
58
|
+
tpl.dup.tap { |ctpl|
|
59
|
+
ctpl.params = params if params
|
60
|
+
}
|
54
61
|
end
|
55
62
|
|
56
63
|
end
|
data/lib/tzispa/rig/syntax.rb
CHANGED
@@ -15,7 +15,7 @@ module Tzispa
|
|
15
15
|
:purl => /<purl:(\w+(?:\.\w+)?)(\[(\w+=[^,\]]+(,\w+=[^,\]]+)*?)\])?\/>/,
|
16
16
|
:url => /<url:(\w+(?:\.\w+)?)(\[(\w+=[^,\]]+(,\w+=[^,\]]+)*?)\])?\/>/,
|
17
17
|
:api => /<api:([^:\.]+(?:\.[^:]+)?):([^:\/]+)(?::([^:\/]+))?(?::([^\/]+))?\/>/
|
18
|
-
}
|
18
|
+
}.freeze
|
19
19
|
|
20
20
|
RIG_STATEMENTS = /(<(loop):(\w+)>(.*?)<\/loop:\3>)|(<(ife):(\w+)>(.*?)(<else:\7\/>(.*?))?<\/ife:\7>)/m
|
21
21
|
|
data/lib/tzispa/rig/version.rb
CHANGED
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.3.
|
4
|
+
version: 0.3.1
|
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-05-
|
11
|
+
date: 2016-05-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: tzispa_helpers
|