render_turbo_stream 4.3.15 → 4.3.16

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 134824095a6baf570e7a0702b435773c623cae537059ee6883dc141cb9a15237
4
- data.tar.gz: 31aba69f008b047d5ab1234f621b3bc5d1858c8808fb644bb2d59eaf63766b19
3
+ metadata.gz: ab40a8958c762e832bbc38ed03d5a615c8bf41f64c4fd582d09476e373a0fe70
4
+ data.tar.gz: 6863e35d57c45752ee48cb06a057431b9341c1f36d105c66b8f28cd3125a5c2a
5
5
  SHA512:
6
- metadata.gz: 0cc9bc72db795c128ede596635e5a9b303033e58d2b6f791767eb3d3d1c720ab23e307dcd0cf2b9a41667a24f33ca4d8509e3594854a14cd456b56de539ddbd4
7
- data.tar.gz: 3dd2fe010267ee08a0f1b82f350310a4b6dc53e5c5e93912d464b3f4420787e2c2cf93ddb684221540a4b49a6ed87604f9eb766d1a42ce5428aed9508db3e9a4
6
+ metadata.gz: 0e0562b25a98b14b30a3e3a124546e5cba2c8f34e7829f82778549c132606fe34cc6546e9e3ddd92059474e421977684ef99f3c269ca87b36020be056eea1e8f
7
+ data.tar.gz: 85a5453b54b6df7c25333e20ff5bec62fa38758dca6a7e69f4afcf02eb580d5dc129c69588ebffe7c14edc626c493dd8748d657e9bf1d00cc2b5f7cd92ac90ab
@@ -3,7 +3,7 @@ module RenderTurboStream
3
3
 
4
4
  def channel_from_me
5
5
  if current_user
6
- turbo_stream_from "authenticated-user-#{current_user.id}"
6
+ turbo_stream_from "authenticated_user_#{current_user.id}"
7
7
  else
8
8
  Rails.logger.debug(" • SKIP channel_from_me because not authenticated")
9
9
  nil
@@ -12,7 +12,7 @@ module RenderTurboStream
12
12
 
13
13
  def channel_from_authenticated_group(group)
14
14
  if current_user
15
- turbo_stream_from "authenticated-group-#{group}"
15
+ turbo_stream_from "authenticated_group_#{group}"
16
16
  else
17
17
  Rails.logger.debug(" • SKIP channel_from_authenticated_group because not authenticated")
18
18
  nil
@@ -2,7 +2,7 @@ module RenderTurboStream
2
2
  module ControllerChannelHelpers
3
3
 
4
4
  def render_to_all(target_id = nil, action = :replace, partial: nil, template: nil, locals: nil)
