actioncable 5.0.0.beta3 → 5.0.0.beta4

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 +52 -6
  3. data/README.md +11 -15
  4. data/lib/action_cable.rb +5 -4
  5. data/lib/action_cable/channel/base.rb +19 -6
  6. data/lib/action_cable/channel/periodic_timers.rb +45 -7
  7. data/lib/action_cable/channel/streams.rb +70 -14
  8. data/lib/action_cable/connection.rb +2 -0
  9. data/lib/action_cable/connection/base.rb +33 -21
  10. data/lib/action_cable/connection/client_socket.rb +17 -9
  11. data/lib/action_cable/connection/faye_client_socket.rb +48 -0
  12. data/lib/action_cable/connection/faye_event_loop.rb +44 -0
  13. data/lib/action_cable/connection/internal_channel.rb +3 -5
  14. data/lib/action_cable/connection/message_buffer.rb +2 -2
  15. data/lib/action_cable/connection/stream.rb +9 -11
  16. data/lib/action_cable/connection/stream_event_loop.rb +10 -1
  17. data/lib/action_cable/connection/web_socket.rb +6 -2
  18. data/lib/action_cable/engine.rb +37 -1
  19. data/lib/action_cable/gem_version.rb +1 -1
  20. data/lib/action_cable/helpers/action_cable_helper.rb +19 -8
  21. data/lib/action_cable/remote_connections.rb +1 -1
  22. data/lib/action_cable/server/base.rb +26 -6
  23. data/lib/action_cable/server/broadcasting.rb +10 -9
  24. data/lib/action_cable/server/configuration.rb +19 -3
  25. data/lib/action_cable/server/connections.rb +3 -3
  26. data/lib/action_cable/server/worker.rb +27 -27
  27. data/lib/action_cable/server/worker/active_record_connection_management.rb +0 -3
  28. data/lib/action_cable/subscription_adapter/async.rb +8 -3
  29. data/lib/action_cable/subscription_adapter/evented_redis.rb +5 -1
  30. data/lib/action_cable/subscription_adapter/postgresql.rb +5 -4
  31. data/lib/action_cable/subscription_adapter/redis.rb +11 -6
  32. data/lib/assets/compiled/action_cable.js +248 -188
  33. data/lib/rails/generators/channel/USAGE +1 -1
  34. data/lib/rails/generators/channel/channel_generator.rb +4 -1
  35. data/lib/rails/generators/channel/templates/assets/cable.js +13 -0
  36. metadata +8 -5
@@ -3,7 +3,7 @@ Description:
3
3
  Stubs out a new cable channel for the server (in Ruby) and client (in CoffeeScript).
4
4
  Pass the channel name, either CamelCased or under_scored, and an optional list of channel actions as arguments.
5
5
 
6
- Note: Turn on the cable connection in app/assets/javascript/cable.coffee after generating any channels.
6
+ Note: Turn on the cable connection in app/assets/javascript/cable.js after generating any channels.
7
7
 
8
8
  Example:
9
9
  ========
@@ -13,6 +13,9 @@ module Rails
13
13
  template "channel.rb", File.join('app/channels', class_path, "#{file_name}_channel.rb")
14
14
 
15
15
  if options[:assets]
16
+ if self.behavior == :invoke
17
+ template "assets/cable.js", "app/assets/javascripts/cable.js"
18
+ end
16
19
  template "assets/channel.coffee", File.join('app/assets/javascripts/channels', class_path, "#{file_name}.coffee")
17
20
  end
18
21
 
@@ -21,7 +24,7 @@ module Rails
21
24
 
22
25
  protected
23
26
  def file_name
24
- @_file_name ||= super.gsub(/\_channel/i, '')
27
+ @_file_name ||= super.gsub(/_channel/i, '')
25
28
  end
26
29
 
27
30
  # FIXME: Change these files to symlinks once RubyGems 2.5.0 is required.
@@ -0,0 +1,13 @@
1
+ // Action Cable provides the framework to deal with WebSockets in Rails.
2
+ // You can generate new channels where WebSocket features live using the rails generate channel command.
3
+ //
4
+ //= require action_cable
5
+ //= require_self
6
+ //= require_tree ./channels
7
+
8
+ (function() {
9
+ this.App || (this.App = {});
10
+
11
+ App.cable = ActionCable.createConsumer();
12
+
13
+ }).call(this);
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: actioncable
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.0.0.beta3
4
+ version: 5.0.0.beta4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pratik Naik
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-02-24 00:00:00.000000000 Z
12
+ date: 2016-04-27 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: actionpack
@@ -17,14 +17,14 @@ dependencies:
17
17
  requirements:
18
18
  - - '='
19
19
  - !ruby/object:Gem::Version
20
- version: 5.0.0.beta3
20
+ version: 5.0.0.beta4
21
21
  type: :runtime
22
22
  prerelease: false
23
23
  version_requirements: !ruby/object:Gem::Requirement
24
24
  requirements:
25
25
  - - '='
26
26
  - !ruby/object:Gem::Version
27
- version: 5.0.0.beta3
27
+ version: 5.0.0.beta4
28
28
  - !ruby/object:Gem::Dependency
29
29
  name: nio4r
30
30
  requirement: !ruby/object:Gem::Requirement
@@ -77,6 +77,8 @@ files:
77
77
  - lib/action_cable/connection/authorization.rb
78
78
  - lib/action_cable/connection/base.rb
79
79
  - lib/action_cable/connection/client_socket.rb
80
+ - lib/action_cable/connection/faye_client_socket.rb
81
+ - lib/action_cable/connection/faye_event_loop.rb
80
82
  - lib/action_cable/connection/identification.rb
81
83
  - lib/action_cable/connection/internal_channel.rb
82
84
  - lib/action_cable/connection/message_buffer.rb
@@ -110,6 +112,7 @@ files:
110
112
  - lib/rails/generators/channel/channel_generator.rb
111
113
  - lib/rails/generators/channel/templates/application_cable/channel.rb
112
114
  - lib/rails/generators/channel/templates/application_cable/connection.rb
115
+ - lib/rails/generators/channel/templates/assets/cable.js
113
116
  - lib/rails/generators/channel/templates/assets/channel.coffee
114
117
  - lib/rails/generators/channel/templates/channel.rb
115
118
  homepage: http://rubyonrails.org
@@ -132,7 +135,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
132
135
  version: 1.3.1
133
136
  requirements: []
134
137
  rubyforge_project:
135
- rubygems_version: 2.5.1
138
+ rubygems_version: 2.6.4
136
139
  signing_key:
137
140
  specification_version: 4
138
141
  summary: WebSocket framework for Rails.