liquid_renderer 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/README.md +1 -1
- data/lib/liquid_renderer/controller.rb +10 -0
- data/lib/liquid_renderer/renderer.rb +7 -1
- data/lib/liquid_renderer/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
NTI1ZDdlYjFmNTkxYjllZmNkNGU0NGVjZjJlOGZhZTc4YTE4NmNkYw==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
MGRkNGJhM2YyZmJiYThlM2I0ZjVhNmU3ZDYxZTA1NTUzMThlOTZjNw==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
M2M4ZmFkNDg0ZWI1NmY5NDBlOTA1NDU3NTI0OTVkOTY2Mjc1MjVjY2I2NDI5
|
10
|
+
ZDUzMzdmMjdiNjQ1ZWUyNDVjZGY4YzAxODJhZDJkYjQ5NTVmNzQwMTQxMmJm
|
11
|
+
NTQwMGE5MjYzMWFlNGRhYmM1NzE2ZDZlOThjOTQ3MGUzNTRjNmI=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
ODJmNzI2MjQ4N2U0ZjMxOGI0N2MzZmZkNDFkOTk2YTBlYzUwMjg2NDU5OTBi
|
14
|
+
YWViNzZmMmI2ZmIwZGI5M2Q4ODA2NDYwNDA4YmExMTM5OTExMjE3ZDU4M2Uy
|
15
|
+
NGJiYWI4MmQ5YzE5ZWQzMDQwYjExOGY0MjE3YmRmMjJkYWNkMjk=
|
data/README.md
CHANGED
@@ -5,7 +5,9 @@ module LiquidRenderer
|
|
5
5
|
|
6
6
|
included do
|
7
7
|
class_attribute :_liquid_filters
|
8
|
+
class_attribute :_liquid_registers
|
8
9
|
self._liquid_filters = Module.new
|
10
|
+
self._liquid_registers = []
|
9
11
|
|
10
12
|
default_liquid_module! unless anonymous?
|
11
13
|
end
|
@@ -22,6 +24,14 @@ module LiquidRenderer
|
|
22
24
|
_liquid_filters
|
23
25
|
end
|
24
26
|
|
27
|
+
def liquid_register(extra_register_method)
|
28
|
+
_liquid_registers << extra_register_method
|
29
|
+
end
|
30
|
+
|
31
|
+
def liquid_registers
|
32
|
+
_liquid_registers
|
33
|
+
end
|
34
|
+
|
25
35
|
private
|
26
36
|
|
27
37
|
# Returns a list of modules, normalized from the acceptable kinds of
|
@@ -47,7 +47,13 @@ module LiquidRenderer
|
|
47
47
|
end
|
48
48
|
|
49
49
|
def _registers
|
50
|
-
|
50
|
+
extra_registers = {}
|
51
|
+
if _controller.class.respond_to? :liquid_registers
|
52
|
+
_controller.class.liquid_registers.each do |method|
|
53
|
+
extra_registers.merge! _controller.send(method)
|
54
|
+
end
|
55
|
+
end
|
56
|
+
{action_view: @view, controller: _controller}.merge extra_registers
|
51
57
|
end
|
52
58
|
end
|
53
59
|
end
|