5
- evaluate_instance_variables
5
+ #evaluate_instance_variables
6
6
  render_to_channel(
7
7
  'all',
8
8
  target_id,
@@ -26,8 +26,8 @@ module RenderTurboStream
26
26
  end
27
27
 
28
28
  render_to_channel(
29
- "authenticated-user-#{helpers.current_user.id}",
30
- RenderTurboStream::Libs.target_id_to_target(target_id),
29
+ "authenticated_user_#{helpers.current_user.id}",
30
+ target_id,
31
31
  action,
32
32
  partial: partial,
33
33
  locals: locals
@@ -47,8 +47,8 @@ module RenderTurboStream
47
47
  end
48
48
 
49
49
  render_to_channel(
50
- "authenticated-group-#{group}",
51
- RenderTurboStream::Libs.target_id_to_target(target_id),
50
+ "authenticated_group_#{group}",
51
+ target_id,
52
52
  action,
53
53
  partial: partial,
54
54
  locals: locals
@@ -76,7 +76,7 @@ module RenderTurboStream
76
76
  @render_cable_template_was_called = true
77
77
  end
78
78
 
79
- evaluate_instance_variables
79
+ #evaluate_instance_variables
80
80
 
81
81
  libs = RenderTurboStream::ChannelLibs.new(response)
82
82
  libs.render_to_channel(
@@ -107,7 +107,7 @@ module RenderTurboStream
107
107
  return
108
108
  end
109
109
 
110
- action_to_channel("authenticated-user-#{helpers.current_user.id}", action, arguments)
110
+ action_to_channel("authenticated_user_#{helpers.current_user.id}", action, arguments)
111
111
  end
112
112
 
113
113
  def action_to_authenticated_group(group, action, *arguments)
@@ -123,7 +123,7 @@ module RenderTurboStream
123
123
  return
124
124
  end
125
125
 
126
- action_to_channel("authenticated-group-#{group}", action, arguments)
126
+ action_to_channel("authenticated_group_#{group}", action, arguments)
127
127
  end
128
128
 
129
129
  def action_to_channel(channel, command, arguments)
@@ -202,7 +202,7 @@ module RenderTurboStream
202
202
  libs = RenderTurboStream::ChannelLibs.new(response)
203
203
  if (helpers.current_user.id rescue false)
204
204
  libs.send_actions_to_channel(
205
- "authenticated-user-#{helpers.current_user.id}",
205
+ "authenticated_user_#{helpers.current_user.id}",
206
206
  turbo_actions,
207
207
  instance_variables: instance_variables
208
208
  )
@@ -111,7 +111,7 @@ module RenderTurboStream
111
111
  if allow_channel
112
112
  Rails.logger.debug(" • Send actions through Turbo::StreamsChannel")
113
113
  c_libs = RenderTurboStream::ChannelLibs.new(response)
114
- c_libs.send_actions_to_channel("authenticated-user-#{helpers.current_user.id}", streams, @render_turbo_stream_evaluate_instance_variables)
114
+ c_libs.send_actions_to_channel("authenticated_user_#{helpers.current_user.id}", streams, @render_turbo_stream_evaluate_instance_variables)
115
115
  else
116
116
  flash[:alert] = flashes[:alerts]
117
117
  flash[:notice] = flashes[:notices]
@@ -2,7 +2,7 @@ module RenderTurboStream
2
2
  class Libs
3
3
 
4
4
  def self.target_id_to_target(target_id)
5
- if target_id.present?
5
+ if target_id.present? && !target_id[0] == '#'
6
6
  "##{target_id}"
7
7
  else
8
8
  nil
@@ -7,7 +7,7 @@ module RenderTurboStream
7
7
 
8
8
  def assert_channel_to_me(user, target_id, action: nil, count: 1, &block)
9
9
 
10
- channel = "authenticated-user-#{user.id}"
10
+ channel = "authenticated_user_#{user.id}"
11
11
 
12
12
  libs = RenderTurboStream::Test::Request::Libs.new(response)
13
13
 
@@ -21,7 +21,7 @@ module RenderTurboStream
21
21
 
22
22
  def assert_action_to_me(user, action, count: 1, &block)
23
23
 
24
- channel = "authenticated-user-#{user.id}"
24
+ channel = "authenticated_user_#{user.id}"
25
25
 
26
26
  libs = RenderTurboStream::Test::Request::Libs.new(response)
27
27
 
@@ -37,7 +37,7 @@ module RenderTurboStream
37
37
 
38
38
  def assert_channel_to_authenticated_group(group, target_id, count: 1, &block)
39
39
 
40
- channel = "authenticated-group-#{group}"
40
+ channel = "authenticated_group_#{group}"
41
41
 
42
42
  libs = RenderTurboStream::Test::Request::Libs.new(response)
43
43
 
@@ -51,7 +51,7 @@ module RenderTurboStream
51
51
 
52
52
  def assert_action_to_authenticated_group(group, action, count: 1, &block)
53
53
 
54
- channel = "authenticated-group-#{group}"
54
+ channel = "authenticated_group_#{group}"
55
55
 
56
56
  libs = RenderTurboStream::Test::Request::Libs.new(response)
57
57
 
@@ -1,3 +1,3 @@
1
1
  module RenderTurboStream
2
- VERSION = "4.3.15"
2
+ VERSION = "4.3.16"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: render_turbo_stream
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.3.15
4
+ version: 4.3.16
5
5
  platform: ruby
6
6
  authors:
7
7
  - christian
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-08-21 00:00:00.000000000 Z
11
+ date: 2024-01-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails