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 CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- ZmQ4ZGM1ZjI2ZWE1ZDA4YzQ1NGQyYTA5ODU5YWQ2ZGY0YTM1OTUxNg==
4
+ NTI1ZDdlYjFmNTkxYjllZmNkNGU0NGVjZjJlOGZhZTc4YTE4NmNkYw==
5
5
  data.tar.gz: !binary |-
6
- YmZiNmViMjQ5YjYyNjcyZGI3NDgxZjQ5MTIxMzg1MTk0ZGRhMmJlNw==
6
+ MGRkNGJhM2YyZmJiYThlM2I0ZjVhNmU3ZDYxZTA1NTUzMThlOTZjNw==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- NmNkMzVmYzg5MTFmNDdhY2FkZGRhZDU3NTM2MTgxZGQ1MGE4MmU3OThhMmRk
10
- M2RhOTc4YWI1OGYwZDg2OGUxNDIwMjJjNWFkYWNlZjUzZDQ0NmNkNjkxYThl
11
- OGEzOGRiMTc4NjViOTQ2ZDc2NjA4ODNjNDhjNTgwM2UwOTUzMTc=
9
+ M2M4ZmFkNDg0ZWI1NmY5NDBlOTA1NDU3NTI0OTVkOTY2Mjc1MjVjY2I2NDI5
10
+ ZDUzMzdmMjdiNjQ1ZWUyNDVjZGY4YzAxODJhZDJkYjQ5NTVmNzQwMTQxMmJm
11
+ NTQwMGE5MjYzMWFlNGRhYmM1NzE2ZDZlOThjOTQ3MGUzNTRjNmI=
12
12
  data.tar.gz: !binary |-
13
- YWRkNzM5NDUxMGNhM2EwNWJlNjFkYTJhZThiZjcyOTkwYzNiYzA4Mzk2ZmZj
14
- NzUyNmQyYThjMTUzY2IxNjQxMjlmNDY5MDBiZGEzNGVjMjVhYTA2OGY4NTQ4
15
- ZDRmMmUzN2E1ZGYzMjJmODY1YzMxMmZmMjAxYmNjNjNmOTY5NjU=
13
+ ODJmNzI2MjQ4N2U0ZjMxOGI0N2MzZmZkNDFkOTk2YTBlYzUwMjg2NDU5OTBi
14
+ YWViNzZmMmI2ZmIwZGI5M2Q4ODA2NDYwNDA4YmExMTM5OTExMjE3ZDU4M2Uy
15
+ NGJiYWI4MmQ5YzE5ZWQzMDQwYjExOGY0MjE3YmRmMjJkYWNkMjk=
data/README.md CHANGED
@@ -47,4 +47,4 @@ Reference:
47
47
 
48
48
  ## License
49
49
 
50
- Ruby license or MIT license, take your pick.
50
+ MIT license
@@ -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
- {action_view: @view, controller: _controller}
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
@@ -1,4 +1,4 @@
1
1
 
2
2
  module LiquidRenderer
3
- VERSION = '0.0.2'
3
+ VERSION = '0.0.3'
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: liquid_renderer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rodrigo Ra