Merge pull request #29933 from kirs/frozen-actionpack

Use frozen string literal in actionpack/
This commit is contained in:
Matthew Draper 2017-07-29 15:38:02 -04:00 committed by GitHub
commit b5db730769
281 changed files with 563 additions and 3 deletions

View File

@ -94,9 +94,12 @@ Style/FrozenStringLiteralComment:
- 'activerecord/**/*'
- 'actionmailer/**/*'
- 'actionview/**/*'
- 'actionpack/**/*'
Exclude:
- 'actionview/test/**/*.builder'
- 'actionview/test/**/*.ruby'
- 'actionpack/test/**/*.builder'
- 'actionpack/test/**/*.ruby'
# Use `foo {}` not `foo{}`.
Layout/SpaceBeforeBlockBraces:

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "rake/testtask"
test_files = Dir.glob("test/**/*_test.rb")

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
require "action_pack"
require "active_support/rails"
require "active_support/i18n"

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module AbstractController
module AssetPaths #:nodoc:
extend ActiveSupport::Concern

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
require_relative "error"
require "active_support/configurable"
require "active_support/descendants_tracker"

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module AbstractController
module Caching
extend ActiveSupport::Concern

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module AbstractController
module Caching
# Fragment caching is used for caching various blocks within

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module AbstractController
# = Abstract Controller Callbacks
#

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "action_dispatch/http/mime_type"
module AbstractController

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module AbstractController
class Error < StandardError #:nodoc:
end

View File

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

View File

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

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module AbstractController
module Railties
module RoutesHelpers

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
require_relative "error"
require "action_view"
require "action_view/view_paths"

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module AbstractController
module Translation
# Delegates to <tt>I18n.translate</tt>. Also aliased as <tt>t</tt>.

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module AbstractController
# Includes +url_for+ into the host class (e.g. an abstract controller or mailer). The class
# has to provide a +RouteSet+ by implementing the <tt>_routes</tt> methods. Otherwise, an

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "active_support/rails"
require "abstract_controller"
require "action_dispatch"

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "action_view"
require "action_controller"
require_relative "log_subscriber"

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module ActionController
module ApiRendering
extend ActiveSupport::Concern

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "action_view"
require_relative "log_subscriber"
require_relative "metal/params_wrapper"

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module ActionController
# \Caching is a cheap way of speeding up slow applications by keeping the result of
# calculations, renderings, and database calls around for subsequent requests.

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module ActionController
# Override the default form builder for all views rendered by this
# controller and any of its descendants. Accepts a subclass of

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module ActionController
class LogSubscriber < ActiveSupport::LogSubscriber
INTERNAL_PARAMS = %w(controller action format _method only_path)

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "active_support/core_ext/array/extract_options"
require "action_dispatch/middleware/stack"
require "action_dispatch/http/request"

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module ActionController
module BasicImplicitRender # :nodoc:
def send_action(method, *args)

View File

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

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module ActionController #:nodoc:
module Cookies
extend ActiveSupport::Concern

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
require_relative "exceptions"
module ActionController #:nodoc:

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module ActionController
# When you're using the flash, it's generally used as a conditional on the view.
# This means the content of the view depends on the flash. Which in turn means

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module ActionController
# When our views change, they should bubble up into HTTP cache freshness
# and bust browser caches. So the template digest for the current action

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module ActionController
class ActionControllerError < StandardError #:nodoc:
end

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module ActionController #:nodoc:
module Flash
extend ActiveSupport::Concern

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "active_support/core_ext/hash/except"
require "active_support/core_ext/hash/slice"

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module ActionController
module Head
# Returns a response that has no content (merely headers). The options

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module ActionController
# The \Rails framework provides a large number of helpers for working with assets, dates, forms,
# numbers and model objects, to name a few. These helpers are available to all templates

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module ActionController
# Handles implicit rendering for a controller action that does not
# explicitly respond with +render+, +respond_to+, +redirect+, or +head+.

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "benchmark"
require "abstract_controller/logger"

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "action_dispatch/http/response"
require "delegate"
require "active_support/json"
@ -295,7 +297,7 @@ module ActionController
return unless logger
logger.fatal do
message = "\n#{exception.class} (#{exception.message}):\n"
message = "\n#{exception.class} (#{exception.message}):\n".dup
message << exception.annoted_source_code.to_s if exception.respond_to?(:annoted_source_code)
message << " " << exception.backtrace.join("\n ")
"#{message}\n\n"

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "abstract_controller/collector"
module ActionController #:nodoc:

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module ActionController
# Specify binary encoding for parameters for a given action.
module ParameterEncoding

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "active_support/core_ext/hash/slice"
require "active_support/core_ext/hash/except"
require "active_support/core_ext/module/anonymous"

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module ActionController
module Redirecting
extend ActiveSupport::Concern

