actioncable 5.2.6 → 6.0.0.beta1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (36) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +58 -77
  3. data/MIT-LICENSE +1 -1
  4. data/README.md +1 -544
  5. data/app/assets/javascripts/action_cable.js +492 -0
  6. data/lib/action_cable.rb +15 -7
  7. data/lib/action_cable/channel.rb +1 -0
  8. data/lib/action_cable/channel/base.rb +5 -1
  9. data/lib/action_cable/channel/test_case.rb +312 -0
  10. data/lib/action_cable/connection.rb +1 -0
  11. data/lib/action_cable/connection/authorization.rb +1 -1
  12. data/lib/action_cable/connection/base.rb +9 -7
  13. data/lib/action_cable/connection/message_buffer.rb +1 -4
  14. data/lib/action_cable/connection/stream.rb +4 -2
  15. data/lib/action_cable/connection/subscriptions.rb +1 -5
  16. data/lib/action_cable/connection/test_case.rb +236 -0
  17. data/lib/action_cable/connection/web_socket.rb +1 -3
  18. data/lib/action_cable/gem_version.rb +4 -4
  19. data/lib/action_cable/server/base.rb +3 -1
  20. data/lib/action_cable/server/worker.rb +5 -7
  21. data/lib/action_cable/subscription_adapter.rb +1 -0
  22. data/lib/action_cable/subscription_adapter/postgresql.rb +24 -8
  23. data/lib/action_cable/subscription_adapter/redis.rb +2 -1
  24. data/lib/action_cable/subscription_adapter/test.rb +40 -0
  25. data/lib/action_cable/test_case.rb +11 -0
  26. data/lib/action_cable/test_helper.rb +133 -0
  27. data/lib/rails/generators/channel/USAGE +4 -5
  28. data/lib/rails/generators/channel/channel_generator.rb +6 -3
  29. data/lib/rails/generators/channel/templates/{assets → javascript}/channel.js.tt +3 -1
  30. data/lib/rails/generators/channel/templates/{assets/cable.js.tt → javascript/consumer.js.tt} +2 -9
  31. data/lib/rails/generators/channel/templates/javascript/index.js.tt +5 -0
  32. data/lib/rails/generators/test_unit/channel_generator.rb +20 -0
  33. data/lib/rails/generators/test_unit/templates/channel_test.rb.tt +8 -0
  34. metadata +21 -14
  35. data/lib/assets/compiled/action_cable.js +0 -601
  36. 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 -%>