render_turbo_stream 4.3.15 → 4.3.17

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: 91ec62a537df4902f5adcf7caf65a6b6a098365d2c983cda574a2d9ab1ffd22e
4
+ data.tar.gz: 28b80ad8d49000bc97b8b4fb0d66e1810befd61f0812aeb00712f8836d2dca3d
5
5
  SHA512:
6
- metadata.gz: 0cc9bc72db795c128ede596635e5a9b303033e58d2b6f791767eb3d3d1c720ab23e307dcd0cf2b9a41667a24f33ca4d8509e3594854a14cd456b56de539ddbd4
7
- data.tar.gz: 3dd2fe010267ee08a0f1b82f350310a4b6dc53e5c5e93912d464b3f4420787e2c2cf93ddb684221540a4b49a6ed87604f9eb766d1a42ce5428aed9508db3e9a4
6
+ metadata.gz: 343b599092acb9ccb1dc2f046175af02a6771696f0883f573b9f5f99e3891ff86fe6064510e761a05deba57feb814d0a473da61f8842eea0ea4642fc16d33996
7
+ data.tar.gz: ea135fc6460784cf9a2a7c5f738fe37e639e23645577b53b5e761443ca20bca141167eb6d68a8adcf466b7f90e4c4caea8aef55ba4838c3f29b9231670fd7139
@@ -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]
@@ -3,7 +3,11 @@ module RenderTurboStream
3
3
 
4
4
  def self.target_id_to_target(target_id)
5
5
  if target_id.present?
6
+ if target_id[0] == '#'
7
+ target_id
8
+ else
6
9
  "##{target_id}"
10
+ end
7
11
  else
8
12
  nil
9
13
  end
@@ -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.17"
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.17
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