Adding frozen_string_literal pragma to Railties.

This commit is contained in:
Pat Allan 2017-08-14 19:08:09 +02:00
parent d435c92721
commit acea68de02
311 changed files with 618 additions and 1 deletions

View File

@ -83,7 +83,6 @@ Style/FrozenStringLiteralComment:
Enabled: true
EnforcedStyle: always
Exclude:
- 'railties/**/*'
- 'actionview/test/**/*.builder'
- 'actionview/test/**/*.ruby'
- 'actionpack/test/**/*.builder'

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "rake/testtask"
task default: :test

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,4 +1,5 @@
#!/usr/bin/env ruby
# frozen_string_literal: true
git_path = File.expand_path("../../.git", __dir__)

View File

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

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
require_relative "rails/ruby_version_check"
require "pathname"

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "rails"
%w(

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "sdoc"
class RDoc::Generator::API < RDoc::Generator::SDoc # :nodoc:

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "rdoc/task"
require_relative "generator"

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "pathname"
require_relative "version"

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "rails/generators"
require "rails/generators/rails/app/app_generator"

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "yaml"
require "active_support/core_ext/hash/keys"
require "active_support/core_ext/object/blank"

View File

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

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "active_support/core_ext/kernel/reporting"
require "active_support/file_update_checker"
require_relative "../engine/configuration"

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module Rails
class Application
class DefaultMiddlewareStack

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module Rails
class Application
module Finisher

View File

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

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
class Rails::ApplicationController < ActionController::Base # :nodoc:
self.view_paths = File.expand_path("templates", __dir__)
layout "application"

View File

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

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
require_relative "app_loader"
# If we are inside a Rails application this method performs an exec and thus

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
require_relative "code_statistics_calculator"
require "active_support/core_ext/enumerable"

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
class CodeStatisticsCalculator #:nodoc:
attr_reader :lines, :code_lines, :classes, :methods

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "active_support"
require "active_support/dependencies/autoload"
require "active_support/core_ext/enumerable"

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module Rails
module Command
module Actions

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "thor"
require "erb"

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "active_support"
module Rails

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "active_support"
module Rails

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
require_relative "command"
aliases = {

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
require_relative "../../generators"
require_relative "../../generators/rails/app/app_generator"

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "irb"
require "irb/completion"

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
require_relative "../../command/environment_argument"
module Rails

View File

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

View File

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

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module Rails
module Command
class HelpCommand < Base # :nodoc:

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module Rails
module Command
class NewCommand < Base # :nodoc:

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module Rails
module Command
class PluginCommand < Base # :nodoc:

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module Rails
module Command
class RakeCommand < Base # :nodoc:

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module Rails
module Command
class RunnerCommand < Base # :nodoc:

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "active_support"
require_relative "../../secrets"

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "fileutils"
require "optparse"
require "action_dispatch"

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
require_relative "../../command"
require_relative "../../test_unit/runner"

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module Rails
module Command
class VersionCommand < Base # :nodoc:

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "active_support/ordered_options"
require "active_support/core_ext/object"
require_relative "paths"

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "active_support/all"
require "action_controller"

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module Rails
module ConsoleMethods
# Gets the helper methods available to the controller.

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "fileutils"
module Rails

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
require_relative "railtie"
require_relative "engine/railties"
require "active_support/core_ext/module/delegation"

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
unless defined?(APP_PATH)
if File.exist?(File.expand_path("test/dummy/config/application.rb", ENGINE_ROOT))
APP_PATH = File.expand_path("test/dummy/config/application", ENGINE_ROOT)

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
require_relative "../railtie/configuration"
module Rails

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module Rails
class Engine < Railtie
class Railties

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
require_relative "../generators"
require_relative "../generators/rails/plugin/plugin_generator"

View File

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

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
activesupport_path = File.expand_path("../../../activesupport/lib", __dir__)
$:.unshift(activesupport_path) if File.directory?(activesupport_path) && !$:.include?(activesupport_path)

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module Rails
module Generators
module Actions

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "fileutils"
require "thor/actions"

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module Rails
module Generators
# ActiveModel is a class to be implemented by each ORM to allow Rails to

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "fileutils"
require "digest/md5"
require "active_support/core_ext/string/strip"

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
begin
require "thor/group"
rescue LoadError

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
require_relative "../../named_base"
module Css # :nodoc:

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
require_relative "../../named_base"
module Css # :nodoc:

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
require_relative "named_base"
module Erb # :nodoc:

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
require_relative "../../erb"
module Erb # :nodoc:

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
require_relative "../../erb"
module Erb # :nodoc:

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
require_relative "../../erb"
require_relative "../../resource_helpers"

View File

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

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
require_relative "../../named_base"
module Js # :nodoc:

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "active_support/concern"
require_relative "actions/create_migration"

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
require_relative "active_model"
module Rails

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "active_support/core_ext/module/introspection"
require_relative "base"
require_relative "generated_attribute"

View File

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

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
# Add your own tasks in files placed in lib/tasks ending in .rake,
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module ApplicationCable
class Channel < ActionCable::Channel::Base
end

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module ApplicationCable
class Connection < ActionCable::Connection::Base
end

View File

@ -1,2 +1,4 @@
# frozen_string_literal: true
module ApplicationHelper
end

View File

@ -1,2 +1,4 @@
# frozen_string_literal: true
class ApplicationJob < ActiveJob::Base
end

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
class ApplicationMailer < ActionMailer::Base
default from: 'from@example.com'
layout 'mailer'

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
class ApplicationRecord < ActiveRecord::Base
self.abstract_class = true
end

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
require_relative 'boot'
<% if include_all_railties? -%>

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__)
require 'bundler/setup' # Set up gems listed in the Gemfile.

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
# Load the Rails application.
require_relative 'application'

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
# Be sure to restart your server when you modify this file.
# ActiveSupport::Reloader.to_prepare do

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
# Be sure to restart your server when you modify this file.
# You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
# Be sure to restart your server when you modify this file.
# Specify a serializer for the signed and encrypted cookie jars.

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
# Be sure to restart your server when you modify this file.
# Avoid CORS issues when API is called from the frontend app.

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
# Be sure to restart your server when you modify this file.
# Configure sensitive parameters which will be filtered from the log file.

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
# Be sure to restart your server when you modify this file.
# Add new inflection rules using the following format. Inflections

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
# Be sure to restart your server when you modify this file.
# Add new mime types for use in respond_to blocks:

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
# Puma can serve each request in a thread from an internal thread pool.
# The `threads` method setting takes two numbers: a minimum and maximum.
# Any libraries that use thread pools should be configured to match

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
Rails.application.routes.draw do
# For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html
end

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
%w[
.ruby-version
.rbenv-vars

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "test_helper"
class ApplicationSystemTestCase < ActionDispatch::SystemTestCase

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
require_relative '../config/environment'
require 'rails/test_help'

View File

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

View File

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

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
<% if namespaced? -%>
require_dependency "<%= namespaced_path %>/application_controller"

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
require_relative "../../base"
require_relative "../../../secrets"

View File

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

View File

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

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
<% module_namespacing do -%>
module <%= class_name %>Helper
end

View File

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

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