view_component_reflex 3.3.12 → 3.3.14

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
  SHA256:
3
- metadata.gz: 0b70948aa0b5a3f2180be72f0649398dc22096189f38d26a7ffbf18d30944999
4
- data.tar.gz: d7f0080cfad13e801d30c79b3886d686d98ad025958c5454374c2541d28e5236
3
+ metadata.gz: 6a75a8301629627371f3bf6e3b29b8d71dfb390030aa2da3d07895e3c4b8cb6c
4
+ data.tar.gz: b893a78ec0167b1e67b4a028b816114cce099232b0fc20761675cdb885e611bf
5
5
  SHA512:
6
- metadata.gz: 85cf2658d9f2d73b2e9994497ff31a06009d91fb65bdd3327497d108026332bda876054e5485ef36f1075aa0ebe8d1f483f77cb05d7552f1bcb0b57faa9f3d0d
7
- data.tar.gz: ba74b77b06516184b60c4766bb0e9a352b34dc824fab66cb2be6d479bd94267c29573972dc0fb654e05132eb399a468ce05fb2743ed8441702d237386226c124
6
+ metadata.gz: 7b6e1bb7975e7e1a97aae420ac3b179adaf410d123aac06c070b94b98e9345d265d83a89848fb50f14d1f65e66a23b06981e95ac0adf8f35bab86fbfcebea390
7
+ data.tar.gz: 9a47ab602fa6ca508d56426fdaeeab407ed281bf240e2293694e616f165de151b48fb9634840acea6169eb9cb9b23a0a9d4f9d28841849acfa65c68cbd0e8aff
@@ -32,8 +32,12 @@ module ViewComponentReflex
32
32
  end
33
33
 
34
34
  def register_callbacks(key)
35
- callbacks(key).each do |cb|
36
- @stimulus_reflex.send("#{key}_reflex", *cb[:args], &cb[:blk])
35
+ ancestors.each do |klass|
36
+ next unless klass.respond_to?(:callbacks)
37
+ break if klass == ViewComponentReflex::Component
38
+ klass.callbacks(key).each do |cb|
39
+ @stimulus_reflex.send("#{key}_reflex", *cb[:args], &cb[:blk])
40
+ end
37
41
  end
38
42
  end
39
43
 
@@ -253,7 +257,7 @@ module ViewComponentReflex
253
257
  :@virtual_path, :@variant, :@current_template, :@output_buffer, :@key,
254
258
  :@helpers, :@controller, :@request, :@tag_builder, :@state_initialized,
255
259
  :@_content_evaluated, :@_render_in_block, :@__cached_content,
256
- :@original_view_context, :@compiler,
260
+ :@original_view_context, :@compiler,
257
261
  ]
258
262
  end
259
263
 
@@ -34,24 +34,12 @@ module ViewComponentReflex
34
34
  @reflex_instance ||= build_reflex_instance
35
35
  end
36
36
 
37
- def reflex_methods
38
- arr = []
39
- current_class = @component
40
- loop do
41
- arr += current_class.instance_methods
42
- current_class = current_class.superclass
43
- break if current_class == ViewComponentReflex::Component || current_class.nil?
44
- end
45
- arr -= ViewComponentReflex::Component.instance_methods
46
- arr -= [:call, :"_call_#{@component.name.underscore}"]
47
- arr
48
- end
49
-
50
37
  ##
51
38
  # Beyond just creating the <Component>Reflex class, we need to define all the component methods on the reflex
52
39
  # class.
53
40
  # This replaces the old method_missing implementation, and passes more strict validation of recent SR versions
54
41
  def build_reflex_instance
42
+ reflex_methods = @component.instance_methods - ViewComponentReflex::Component.instance_methods - [:call, :"_call_#{@component.name.underscore}"]
55
43
  component_allocate = @component.allocate
56
44
  Class.new(@component.reflex_base_class).tap do |klass|
57
45
  klass.instance_variable_set(:@__method_parameters, {})
@@ -1,3 +1,3 @@
1
1
  module ViewComponentReflex
2
- VERSION = '3.3.12'
2
+ VERSION = '3.3.14'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: view_component_reflex
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.3.12
4
+ version: 3.3.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joshua LeBlanc