mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
acfdcf5568
* Move specific requires close to where they're needed. * Use the private active_support/rails dep to wrap up common needs like eager autoload and module delegation. * Use a single Rails engine rather than an engine and a railtie. * Prefer `AS::JSON.encode` to `Object#to_json`.
21 lines
440 B
Ruby
21 lines
440 B
Ruby
require 'active_support'
|
|
require 'active_support/rails'
|
|
require 'action_cable/version'
|
|
|
|
module ActionCable
|
|
extend ActiveSupport::Autoload
|
|
|
|
# Singleton instance of the server
|
|
module_function def server
|
|
@server ||= ActionCable::Server::Base.new
|
|
end
|
|
|
|
eager_autoload do
|
|
autoload :Server
|
|
autoload :Connection
|
|
autoload :Channel
|
|
autoload :RemoteConnections
|
|
end
|
|
end
|
|
|
|
require 'action_cable/engine' if defined?(Rails)
|