stimulus_reflex 2.1.6 → 2.1.7
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 +4 -4
- data/Gemfile.lock +4 -4
- data/lib/stimulus_reflex/channel.rb +17 -18
- data/lib/stimulus_reflex/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7358f3c72c8e21891a1b5ff2a61905225874f1a4fb9ab6a6ec2246a86694925d
|
4
|
+
data.tar.gz: 002c186526500e8d7436cd55fdcdde2d4338d76ebb612963e2f0370b1ce7bf7a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8cdd04587e3a3e9f38d1505efcf5fb3701469356eeb4c6873fc106a5aac035d4d6656c200fc3e8889d63dadbdc50dcf7515901392dd3eb31f50677c05792a328
|
7
|
+
data.tar.gz: 88f4c15ab3ac1fb8f55ec590f088795ef9e89400d235ad939f92d09d9b8056cb0b1b55e7de254bc1273055214dc876dca67b81194dc506d202654140170608e2
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
stimulus_reflex (2.1.
|
4
|
+
stimulus_reflex (2.1.7)
|
5
5
|
cable_ready (>= 4.0)
|
6
6
|
nokogiri
|
7
7
|
rack
|
@@ -94,7 +94,7 @@ GEM
|
|
94
94
|
nokogiri (1.10.7)
|
95
95
|
mini_portile2 (~> 2.4.0)
|
96
96
|
parallel (1.19.1)
|
97
|
-
parser (2.
|
97
|
+
parser (2.7.0.0)
|
98
98
|
ast (~> 2.4.0)
|
99
99
|
pry (0.12.2)
|
100
100
|
coderay (~> 1.1.0)
|
@@ -139,7 +139,7 @@ GEM
|
|
139
139
|
rainbow (>= 2.2.2, < 4.0)
|
140
140
|
ruby-progressbar (~> 1.7)
|
141
141
|
unicode-display_width (>= 1.4.0, < 1.7)
|
142
|
-
rubocop-performance (1.5.
|
142
|
+
rubocop-performance (1.5.2)
|
143
143
|
rubocop (>= 0.71.0)
|
144
144
|
ruby-progressbar (1.10.1)
|
145
145
|
sprockets (4.0.0)
|
@@ -156,7 +156,7 @@ GEM
|
|
156
156
|
standard
|
157
157
|
thor (1.0.1)
|
158
158
|
thread_safe (0.3.6)
|
159
|
-
tzinfo (1.2.
|
159
|
+
tzinfo (1.2.6)
|
160
160
|
thread_safe (~> 0.1)
|
161
161
|
unicode-display_width (1.6.0)
|
162
162
|
websocket-driver (0.7.1)
|
@@ -71,29 +71,28 @@ class StimulusReflex::Channel < ActionCable::Channel::Base
|
|
71
71
|
|
72
72
|
def render_page(url, reflex)
|
73
73
|
uri = URI.parse(url)
|
74
|
-
|
75
|
-
|
76
|
-
|
74
|
+
query_hash = Rack::Utils.parse_nested_query(uri.query)
|
75
|
+
request = ActionDispatch::Request.new(
|
76
|
+
connection.env.merge(
|
77
|
+
Rack::MockRequest.env_for(uri.to_s).merge(
|
78
|
+
"rack.request.query_hash" => query_hash,
|
79
|
+
"rack.request.query_string" => uri.query,
|
80
|
+
"ORIGINAL_SCRIPT_NAME" => "",
|
81
|
+
"ORIGINAL_FULLPATH" => uri.path,
|
82
|
+
Rack::SCRIPT_NAME => "",
|
83
|
+
Rack::PATH_INFO => uri.path,
|
84
|
+
Rack::REQUEST_PATH => uri.path,
|
85
|
+
Rack::QUERY_STRING => uri.query,
|
86
|
+
)
|
87
|
+
)
|
88
|
+
)
|
89
|
+
url_params = Rails.application.routes.recognize_path_with_request(request, url, request.env[:extras] || {})
|
90
|
+
controller = request.controller_class.new
|
77
91
|
controller.instance_variable_set :"@stimulus_reflex", true
|
78
92
|
reflex.instance_variables.each do |name|
|
79
93
|
controller.instance_variable_set name, reflex.instance_variable_get(name)
|
80
94
|
end
|
81
95
|
|
82
|
-
query_hash = Rack::Utils.parse_nested_query(uri.query)
|
83
|
-
env = {
|
84
|
-
"action_dispatch.request.path_parameters" => url_params,
|
85
|
-
"action_dispatch.request.query_parameters" => query_hash,
|
86
|
-
"rack.request.query_hash" => query_hash,
|
87
|
-
"rack.request.query_string" => uri.query,
|
88
|
-
"ORIGINAL_SCRIPT_NAME" => "",
|
89
|
-
"ORIGINAL_FULLPATH" => uri.path,
|
90
|
-
Rack::SCRIPT_NAME => "",
|
91
|
-
Rack::PATH_INFO => uri.path,
|
92
|
-
Rack::REQUEST_PATH => uri.path,
|
93
|
-
Rack::QUERY_STRING => uri.query,
|
94
|
-
}
|
95
|
-
|
96
|
-
request = ActionDispatch::Request.new(connection.env.merge(env))
|
97
96
|
controller.request = request
|
98
97
|
controller.response = ActionDispatch::Response.new
|
99
98
|
controller.process url_params[:action]
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: stimulus_reflex
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1.
|
4
|
+
version: 2.1.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nathan Hopkins
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-12-
|
11
|
+
date: 2019-12-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rack
|