stimulus_reflex 2.2.1 → 2.2.2

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: 844e7f1ac114f7caa54e09bc234fbebbc512199b6f65dea4bfb261d9482acbee
4
- data.tar.gz: 239604e4a357514260dcb8e8e38b4c00991420f78c82320d002ddfe133f5de42
3
+ metadata.gz: c6951e4d588809fe33082a91335056c7b7272f4724cc3a1462550a3fd16e8ef4
4
+ data.tar.gz: a201464e447381ac5af9aeac9a085a23aea4507b714b1f41df2313bf92c39305
5
5
  SHA512:
6
- metadata.gz: aa206dacfb298d6f9e8c087b2e31d57cb21f62851018d89671e3980598d3716e9074ff474c0eaf3efb8c0976c6f347568ca76c7bce018078902e1d9145672306
7
- data.tar.gz: 59abefb476f59e884689d47343dcbfe3f6030e83978cb1564c7728cb281bb89c58fa32b32d6557cf4e90d439b08604943b98ae26375a70673fae6e6976e4552b
6
+ metadata.gz: 6e6a3768e5d91c71f4e75c8d7a645f47ead4831b2bfdccfdefccd23cc9aae8373b06ceb6f23a27aced60a97e5ba60941e4dd616a0736ea84e886edb13b75a596
7
+ data.tar.gz: 9dadc848c4bdbf25e52708e40600434ac41c0be5c3bf2156902887fb651c9244fe87d6075f936440c41c484b5b2aabd9aa8b2eb73c90bc53f1118c03e3449441
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- stimulus_reflex (2.2.1)
4
+ stimulus_reflex (2.2.2)
5
5
  cable_ready (>= 4.0)
6
6
  nokogiri
7
7
  rack
@@ -91,10 +91,10 @@ GEM
91
91
  mini_portile2 (2.4.0)
92
92
  minitest (5.14.0)
93
93
  nio4r (2.5.2)
94
- nokogiri (1.10.8)
94
+ nokogiri (1.10.9)
95
95
  mini_portile2 (~> 2.4.0)
96
96
  parallel (1.19.1)
97
- parser (2.7.0.2)
97
+ parser (2.7.0.4)
98
98
  ast (~> 2.4.0)
99
99
  pry (0.12.2)
100
100
  coderay (~> 1.1.0)
@@ -149,7 +149,7 @@ GEM
149
149
  actionpack (>= 4.0)
150
150
  activesupport (>= 4.0)
151
151
  sprockets (>= 3.0.0)
152
- standard (0.1.10)
152
+ standard (0.2.1)
153
153
  rubocop (~> 0.79.0)
154
154
  rubocop-performance (~> 1.5.1)
155
155
  standardrb (1.0.0)
@@ -162,7 +162,7 @@ GEM
162
162
  websocket-driver (0.7.1)
163
163
  websocket-extensions (>= 0.1.0)
164
164
  websocket-extensions (0.1.4)
165
- zeitwerk (2.2.2)
165
+ zeitwerk (2.3.0)
166
166
 
167
167
  PLATFORMS
168
168
  ruby
@@ -7,7 +7,7 @@ class StimulusReflex::Channel < ActionCable::Channel::Base
7
7
  ids = connection.identifiers.map { |identifier| send(identifier).try(:id) || send(identifier) }
8
8
  [
9
9
  params[:channel],
10
- ids.select(&:present?).join(";"),
10
+ ids.select(&:present?).join(";")
11
11
  ].select(&:present?).join(":")
12
12
  end
13
13
 
@@ -68,6 +68,14 @@ class StimulusReflex::Channel < ActionCable::Channel::Base
68
68
  broadcast_morphs selectors, data, html if html.present?
69
69
  end
70
70
 
71
+ def commit_session(request, response)
72
+ store = request.session.instance_variable_get("@by")
73
+ store.commit_session request, response
74
+ rescue => e
75
+ message = "Failed to commit session! #{exception_message_with_backtrace(e)}"
76
+ logger.error "\e[31m#{message}\e[0m"
77
+ end
78
+
71
79
  def render_page(url, reflex)