View File

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

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "active_support/core_ext/string/filters"
module ActionController

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "rack/session/abstract/id"
require_relative "exceptions"
require "active_support/security_utils"

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module ActionController #:nodoc:
# This module is responsible for providing `rescue_from` helpers
# to controllers and configuring when detailed exceptions must be

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "rack/chunked"
module ActionController #:nodoc:

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "active_support/core_ext/hash/indifferent_access"
require "active_support/core_ext/hash/transform_values"
require "active_support/core_ext/array/wrap"

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module ActionController
module Testing
extend ActiveSupport::Concern

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module ActionController
# Includes +url_for+ into the host class. The class has to provide a +RouteSet+ by implementing
# the <tt>_routes</tt> method. Otherwise, an exception will be raised.

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "rails"
require "action_controller"
require "action_dispatch/railtie"

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module ActionController
module Railties
module Helpers

View File

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

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module ActionController
module TemplateAssertions
def assert_template(options = {}, message = nil)

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "rack/session/abstract/id"
require "active_support/core_ext/hash/conversions"
require "active_support/core_ext/object/to_query"

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
#--
# Copyright (c) 2004-2017 David Heinemeier Hansson
#

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module ActionDispatch
module Http
module Cache

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
require_relative "parameter_filter"
module ActionDispatch

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module ActionDispatch
module Http
module FilterRedirect

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module ActionDispatch
module Http
# Provides access to the request's HTTP headers from the environment.

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "active_support/core_ext/module/attribute_accessors"
module ActionDispatch

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
# -*- frozen-string-literal: true -*-
require "singleton"

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
# Build list of Mime types for HTTP responses
# http://www.iana.org/assignments/media-types/

View File

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

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module ActionDispatch
module Http
module Parameters

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "rack/cache"
require "rack/cache/context"
require "active_support/cache"

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "active_support/core_ext/module/attribute_accessors"
require_relative "filter_redirect"
require_relative "cache"

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module ActionDispatch
module Http
# Models uploaded files.

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
require_relative "journey/router"
require_relative "journey/gtg/builder"
require_relative "journey/gtg/simulator"

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
require_relative "transition_table"
module ActionDispatch

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "strscan"
module ActionDispatch

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
require_relative "../nfa/dot"
module ActionDispatch

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
require_relative "transition_table"
require_relative "../gtg/transition_table"

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module ActionDispatch
module Journey # :nodoc:
module NFA # :nodoc:

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "strscan"
module ActionDispatch

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
require_relative "dot"
module ActionDispatch

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
require_relative "../visitors"
module ActionDispatch

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
require_relative "scanner"
require_relative "nodes/node"

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module ActionDispatch
module Journey # :nodoc:
module Path # :nodoc:

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module ActionDispatch
# :stopdoc:
module Journey

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
require_relative "router/utils"
require_relative "routes"
require_relative "formatter"

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module ActionDispatch
module Journey # :nodoc:
class Router # :nodoc:
@ -13,7 +15,7 @@ module ActionDispatch
# normalize_path("") # => "/"
# normalize_path("/%ab") # => "/%AB"
def self.normalize_path(path)
path ||= ''
path ||= ""
encoding = path.encoding
path = "/#{path}".dup
path.squeeze!("/".freeze)

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module ActionDispatch
module Journey # :nodoc:
# The Routing table. Contains all routes for a system. Routes can be

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module ActionDispatch
# Provides callbacks to be executed before and after dispatching the request.
class Callbacks

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "active_support/core_ext/hash/keys"
require "active_support/key_generator"
require "active_support/message_verifier"

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module ActionDispatch
# This middleware can be used to diagnose deadlocks in the autoload interlock.
#

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "active_support/core_ext/module/attribute_accessors"
require "rack/utils"

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "rack/body_proxy"
module ActionDispatch

View File

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

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module ActionDispatch
# When called, this middleware renders an error page. By default if an HTML
# response is expected it will render static error pages from the `/public`

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module ActionDispatch
# ActionDispatch::Reloader wraps the request with callbacks provided by ActiveSupport::Reloader
# callbacks, intended to assist with code reloading during development.

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "ipaddr"
module ActionDispatch

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "securerandom"
require "active_support/core_ext/string/access"

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "rack/utils"
require "rack/request"
require "rack/session/abstract/id"

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
require_relative "abstract_store"
module ActionDispatch

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "active_support/core_ext/hash/keys"
require_relative "abstract_store"
require "rack/session/cookie"

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
require_relative "abstract_store"
begin
require "rack/session/dalli"

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
require_relative "../http/request"
require_relative "exception_wrapper"

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