actioncable 5.2.3.rc1 → 6.0.0.beta1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +58 -32
- data/MIT-LICENSE +1 -1
- data/README.md +1 -544
- data/app/assets/javascripts/action_cable.js +492 -0
- data/lib/action_cable.rb +15 -7
- data/lib/action_cable/channel.rb +1 -0
- data/lib/action_cable/channel/base.rb +5 -1
- data/lib/action_cable/channel/test_case.rb +312 -0
- data/lib/action_cable/connection.rb +1 -0
- data/lib/action_cable/connection/authorization.rb +1 -1
- data/lib/action_cable/connection/base.rb +9 -7
- data/lib/action_cable/connection/message_buffer.rb +1 -4
- data/lib/action_cable/connection/stream.rb +4 -2
- data/lib/action_cable/connection/subscriptions.rb +1 -5
- data/lib/action_cable/connection/test_case.rb +236 -0
- data/lib/action_cable/connection/web_socket.rb +1 -3
- data/lib/action_cable/gem_version.rb +4 -4
- data/lib/action_cable/server/base.rb +3 -1
- data/lib/action_cable/server/worker.rb +5 -7
- data/lib/action_cable/subscription_adapter.rb +1 -0
- data/lib/action_cable/subscription_adapter/postgresql.rb +24 -8
- data/lib/action_cable/subscription_adapter/redis.rb +2 -1
- data/lib/action_cable/subscription_adapter/test.rb +40 -0
- data/lib/action_cable/test_case.rb +11 -0
- data/lib/action_cable/test_helper.rb +133 -0
- data/lib/rails/generators/channel/USAGE +4 -5
- data/lib/rails/generators/channel/channel_generator.rb +6 -3
- data/lib/rails/generators/channel/templates/{assets → javascript}/channel.js.tt +3 -1
- data/lib/rails/generators/channel/templates/{assets/cable.js.tt → javascript/consumer.js.tt} +2 -9
- data/lib/rails/generators/channel/templates/javascript/index.js.tt +5 -0
- data/lib/rails/generators/test_unit/channel_generator.rb +20 -0
- data/lib/rails/generators/test_unit/templates/channel_test.rb.tt +8 -0
- metadata +18 -11
- data/lib/assets/compiled/action_cable.js +0 -601
- data/lib/rails/generators/channel/templates/assets/channel.coffee.tt +0 -14
@@ -1,14 +0,0 @@
|
|
1
|
-
App.<%= class_name.underscore %> = App.cable.subscriptions.create "<%= class_name %>Channel",
|
2
|
-
connected: ->
|
3
|
-
# Called when the subscription is ready for use on the server
|
4
|
-
|
5
|
-
disconnected: ->
|
6
|
-
# Called when the subscription has been terminated by the server
|
7
|
-
|
8
|
-
received: (data) ->
|
9
|
-
# Called when there's incoming data on the websocket for this channel
|
10
|
-
<% actions.each do |action| -%>
|
11
|
-
|
12
|
-
<%= action %>: ->
|
13
|
-
@perform '<%= action %>'
|
14
|
-
<% end -%>
|