Use frozen string literal in actionpack/
This commit is contained in:
parent
904f1a8747
commit
dfcc766163
@ -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:
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require "rake/testtask"
|
||||
|
||||
test_files = Dir.glob("test/**/*_test.rb")
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
version = File.read(File.expand_path("../RAILS_VERSION", __dir__)).strip
|
||||
|
||||
Gem::Specification.new do |s|
|
||||
|
@ -1,4 +1,5 @@
|
||||
#!/usr/bin/env ruby
|
||||
# frozen_string_literal: true
|
||||
|
||||
COMPONENT_ROOT = File.expand_path("..", __dir__)
|
||||
require_relative "../../tools/test"
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require "action_pack"
|
||||
require "active_support/rails"
|
||||
require "active_support/i18n"
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module AbstractController
|
||||
module AssetPaths #:nodoc:
|
||||
extend ActiveSupport::Concern
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require_relative "error"
|
||||
require "active_support/configurable"
|
||||
require "active_support/descendants_tracker"
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module AbstractController
|
||||
module Caching
|
||||
extend ActiveSupport::Concern
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module AbstractController
|
||||
module Caching
|
||||
# Fragment caching is used for caching various blocks within
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module AbstractController
|
||||
# = Abstract Controller Callbacks
|
||||
#
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require "action_dispatch/http/mime_type"
|
||||
|
||||
module AbstractController
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module AbstractController
|
||||
class Error < StandardError #:nodoc:
|
||||
end
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require "active_support/dependencies"
|
||||
|
||||
module AbstractController
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require "active_support/benchmarkable"
|
||||
|
||||
module AbstractController
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module AbstractController
|
||||
module Railties
|
||||
module RoutesHelpers
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require_relative "error"
|
||||
require "action_view"
|
||||
require "action_view/view_paths"
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module AbstractController
|
||||
module Translation
|
||||
# Delegates to <tt>I18n.translate</tt>. Also aliased as <tt>t</tt>.
|
||||
|
@ -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
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require "active_support/rails"
|
||||
require "abstract_controller"
|
||||
require "action_dispatch"
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require "action_view"
|
||||
require "action_controller"
|
||||
require_relative "log_subscriber"
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module ActionController
|
||||
module ApiRendering
|
||||
extend ActiveSupport::Concern
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require "action_view"
|
||||
require_relative "log_subscriber"
|
||||
require_relative "metal/params_wrapper"
|
||||
|
@ -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.
|
||||
|
@ -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
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module ActionController
|
||||
class LogSubscriber < ActiveSupport::LogSubscriber
|
||||
INTERNAL_PARAMS = %w(controller action format _method only_path)
|
||||
|
@ -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"
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module ActionController
|
||||
module BasicImplicitRender # :nodoc:
|
||||
def send_action(method, *args)
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require "active_support/core_ext/hash/keys"
|
||||
|
||||
module ActionController
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module ActionController #:nodoc:
|
||||
module Cookies
|
||||
extend ActiveSupport::Concern
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require_relative "exceptions"
|
||||
|
||||
module ActionController #:nodoc:
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module ActionController
|
||||
class ActionControllerError < StandardError #:nodoc:
|
||||
end
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module ActionController #:nodoc:
|
||||
module Flash
|
||||
extend ActiveSupport::Concern
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require "active_support/core_ext/hash/except"
|
||||
require "active_support/core_ext/hash/slice"
|
||||
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module ActionController
|
||||
module Head
|
||||
# Returns a response that has no content (merely headers). The options
|
||||
|
@ -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
|
||||
|
@ -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+.
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require "benchmark"
|
||||
require "abstract_controller/logger"
|
||||
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require "action_dispatch/http/response"
|
||||
require "delegate"
|
||||
require "active_support/json"
|
||||
@ -295,7 +297,7 @@ def log_error(exception)
|
||||
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"
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require "abstract_controller/collector"
|
||||
|
||||
module ActionController #:nodoc:
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module ActionController
|
||||
# Specify binary encoding for parameters for a given action.
|
||||
module ParameterEncoding
|
||||
|
@ -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"
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module ActionController
|
||||
module Redirecting
|
||||
extend ActiveSupport::Concern
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require "set"
|
||||
|
||||
module ActionController
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require "active_support/core_ext/string/filters"
|
||||
|
||||
module ActionController
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require "rack/session/abstract/id"
|
||||
require_relative "exceptions"
|
||||
require "active_support/security_utils"
|
||||
|
@ -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
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require "rack/chunked"
|
||||
|
||||
module ActionController #:nodoc:
|
||||
|
@ -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"
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module ActionController
|
||||
module Testing
|
||||
extend ActiveSupport::Concern
|
||||
|
@ -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.
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require "rails"
|
||||
require "action_controller"
|
||||
require "action_dispatch/railtie"
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module ActionController
|
||||
module Railties
|
||||
module Helpers
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require "active_support/core_ext/hash/keys"
|
||||
|
||||
module ActionController
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module ActionController
|
||||
module TemplateAssertions
|
||||
def assert_template(options = {}, message = nil)
|
||||
|
@ -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"
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
#--
|
||||
# Copyright (c) 2004-2017 David Heinemeier Hansson
|
||||
#
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module ActionDispatch
|
||||
module Http
|
||||
module Cache
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require_relative "parameter_filter"
|
||||
|
||||
module ActionDispatch
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module ActionDispatch
|
||||
module Http
|
||||
module FilterRedirect
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module ActionDispatch
|
||||
module Http
|
||||
# Provides access to the request's HTTP headers from the environment.
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require "active_support/core_ext/module/attribute_accessors"
|
||||
|
||||
module ActionDispatch
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
# -*- frozen-string-literal: true -*-
|
||||
|
||||
require "singleton"
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
# Build list of Mime types for HTTP responses
|
||||
# http://www.iana.org/assignments/media-types/
|
||||
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require "active_support/core_ext/object/duplicable"
|
||||
|
||||
module ActionDispatch
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module ActionDispatch
|
||||
module Http
|
||||
module Parameters
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require "rack/cache"
|
||||
require "rack/cache/context"
|
||||
require "active_support/cache"
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require "active_support/core_ext/module/attribute_accessors"
|
||||
require_relative "filter_redirect"
|
||||
require_relative "cache"
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module ActionDispatch
|
||||
module Http
|
||||
# Models uploaded files.
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require_relative "journey/router"
|
||||
require_relative "journey/gtg/builder"
|
||||
require_relative "journey/gtg/simulator"
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require_relative "transition_table"
|
||||
|
||||
module ActionDispatch
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require "strscan"
|
||||
|
||||
module ActionDispatch
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require_relative "../nfa/dot"
|
||||
|
||||
module ActionDispatch
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require_relative "transition_table"
|
||||
require_relative "../gtg/transition_table"
|
||||
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module ActionDispatch
|
||||
module Journey # :nodoc:
|
||||
module NFA # :nodoc:
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require "strscan"
|
||||
|
||||
module ActionDispatch
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require_relative "dot"
|
||||
|
||||
module ActionDispatch
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require_relative "../visitors"
|
||||
|
||||
module ActionDispatch
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require_relative "scanner"
|
||||
require_relative "nodes/node"
|
||||
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module ActionDispatch
|
||||
module Journey # :nodoc:
|
||||
module Path # :nodoc:
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module ActionDispatch
|
||||
# :stopdoc:
|
||||
module Journey
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require_relative "router/utils"
|
||||
require_relative "routes"
|
||||
require_relative "formatter"
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module ActionDispatch
|
||||
module Journey # :nodoc:
|
||||
class Router # :nodoc:
|
||||
@ -13,7 +15,7 @@ class Utils # :nodoc:
|
||||
# normalize_path("") # => "/"
|
||||
# normalize_path("/%ab") # => "/%AB"
|
||||
def self.normalize_path(path)
|
||||
path ||= ''
|
||||
path ||= ""
|
||||
encoding = path.encoding
|
||||
path = "/#{path}".dup
|
||||
path.squeeze!("/".freeze)
|
||||
|
@ -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
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module ActionDispatch
|
||||
# Provides callbacks to be executed before and after dispatching the request.
|
||||
class Callbacks
|
||||
|
@ -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"
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module ActionDispatch
|
||||
# This middleware can be used to diagnose deadlocks in the autoload interlock.
|
||||
#
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require "active_support/core_ext/module/attribute_accessors"
|
||||
require "rack/utils"
|
||||
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require "rack/body_proxy"
|
||||
|
||||
module ActionDispatch
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require "active_support/core_ext/hash/keys"
|
||||
|
||||
module ActionDispatch
|
||||
|
@ -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`
|
||||
|
@ -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.
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require "ipaddr"
|
||||
|
||||
module ActionDispatch
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require "securerandom"
|
||||
require "active_support/core_ext/string/access"
|
||||
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require "rack/utils"
|
||||
require "rack/request"
|
||||
require "rack/session/abstract/id"
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require_relative "abstract_store"
|
||||
|
||||
module ActionDispatch
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require "active_support/core_ext/hash/keys"
|
||||
require_relative "abstract_store"
|
||||
require "rack/session/cookie"
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require_relative "abstract_store"
|
||||
begin
|
||||
require "rack/session/dalli"
|
||||
|
@ -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
Loading…
Reference in New Issue
Block a user