72
80
  uri = URI.parse(url)
73
81
  path = ActionDispatch::Journey::Router::Utils.normalize_path(uri.path)
@@ -82,7 +90,7 @@ class StimulusReflex::Channel < ActionCable::Channel::Base
82
90
  Rack::SCRIPT_NAME => "",
83
91
  Rack::PATH_INFO => path,
84
92
  Rack::REQUEST_PATH => path,
85
- Rack::QUERY_STRING => uri.query,
93
+ Rack::QUERY_STRING => uri.query
86
94
  )
87
95
  )
88
96
  )
@@ -96,6 +104,7 @@ class StimulusReflex::Channel < ActionCable::Channel::Base
96
104
  controller.request = request
97
105
  controller.response = ActionDispatch::Response.new
98
106
  controller.process url_params[:action]
107
+ commit_session request, controller.response
99
108
  controller.response.body
100
109
  end
101
110
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module StimulusReflex
4
- VERSION = "2.2.1"
4
+ VERSION = "2.2.2"
5
5
  end
@@ -8,6 +8,12 @@ Gem::Specification.new do |gem|
8
8
  gem.email = ["natehop@gmail.com"]
9
9
  gem.homepage = "https://github.com/hopsoft/stimulus_reflex"
10
10
  gem.summary = "Build reactive applications with the Rails tooling you already know and love."
11
+ gem.post_install_message = <<~MESSAGE
12
+ Friendly reminder: When updating the stimulus_reflex gem,
13
+ don't forget to update your npm package as well.
14
+
15
+ See https://www.npmjs.com/package/stimulus_reflex
16
+ MESSAGE
11
17
 
12
18
  gem.files = Dir["lib/**/*", "bin/*", "[A-Z]*"]
13
19
  gem.test_files = Dir["test/**/*.rb"]
