quintype-liquid 0.1.8 → 0.1.9
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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ca07f164bf7d0109e6d9ddac83f962dfa5d207c3
|
4
|
+
data.tar.gz: 49396e0eef776757446101ab8b5814ffad3e4af3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 56fb3890bde285795182526bc182b59cdf7bd4b62ed097335b5678ff05a3cb58f67d4d3f84a9f781856f9a25e4f17c6bd372e30062c66f260049c9502f96a815
|
7
|
+
data.tar.gz: 92d421cd0b4884cc0f333749622d13a57213001720675ffeb9a6b848bd3cd0d6fdd70cf7861fda9d294844115019deb68ff6e6ba19df2f9213f9d8adc270c7a8
|
@@ -1,8 +1,14 @@
|
|
1
1
|
module Quintype::Liquid
|
2
2
|
module LiquidTemplateCachingModule
|
3
|
-
|
4
|
-
|
5
|
-
|
3
|
+
|
4
|
+
QUINTPYE_LIQUID_KEY = :quintype_liquid_template_cache
|
5
|
+
|
6
|
+
def compiled_template(template)
|
7
|
+
Thread.current[QUINTPYE_LIQUID_KEY] ||= Hash.new do |m, template|
|
8
|
+
Rails.logger.info "Compiling Template"
|
9
|
+
m[template] = ::Liquid::Template.parse(template)
|
10
|
+
end
|
11
|
+
Thread.current[QUINTPYE_LIQUID_KEY][template]
|
6
12
|
end
|
7
13
|
|
8
14
|
def render(template, local_assigns = {})
|
@@ -16,7 +22,7 @@ module Quintype::Liquid
|
|
16
22
|
assigns['content_for_layout'] = @view.content_for(:layout) if @view.content_for?(:layout)
|
17
23
|
assigns.merge!(local_assigns.stringify_keys)
|
18
24
|
|
19
|
-
liquid =
|
25
|
+
liquid = compiled_template(template)
|
20
26
|
liquid.send(:render!, assigns, filters: filters, registers: { view: @view, controller: @controller, helper: @helper }).html_safe
|
21
27
|
end
|
22
28
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: quintype-liquid
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tejas Dinkar
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-07-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: liquid-rails
|
@@ -107,7 +107,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
107
107
|
version: '0'
|
108
108
|
requirements: []
|
109
109
|
rubyforge_project:
|
110
|
-
rubygems_version: 2.
|
110
|
+
rubygems_version: 2.5.1
|
111
111
|
signing_key:
|
112
112
|
specification_version: 4
|
113
113
|
summary: Isomorphically Render Liquid in Rails and JS
|