1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Use frozen string literal in actioncable/

This commit is contained in:
Kir Shatrov 2017-07-16 20:10:15 +03:00
parent 68191d0f6e
commit 385825fb70
81 changed files with 159 additions and 1 deletions

View file

@ -89,6 +89,7 @@ Style/FrozenStringLiteralComment:
Include:
- 'activesupport/**/*'
- 'activemodel/**/*'
- 'actioncable/**/*'
- 'activejob/**/*'
- 'activerecord/**/*'
- 'actionmailer/**/*'

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "rake/testtask"
require "pathname"
require "open3"

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
version = File.read(File.expand_path("../RAILS_VERSION", __dir__)).strip
Gem::Specification.new do |s|

View file

@ -1,4 +1,5 @@
#!/usr/bin/env ruby
# frozen_string_literal: true
COMPONENT_ROOT = File.expand_path("..", __dir__)
require_relative "../../tools/test"

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
#--
# Copyright (c) 2015-2017 Basecamp, LLC
#

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
module ActionCable
module Channel
extend ActiveSupport::Autoload

View file

@ -270,7 +270,7 @@ module ActionCable
end
def action_signature(action, data)
"#{self.class.name}##{action}".tap do |signature|
"#{self.class.name}##{action}".dup.tap do |signature|
if (arguments = data.except("action")).any?
signature << "(#{arguments.inspect})"
end

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "active_support/core_ext/object/to_param"
module ActionCable

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "active_support/callbacks"
module ActionCable

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
module ActionCable
module Channel
module Naming

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
module ActionCable
module Channel
module PeriodicTimers

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
module ActionCable
module Channel
# Streams allow channels to route broadcastings to the subscriber. A broadcasting is, as discussed elsewhere, a pubsub queue where any data

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
module ActionCable
module Connection
extend ActiveSupport::Autoload

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
module ActionCable
module Connection
module Authorization

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "action_dispatch"
module ActionCable

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "websocket/driver"
module ActionCable

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "set"
module ActionCable

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
module ActionCable
module Connection
# Makes it possible for the RemoteConnection to disconnect a specific connection.

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
module ActionCable
module Connection
# Allows us to buffer messages received from the WebSocket before the Connection has been fully initialized, and is ready to receive them.

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "thread"
module ActionCable

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "nio"
require "thread"

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "active_support/core_ext/hash/indifferent_access"
module ActionCable

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
module ActionCable
module Connection
# Allows the use of per-connection tags against the server logger. This wouldn't work using the traditional

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "websocket/driver"
module ActionCable

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "rails"
require "action_cable"
require_relative "helpers/action_cable_helper"

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
module ActionCable
# Returns the version of the currently loaded Action Cable as a <tt>Gem::Version</tt>.
def self.gem_version

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
module ActionCable
module Helpers
module ActionCableHelper

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
module ActionCable
# If you need to disconnect a given connection, you can go through the
# RemoteConnections. You can find the connections you're looking for by

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
module ActionCable
module Server
extend ActiveSupport::Autoload

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "monitor"
module ActionCable

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
module ActionCable
module Server
# Broadcasting is how other parts of your application can send messages to a channel's subscribers. As explained in Channel, most of the time, these

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
module ActionCable
module Server
# An instance of this configuration object is available via ActionCable.server.config, which allows you to tweak Action Cable configuration

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
module ActionCable
module Server
# Collection class for all the connections that have been established on this specific server. Remember, usually you'll run many Action Cable servers, so

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "active_support/callbacks"
require "active_support/core_ext/module/attribute_accessors_per_thread"
require "concurrent"

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
module ActionCable
module Server
class Worker

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
module ActionCable
module SubscriptionAdapter
extend ActiveSupport::Autoload

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require_relative "inline"
module ActionCable

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
module ActionCable
module SubscriptionAdapter
class Base

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
module ActionCable
module SubscriptionAdapter
module ChannelPrefix # :nodoc:

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "thread"
gem "em-hiredis", "~> 0.3.0"

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
module ActionCable
module SubscriptionAdapter
class Inline < Base # :nodoc:

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
gem "pg", "~> 0.18"
require "pg"
require "thread"

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "thread"
gem "redis", "~> 3.0"

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
module ActionCable
module SubscriptionAdapter
class SubscriberMap

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require_relative "gem_version"
module ActionCable

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
module Rails
module Generators
class ChannelGenerator < NamedBase

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "test_helper"
require "stubs/test_connection"
require "stubs/room"

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "test_helper"
require "stubs/test_connection"
require "stubs/room"

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "test_helper"
class ActionCable::Channel::NamingTest < ActiveSupport::TestCase

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "test_helper"
require "stubs/test_connection"
require "stubs/room"

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "test_helper"
require "stubs/test_connection"
require "stubs/room"

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "test_helper"
require "stubs/test_connection"
require "stubs/room"

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "test_helper"
require "concurrent"

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "test_helper"
require "stubs/test_server"

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "test_helper"
require "stubs/test_server"
require "active_support/core_ext/object/json"

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "test_helper"
require "stubs/test_server"

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "test_helper"
require "stubs/test_server"

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "test_helper"
require "stubs/test_server"
require "stubs/user"

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "test_helper"
require "stubs/test_server"
require "stubs/user"

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "test_helper"
require "stubs/test_server"

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "test_helper"
require "stubs/test_server"

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "test_helper"
class ActionCable::Connection::SubscriptionsTest < ActionCable::TestCase

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "test_helper"
require "stubs/test_server"
require "active_support/core_ext/hash/indifferent_access"

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "test_helper"
require "stubs/test_server"

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
class GlobalID
attr_reader :uri
delegate :to_param, :to_s, to: :uri

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
class Room
attr_reader :id, :name

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
class SuccessAdapter < ActionCable::SubscriptionAdapter::Base
def broadcast(channel, payload)
end

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "stubs/user"
class TestConnection

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "ostruct"
class TestServer

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
class User
attr_reader :name

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "test_helper"
require_relative "common"

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "test_helper"
require "stubs/test_server"

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "test_helper"
class ActionCable::Server::WithIndependentConfig < ActionCable::Server::Base

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "test_helper"
require "concurrent"

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "test_helper"
require_relative "common"
require_relative "channel_prefix"

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "test_helper"
require_relative "common"

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "test_helper"
require_relative "common"

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "test_helper"
require_relative "common"
require_relative "channel_prefix"

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "test_helper"
class SubscriberMapTest < ActionCable::TestCase

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "action_cable"
require "active_support/testing/autorun"

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "test_helper"
class WorkerTest < ActiveSupport::TestCase