data/tags ADDED
@@ -0,0 +1,39 @@
1
+ !_TAG_FILE_FORMAT 2 /extended format; --format=1 will not append ;" to lines/
2
+ !_TAG_FILE_SORTED 1 /0=unsorted, 1=sorted, 2=foldcase/
3
+ !_TAG_PROGRAM_AUTHOR Darren Hiebert /dhiebert@users.sourceforge.net/
4
+ !_TAG_PROGRAM_NAME Exuberant Ctags //
5
+ !_TAG_PROGRAM_URL http://ctags.sourceforge.net /official site/
6
+ !_TAG_PROGRAM_VERSION 5.8 //
7
+ ApplicationReflex lib/generators/templates/application_reflex.rb /^class ApplicationReflex < StimulusReflex::Reflex$/;" c
8
+ ApplicationReflex test/tmp/app/reflexes/application_reflex.rb /^class ApplicationReflex < StimulusReflex::Reflex$/;" c
9
+ DemoReflex test/tmp/app/reflexes/demo_reflex.rb /^class DemoReflex < ApplicationReflex$/;" c
10
+ Engine lib/stimulus_reflex.rb /^ class Engine < Rails::Engine$/;" c class:StimulusReflex
11
+ StimulusReflex lib/stimulus_reflex.rb /^module StimulusReflex$/;" m
12
+ StimulusReflex lib/stimulus_reflex/channel.rb /^class StimulusReflex::Channel < ActionCable::Channel::Base$/;" c
13
+ StimulusReflex lib/stimulus_reflex/element.rb /^class StimulusReflex::Element$/;" c
14
+ StimulusReflex lib/stimulus_reflex/reflex.rb /^class StimulusReflex::Reflex$/;" c
15
+ StimulusReflex lib/stimulus_reflex/version.rb /^module StimulusReflex$/;" m
16
+ StimulusReflexGenerator lib/generators/stimulus_reflex_generator.rb /^class StimulusReflexGenerator < Rails::Generators::NamedBase$/;" c
17
+ StimulusReflexGeneratorTest test/generators/stimulus_reflex_generator_test.rb /^class StimulusReflexGeneratorTest < Rails::Generators::TestCase$/;" c
18
+ broadcast_error lib/stimulus_reflex/channel.rb /^ def broadcast_error(message, data = {})$/;" f class:StimulusReflex
19
+ broadcast_morphs lib/stimulus_reflex/channel.rb /^ def broadcast_morphs(selectors, data, html)$/;" f class:StimulusReflex
20
+ copy_controller_files lib/generators/stimulus_reflex_generator.rb /^ def copy_controller_files$/;" f class:StimulusReflexGenerator
21
+ copy_reflex_files lib/generators/stimulus_reflex_generator.rb /^ def copy_reflex_files$/;" f class:StimulusReflexGenerator
22
+ dataset lib/stimulus_reflex/element.rb /^ def dataset$/;" f class:StimulusReflex
23
+ delegate_call_to_reflex lib/stimulus_reflex/channel.rb /^ def delegate_call_to_reflex(reflex, method_name, arguments = [])$/;" f class:StimulusReflex
24
+ exception_message_with_backtrace lib/stimulus_reflex/channel.rb /^ def exception_message_with_backtrace(exception)$/;" f class:StimulusReflex
25
+ export.reflexAttribute javascript/schema.js /^ reflexAttribute: 'data-reflex',$/;" p
26
+ export.reflexPermanentAttribute javascript/schema.js /^ reflexPermanentAttribute: 'data-reflex-permanent',$/;" p
27
+ export.reflexRootAttribute javascript/schema.js /^ reflexRootAttribute: 'data-reflex-root'$/;" p
28
+ findConsumer javascript/consumer.js /^function findConsumer (object, depth = 0) {$/;" f
29
+ initialize lib/stimulus_reflex/element.rb /^ def initialize(attrs = {})$/;" f class:StimulusReflex
30
+ initialize lib/stimulus_reflex/reflex.rb /^ def initialize(channel, url: nil, element: nil, selectors: [])$/;" f class:StimulusReflex
31
+ initialize_controllers lib/generators/stimulus_reflex_generator.rb /^ def initialize_controllers$/;" f class:StimulusReflexGenerator
32
+ initialize_reflexes lib/generators/stimulus_reflex_generator.rb /^ def initialize_reflexes$/;" f class:StimulusReflexGenerator
33
+ is_reflex? lib/stimulus_reflex/channel.rb /^ def is_reflex?(reflex_class)$/;" f class:StimulusReflex
34
+ receive lib/stimulus_reflex/channel.rb /^ def receive(data)$/;" f class:StimulusReflex
35
+ render_page lib/stimulus_reflex/channel.rb /^ def render_page(url, reflex)$/;" f class:StimulusReflex
36
+ render_page_and_broadcast_morph lib/stimulus_reflex/channel.rb /^ def render_page_and_broadcast_morph(url, reflex, selectors, data = {})$/;" f class:StimulusReflex
37
+ request lib/stimulus_reflex/reflex.rb /^ def request$/;" f class:StimulusReflex
38
+ stream_name lib/stimulus_reflex/channel.rb /^ def stream_name$/;" f class:StimulusReflex
39
+ subscribed lib/stimulus_reflex/channel.rb /^ def subscribed$/;" f class:StimulusReflex
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.2.1
4
+ version: 2.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nathan Hopkins
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-02-28 00:00:00.000000000 Z
11
+ date: 2020-03-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rack
@@ -167,6 +167,7 @@ files:
167
167
  - lib/stimulus_reflex/version.rb
168
168
  - lib/tasks/stimulus_reflex/install.rake
169
169
  - stimulus_reflex.gemspec
170
+ - tags
170
171
  - test/generators/stimulus_reflex_generator_test.rb
171
172
  - test/test_helper.rb
172
173
  - test/tmp/app/reflexes/application_reflex.rb
@@ -175,7 +176,11 @@ homepage: https://github.com/hopsoft/stimulus_reflex
175
176
  licenses:
176
177
  - MIT
177
178
  metadata: {}
178
- post_install_message:
179
+ post_install_message: |
180
+ Friendly reminder: When updating the stimulus_reflex gem,
181
+ don't forget to update your npm package as well.
182
+
183
+ See https://www.npmjs.com/package/stimulus_reflex
179
184
  rdoc_options: []
180
185
  require_paths:
181
186
  - lib