Enforce frozen string in Rubocop

This commit is contained in:
Kir Shatrov 2017-06-22 22:59:18 -04:00
parent 5fe2a4f929
commit cfade1ec7e
2230 changed files with 2245 additions and 13 deletions

View File

@ -97,6 +97,10 @@ Style/StringLiterals:
Enabled: true
EnforcedStyle: double_quotes
Style/FrozenStringLiteralComment:
Enabled: true
EnforcedStyle: always
# Detect hard tabs, no hard tabs.
Layout/Tab:
Enabled: true

View File

@ -1,3 +1,4 @@
# frozen_string_literal: true
source "https://rubygems.org"
git_source(:github) do |repo_name|

View File

@ -1,3 +1,4 @@
# frozen_string_literal: true
require "net/http"
$:.unshift __dir__

View File

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

View File

@ -1,3 +1,4 @@
# 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,4 @@
# frozen_string_literal: true
#--
# Copyright (c) 2015-2017 Basecamp, LLC
#

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,3 +1,4 @@
# 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,4 @@
# frozen_string_literal: true
module ActionCable
module Connection
extend ActiveSupport::Autoload

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,3 +1,4 @@
# 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,4 @@
# frozen_string_literal: true
require "thread"
module ActionCable

View File

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

View File

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

View File

@ -1,3 +1,4 @@
# 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,4 @@
# frozen_string_literal: true
require "websocket/driver"
module ActionCable

View File

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

View File

@ -1,3 +1,4 @@
# 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,4 @@
# frozen_string_literal: true
module ActionCable
module Helpers
module ActionCableHelper

View File

@ -1,3 +1,4 @@
# 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,4 @@
# frozen_string_literal: true
module ActionCable
module Server
extend ActiveSupport::Autoload

View File

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

View File

@ -1,3 +1,4 @@
# 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,4 @@
# 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,4 @@
# 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,4 @@
# 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,4 @@
# frozen_string_literal: true
module ActionCable
module Server
class Worker

View File

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

View File

@ -1,3 +1,4 @@
# frozen_string_literal: true
require "action_cable/subscription_adapter/inline"
module ActionCable

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,3 +1,4 @@
# frozen_string_literal: true
require "rake/testtask"
desc "Default Task"

View File

@ -1,3 +1,4 @@
# 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,4 @@
# frozen_string_literal: true
#--
# Copyright (c) 2004-2017 David Heinemeier Hansson
#

View File

@ -1,3 +1,4 @@
# frozen_string_literal: true
require "mail"
require "action_mailer/collector"
require "active_support/core_ext/string/inflections"

View File

@ -1,3 +1,4 @@
# frozen_string_literal: true
require "abstract_controller/collector"
require "active_support/core_ext/hash/reverse_merge"
require "active_support/core_ext/array/extract_options"

View File

@ -1,3 +1,4 @@
# frozen_string_literal: true
require "active_job"
module ActionMailer

View File

@ -1,3 +1,4 @@
# frozen_string_literal: true
require "tmpdir"
module ActionMailer

View File

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

View File

@ -1,3 +1,4 @@
# frozen_string_literal: true
require "base64"
module ActionMailer

View File

@ -1,3 +1,4 @@
# frozen_string_literal: true
require "active_support/log_subscriber"
module ActionMailer

View File

@ -1,3 +1,4 @@
# frozen_string_literal: true
module ActionMailer
# Provides helper methods for ActionMailer::Base that can be used for easily
# formatting messages, accessing mailer or message instances, and the

View File

@ -1,3 +1,4 @@
# frozen_string_literal: true
require "delegate"
module ActionMailer

View File

@ -1,3 +1,4 @@
# frozen_string_literal: true
module ActionMailer
# Provides the option to parameterize mailers in order to share instance variable
# setup, processing, and common headers.

View File

@ -1,3 +1,4 @@
# frozen_string_literal: true
require "active_support/descendants_tracker"
module ActionMailer

View File

@ -1,3 +1,4 @@
# frozen_string_literal: true
require "active_job/railtie"
require "action_mailer"
require "rails"

View File

@ -1,3 +1,4 @@
# frozen_string_literal: true
module ActionMailer #:nodoc:
# Provides `rescue_from` for mailers. Wraps mailer action processing,
# mail job processing, and mail delivery.

Some files were not shown because too many files have changed in this diff Show More