stimulus_reflex 0.1.8 → 0.1.9

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of stimulus_reflex might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 68fca60aa52761d6836aa1539af1dc603500410bcae78f66e9b5a9463437438f
4
- data.tar.gz: e391e34b31482253857523cbf01fdd898f5b5b26308a643f11669bb9d5f63a2f
3
+ metadata.gz: 373ba528084e4de3fef658453750975d991a9eee06aded4bcc6815f3ad388714
4
+ data.tar.gz: 9aefb07d8817e40fb7b06496327eafc54fa5d06c206a05aac65c3119b54c1216
5
5
  SHA512:
6
- metadata.gz: 3489bcb333fc6a451d46b673be667e0f8a323ea6ebfc4e48fa21785191cec684a440a3b2cc18de97b58a68aebc5282c4038be3ee0734eae7796e9657e2482a0c
7
- data.tar.gz: bf6809af16e5d362a386c26edc216d5196674abc80bf4d6e550dbb360342dcd76996a2d9c40acdc08c00a4a0eb92f075f8543f1f3fe2f5eb586bb9e15ad94cf2
6
+ metadata.gz: 5aad4744401bbeee19eb95a4a65b2394788e1eb2e4d417c407abf2e69b62ba4c01c27165a4d63c81276fc284a41383d5bfca8372b85500a7caa6c8b4f14e16c5
7
+ data.tar.gz: 4dda36f27627d1010981432b3a465761de082fb1e57e9c0ae4ad9f6acdb95fa794d894778e5412908e6a11e7b35f019528061f00e4546bb9b9b9a3d690633d55
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- stimulus_reflex (0.1.8)
4
+ stimulus_reflex (0.1.9)
5
5
  actioncable (>= 5.2.1)
6
6
  actionpack (>= 5.2.1)
7
7
  cable_ready (>= 2.0.5)
@@ -74,4 +74,4 @@ DEPENDENCIES
74
74
  stimulus_reflex!
75
75
 
76
76
  BUNDLED WITH
77
- 1.16.4
77
+ 1.16.6
data/README.md CHANGED
@@ -34,7 +34,7 @@ export default class extends Controller {
34
34
  }
35
35
 
36
36
  doStuff() {
37
- send('Example#do_stuff', arg1, arg2, ...);
37
+ this.send('Example#do_stuff', arg1, arg2, ...);
38
38
  }
39
39
  }
40
40
  ```
@@ -31,7 +31,7 @@ class StimulusReflex::Channel < ActionCable::Channel::Base
31
31
  begin
32
32
  stimulus_controller = stimulus_controller_name.constantize.new(self)
33
33
  delegate_call_to_stimulus_controller stimulus_controller, method_name, arguments
34
- render_page_and_broadcast_morph url
34
+ render_page_and_broadcast_morph url, stimulus_controller
35
35
  rescue StandardError => invoke_error
36
36
  logger.error "StimulusReflex::Channel Failed to invoke #{target}! #{url} #{invoke_error}"
37
37
  end
@@ -51,12 +51,12 @@ class StimulusReflex::Channel < ActionCable::Channel::Base
51
51
  end
52
52
  end
53
53
 
54
- def render_page_and_broadcast_morph(url)
55
- html = render_page(url)
54
+ def render_page_and_broadcast_morph(url, stimulus_controller)
55
+ html = render_page(url, stimulus_controller)
56
56
  broadcast_morph url, html if html.present?
57
57
  end
58
58
 
59
- def render_page(url)
59
+ def render_page(url, stimulus_controller)
60
60
  html = nil
61
61
  ActiveSupport::Notifications.instrument "render_page.stimulus_reflex", url: url do
62
62
  uri = URI.parse(url)
@@ -64,6 +64,9 @@ class StimulusReflex::Channel < ActionCable::Channel::Base
64
64
  controller_class = "#{url_params[:controller]}_controller".classify.constantize
65
65
  controller = controller_class.new
66
66
  controller.instance_variable_set :"@stimulus_reflex", true
67
+ stimulus_controller.instance_variables.each do |name|
68
+ controller.instance_variable_set name, stimulus_controller.instance_variable_get(name)
69
+ end
67
70
 
68
71
  env = {
69
72
  Rack::REQUEST_PATH => uri.path,
@@ -1,3 +1,3 @@
1
1
  module StimulusReflex
2
- VERSION = "0.1.8"
2
+ VERSION = "0.1.9"
3
3
  end
@@ -1 +1 @@
1
- window.StimulusReflex=function(e){var t={};function r(n){if(t[n])return t[n].exports;var u=t[n]={i:n,l:!1,exports:{}};return e[n].call(u.exports,u,u.exports,r),u.l=!0,u.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var u in e)r.d(n,u,function(t){return e[t]}.bind(null,u));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=0)}([function(e,t,r){"use strict";var n;r.r(t),r.d(t,"register",function(){return o});window.App=window.App||{},App.cable=App.cable||ActionCable.createConsumer(),App.stimulusReflex=App.stimulusReflex||App.cable.subscriptions.create("StimulusReflex::Channel",{received:function(e){e.cableReady&&(clearTimeout(n),n=setTimeout(function(){CableReady.perform(e.operations),document.dispatchEvent(new Event("turbolinks:load"))},StimulusReflex.renderDelay||400))}});var u={send:function(){clearTimeout(n);var e=Array.prototype.slice.call(arguments),t=e.shift();App.stimulusReflex.send({url:location.href,target:t,args:e})}},o=function(e){return Object.assign(e,u),e}}]);
1
+ window.StimulusReflex=function(e){var t={};function r(n){if(t[n])return t[n].exports;var u=t[n]={i:n,l:!1,exports:{}};return e[n].call(u.exports,u,u.exports,r),u.l=!0,u.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var u in e)r.d(n,u,function(t){return e[t]}.bind(null,u));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=0)}([function(e,t,r){"use strict";var n;r.r(t),r.d(t,"register",function(){return o});window.App=window.App||{},App.cable=App.cable||ActionCable.createConsumer(),App.stimulusReflex=App.stimulusReflex||App.cable.subscriptions.create("StimulusReflex::Channel",{received:function(e){e.cableReady&&(clearTimeout(n),n=setTimeout(function(){CableReady.perform(e.operations),document.dispatchEvent(new Event("stimulus_reflex:morph"))},StimulusReflex.renderDelay||400))}});var u={send:function(){clearTimeout(n);var e=Array.prototype.slice.call(arguments),t=e.shift();App.stimulusReflex.send({url:location.href,target:t,args:e})}},o=function(e){return Object.assign(e,u),e}}]);
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stimulus_reflex
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.8
4
+ version: 0.1.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nathan Hopkins
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2018-10-22 00:00:00.000000000 Z
12
+ date: 2018-10-24 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rack