diff options
Diffstat (limited to 'railties/lib/rails')
73 files changed, 111 insertions, 111 deletions
diff --git a/railties/lib/rails/api/task.rb b/railties/lib/rails/api/task.rb index 184f5b14f1..e7f0557584 100644 --- a/railties/lib/rails/api/task.rb +++ b/railties/lib/rails/api/task.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require "rdoc/task" -require_relative "generator" +require "rails/api/generator" module Rails module API diff --git a/railties/lib/rails/app_loader.rb b/railties/lib/rails/app_loader.rb index 3e9b3bd4bb..20eb75d95c 100644 --- a/railties/lib/rails/app_loader.rb +++ b/railties/lib/rails/app_loader.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require "pathname" -require_relative "version" +require "rails/version" module Rails module AppLoader # :nodoc: @@ -56,7 +56,7 @@ EOS $stderr.puts(BUNDLER_WARNING) Object.const_set(:APP_PATH, File.expand_path("config/application", Dir.pwd)) require File.expand_path("../boot", APP_PATH) - require_relative "commands" + require "rails/commands" break end end diff --git a/railties/lib/rails/application.rb b/railties/lib/rails/application.rb index 4fd20185b1..ade8cb6a48 100644 --- a/railties/lib/rails/application.rb +++ b/railties/lib/rails/application.rb @@ -7,8 +7,8 @@ require "active_support/key_generator" require "active_support/message_verifier" require "active_support/encrypted_configuration" require "active_support/deprecation" -require_relative "engine" -require_relative "secrets" +require "rails/engine" +require "rails/secrets" module Rails # An Engine with the responsibility of coordinating the whole boot process. @@ -474,7 +474,7 @@ module Rails def run_tasks_blocks(app) #:nodoc: railties.each { |r| r.run_tasks_blocks(app) } super - require_relative "tasks" + require "rails/tasks" task :environment do ActiveSupport.on_load(:before_initialize) { config.eager_load = false } diff --git a/railties/lib/rails/application/bootstrap.rb b/railties/lib/rails/application/bootstrap.rb index c24d4573a9..e3c0759f95 100644 --- a/railties/lib/rails/application/bootstrap.rb +++ b/railties/lib/rails/application/bootstrap.rb @@ -4,7 +4,7 @@ require "fileutils" require "active_support/notifications" require "active_support/dependencies" require "active_support/descendants_tracker" -require_relative "../secrets" +require "rails/secrets" module Rails class Application diff --git a/railties/lib/rails/application/configuration.rb b/railties/lib/rails/application/configuration.rb index b65289177f..290ec13878 100644 --- a/railties/lib/rails/application/configuration.rb +++ b/railties/lib/rails/application/configuration.rb @@ -2,8 +2,8 @@ require "active_support/core_ext/kernel/reporting" require "active_support/file_update_checker" -require_relative "../engine/configuration" -require_relative "../source_annotation_extractor" +require "rails/engine/configuration" +require "rails/source_annotation_extractor" module Rails class Application diff --git a/railties/lib/rails/cli.rb b/railties/lib/rails/cli.rb index 50a2ed30cf..e56e604fdc 100644 --- a/railties/lib/rails/cli.rb +++ b/railties/lib/rails/cli.rb @@ -1,15 +1,15 @@ # frozen_string_literal: true -require_relative "app_loader" +require "rails/app_loader" # If we are inside a Rails application this method performs an exec and thus # the rest of this script is not run. Rails::AppLoader.exec_app -require_relative "ruby_version_check" +require "rails/ruby_version_check" Signal.trap("INT") { puts; exit(1) } -require_relative "command" +require "rails/command" if ARGV.first == "plugin" ARGV.shift diff --git a/railties/lib/rails/code_statistics.rb b/railties/lib/rails/code_statistics.rb index 7ceb86198f..9c447c366f 100644 --- a/railties/lib/rails/code_statistics.rb +++ b/railties/lib/rails/code_statistics.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require_relative "code_statistics_calculator" +require "rails/code_statistics_calculator" require "active_support/core_ext/enumerable" class CodeStatistics #:nodoc: diff --git a/railties/lib/rails/command/base.rb b/railties/lib/rails/command/base.rb index 8df4f98d3e..fa462ef7e9 100644 --- a/railties/lib/rails/command/base.rb +++ b/railties/lib/rails/command/base.rb @@ -6,7 +6,7 @@ require "erb" require "active_support/core_ext/string/filters" require "active_support/core_ext/string/inflections" -require_relative "actions" +require "rails/command/actions" module Rails module Command diff --git a/railties/lib/rails/commands.rb b/railties/lib/rails/commands.rb index 1aea1e1a96..77961a0292 100644 --- a/railties/lib/rails/commands.rb +++ b/railties/lib/rails/commands.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require_relative "command" +require "rails/command" aliases = { "g" => "generate", diff --git a/railties/lib/rails/commands/application/application_command.rb b/railties/lib/rails/commands/application/application_command.rb index 13d47a63bc..f77553b830 100644 --- a/railties/lib/rails/commands/application/application_command.rb +++ b/railties/lib/rails/commands/application/application_command.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true -require_relative "../../generators" -require_relative "../../generators/rails/app/app_generator" +require "rails/generators" +require "rails/generators/rails/app/app_generator" module Rails module Generators diff --git a/railties/lib/rails/commands/console/console_command.rb b/railties/lib/rails/commands/console/console_command.rb index 5dc695c240..e35faa5b01 100644 --- a/railties/lib/rails/commands/console/console_command.rb +++ b/railties/lib/rails/commands/console/console_command.rb @@ -3,7 +3,7 @@ require "irb" require "irb/completion" -require_relative "../../command/environment_argument" +require "rails/command/environment_argument" module Rails class Console diff --git a/railties/lib/rails/commands/credentials/credentials_command.rb b/railties/lib/rails/commands/credentials/credentials_command.rb index 88fb032d84..1ef7c1f343 100644 --- a/railties/lib/rails/commands/credentials/credentials_command.rb +++ b/railties/lib/rails/commands/credentials/credentials_command.rb @@ -67,15 +67,15 @@ module Rails def master_key_generator - require_relative "../../generators" - require_relative "../../generators/rails/master_key/master_key_generator" + require "rails/generators" + require "rails/generators/rails/master_key/master_key_generator" Rails::Generators::MasterKeyGenerator.new end def credentials_generator - require_relative "../../generators" - require_relative "../../generators/rails/credentials/credentials_generator" + require "rails/generators" + require "rails/generators/rails/credentials/credentials_generator" Rails::Generators::CredentialsGenerator.new end diff --git a/railties/lib/rails/commands/dbconsole/dbconsole_command.rb b/railties/lib/rails/commands/dbconsole/dbconsole_command.rb index 5234969743..8df548b5de 100644 --- a/railties/lib/rails/commands/dbconsole/dbconsole_command.rb +++ b/railties/lib/rails/commands/dbconsole/dbconsole_command.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require_relative "../../command/environment_argument" +require "rails/command/environment_argument" module Rails class DBConsole diff --git a/railties/lib/rails/commands/destroy/destroy_command.rb b/railties/lib/rails/commands/destroy/destroy_command.rb index 686193ddb9..dd432d28fd 100644 --- a/railties/lib/rails/commands/destroy/destroy_command.rb +++ b/railties/lib/rails/commands/destroy/destroy_command.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require_relative "../../generators" +require "rails/generators" module Rails module Command diff --git a/railties/lib/rails/commands/generate/generate_command.rb b/railties/lib/rails/commands/generate/generate_command.rb index 73f627637d..93d7a0ce3a 100644 --- a/railties/lib/rails/commands/generate/generate_command.rb +++ b/railties/lib/rails/commands/generate/generate_command.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require_relative "../../generators" +require "rails/generators" module Rails module Command diff --git a/railties/lib/rails/commands/plugin/plugin_command.rb b/railties/lib/rails/commands/plugin/plugin_command.rb index 5d3dfadf84..2b192abf9b 100644 --- a/railties/lib/rails/commands/plugin/plugin_command.rb +++ b/railties/lib/rails/commands/plugin/plugin_command.rb @@ -36,8 +36,8 @@ module Rails private def run_plugin_generator(plugin_args) - require_relative "../../generators" - require_relative "../../generators/rails/plugin/plugin_generator" + require "rails/generators" + require "rails/generators/rails/plugin/plugin_generator" Rails::Generators::PluginGenerator.start plugin_args end end diff --git a/railties/lib/rails/commands/secrets/secrets_command.rb b/railties/lib/rails/commands/secrets/secrets_command.rb index d93c4de74e..c91139e33b 100644 --- a/railties/lib/rails/commands/secrets/secrets_command.rb +++ b/railties/lib/rails/commands/secrets/secrets_command.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require "active_support" -require_relative "../../secrets" +require "rails/secrets" module Rails module Command @@ -56,8 +56,8 @@ module Rails private def generator - require_relative "../../generators" - require_relative "../../generators/rails/encrypted_secrets/encrypted_secrets_generator" + require "rails/generators" + require "rails/generators/rails/encrypted_secrets/encrypted_secrets_generator" Rails::Generators::EncryptedSecretsGenerator end diff --git a/railties/lib/rails/commands/server/server_command.rb b/railties/lib/rails/commands/server/server_command.rb index 5b5037d3de..703ec59087 100644 --- a/railties/lib/rails/commands/server/server_command.rb +++ b/railties/lib/rails/commands/server/server_command.rb @@ -6,7 +6,7 @@ require "action_dispatch" require "rails" require "active_support/deprecation" require "active_support/core_ext/string/filters" -require_relative "../../dev_caching" +require "rails/dev_caching" module Rails class Server < ::Rack::Server diff --git a/railties/lib/rails/commands/test/test_command.rb b/railties/lib/rails/commands/test/test_command.rb index a2216553ca..00ea9ac4a6 100644 --- a/railties/lib/rails/commands/test/test_command.rb +++ b/railties/lib/rails/commands/test/test_command.rb @@ -1,8 +1,8 @@ # frozen_string_literal: true -require_relative "../../command" -require_relative "../../test_unit/runner" -require_relative "../../test_unit/reporter" +require "rails/command" +require "rails/test_unit/runner" +require "rails/test_unit/reporter" module Rails module Command diff --git a/railties/lib/rails/configuration.rb b/railties/lib/rails/configuration.rb index 70815d114d..d3a54d9364 100644 --- a/railties/lib/rails/configuration.rb +++ b/railties/lib/rails/configuration.rb @@ -2,8 +2,8 @@ require "active_support/ordered_options" require "active_support/core_ext/object" -require_relative "paths" -require_relative "rack" +require "rails/paths" +require "rails/rack" module Rails module Configuration diff --git a/railties/lib/rails/engine.rb b/railties/lib/rails/engine.rb index cc2030d37d..6a13a84108 100644 --- a/railties/lib/rails/engine.rb +++ b/railties/lib/rails/engine.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true -require_relative "railtie" -require_relative "engine/railties" +require "rails/railtie" +require "rails/engine/railties" require "active_support/core_ext/module/delegation" require "pathname" require "thread" @@ -439,8 +439,8 @@ module Rails # Load console and invoke the registered hooks. # Check <tt>Rails::Railtie.console</tt> for more info. def load_console(app = self) - require_relative "console/app" - require_relative "console/helpers" + require "rails/console/app" + require "rails/console/helpers" run_console_blocks(app) self end @@ -463,7 +463,7 @@ module Rails # Load Rails generators and invoke the registered hooks. # Check <tt>Rails::Railtie.generators</tt> for more info. def load_generators(app = self) - require_relative "generators" + require "rails/generators" run_generators_blocks(app) Rails::Generators.configure!(app.config.generators) self diff --git a/railties/lib/rails/engine/commands.rb b/railties/lib/rails/engine/commands.rb index 3854907507..05218640c6 100644 --- a/railties/lib/rails/engine/commands.rb +++ b/railties/lib/rails/engine/commands.rb @@ -6,4 +6,4 @@ unless defined?(APP_PATH) end end -require_relative "../commands" +require "rails/commands" diff --git a/railties/lib/rails/engine/configuration.rb b/railties/lib/rails/engine/configuration.rb index 16ba7f9eb8..6bf0406b21 100644 --- a/railties/lib/rails/engine/configuration.rb +++ b/railties/lib/rails/engine/configuration.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require_relative "../railtie/configuration" +require "rails/railtie/configuration" module Rails class Engine diff --git a/railties/lib/rails/engine/updater.rb b/railties/lib/rails/engine/updater.rb index 21a0fc5562..be7a47124a 100644 --- a/railties/lib/rails/engine/updater.rb +++ b/railties/lib/rails/engine/updater.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true -require_relative "../generators" -require_relative "../generators/rails/plugin/plugin_generator" +require "rails/generators" +require "rails/generators/rails/plugin/plugin_generator" module Rails class Engine diff --git a/railties/lib/rails/generators.rb b/railties/lib/rails/generators.rb index a630d55e59..2d265818f7 100644 --- a/railties/lib/rails/generators.rb +++ b/railties/lib/rails/generators.rb @@ -4,7 +4,7 @@ activesupport_path = File.expand_path("../../../activesupport/lib", __dir__) $:.unshift(activesupport_path) if File.directory?(activesupport_path) && !$:.include?(activesupport_path) require "thor/group" -require_relative "command" +require "rails/command" require "active_support" require "active_support/core_ext/object/blank" diff --git a/railties/lib/rails/generators/app_base.rb b/railties/lib/rails/generators/app_base.rb index 6fb4ea52b3..bc00adabae 100644 --- a/railties/lib/rails/generators/app_base.rb +++ b/railties/lib/rails/generators/app_base.rb @@ -3,10 +3,10 @@ require "fileutils" require "digest/md5" require "active_support/core_ext/string/strip" -require_relative "../version" unless defined?(Rails::VERSION) +require "rails/version" unless defined?(Rails::VERSION) require "open-uri" require "uri" -require_relative "../generators" +require "rails/generators" require "active_support/core_ext/array/extract_options" module Rails diff --git a/railties/lib/rails/generators/css/assets/assets_generator.rb b/railties/lib/rails/generators/css/assets/assets_generator.rb index 5f7be769b2..f657d1e50f 100644 --- a/railties/lib/rails/generators/css/assets/assets_generator.rb +++ b/railties/lib/rails/generators/css/assets/assets_generator.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require_relative "../../named_base" +require "rails/generators/named_base" module Css # :nodoc: module Generators # :nodoc: diff --git a/railties/lib/rails/generators/css/scaffold/scaffold_generator.rb b/railties/lib/rails/generators/css/scaffold/scaffold_generator.rb index d8eb4f2c7b..89c560f382 100644 --- a/railties/lib/rails/generators/css/scaffold/scaffold_generator.rb +++ b/railties/lib/rails/generators/css/scaffold/scaffold_generator.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require_relative "../../named_base" +require "rails/generators/named_base" module Css # :nodoc: module Generators # :nodoc: diff --git a/railties/lib/rails/generators/erb.rb b/railties/lib/rails/generators/erb.rb index 2c20834611..ba20bcd32a 100644 --- a/railties/lib/rails/generators/erb.rb +++ b/railties/lib/rails/generators/erb.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require_relative "named_base" +require "rails/generators/named_base" module Erb # :nodoc: module Generators # :nodoc: diff --git a/railties/lib/rails/generators/erb/controller/controller_generator.rb b/railties/lib/rails/generators/erb/controller/controller_generator.rb index 1a6c84288b..8e13744b2a 100644 --- a/railties/lib/rails/generators/erb/controller/controller_generator.rb +++ b/railties/lib/rails/generators/erb/controller/controller_generator.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require_relative "../../erb" +require "rails/generators/erb" module Erb # :nodoc: module Generators # :nodoc: diff --git a/railties/lib/rails/generators/erb/mailer/mailer_generator.rb b/railties/lib/rails/generators/erb/mailer/mailer_generator.rb index 5774d86c8e..e2ea66415f 100644 --- a/railties/lib/rails/generators/erb/mailer/mailer_generator.rb +++ b/railties/lib/rails/generators/erb/mailer/mailer_generator.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require_relative "../../erb" +require "rails/generators/erb" module Erb # :nodoc: module Generators # :nodoc: diff --git a/railties/lib/rails/generators/erb/scaffold/scaffold_generator.rb b/railties/lib/rails/generators/erb/scaffold/scaffold_generator.rb index e80c6d4b7d..2fc04e4094 100644 --- a/railties/lib/rails/generators/erb/scaffold/scaffold_generator.rb +++ b/railties/lib/rails/generators/erb/scaffold/scaffold_generator.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true -require_relative "../../erb" -require_relative "../../resource_helpers" +require "rails/generators/erb" +require "rails/generators/resource_helpers" module Erb # :nodoc: module Generators # :nodoc: diff --git a/railties/lib/rails/generators/js/assets/assets_generator.rb b/railties/lib/rails/generators/js/assets/assets_generator.rb index ea151aa04e..9d32c666dc 100644 --- a/railties/lib/rails/generators/js/assets/assets_generator.rb +++ b/railties/lib/rails/generators/js/assets/assets_generator.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require_relative "../../named_base" +require "rails/generators/named_base" module Js # :nodoc: module Generators # :nodoc: diff --git a/railties/lib/rails/generators/migration.rb b/railties/lib/rails/generators/migration.rb index 7162b8c0b4..1cbccfe461 100644 --- a/railties/lib/rails/generators/migration.rb +++ b/railties/lib/rails/generators/migration.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require "active_support/concern" -require_relative "actions/create_migration" +require "rails/generators/actions/create_migration" module Rails module Generators diff --git a/railties/lib/rails/generators/model_helpers.rb b/railties/lib/rails/generators/model_helpers.rb index aa3564476a..50078404b3 100644 --- a/railties/lib/rails/generators/model_helpers.rb +++ b/railties/lib/rails/generators/model_helpers.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require_relative "active_model" +require "rails/generators/active_model" module Rails module Generators diff --git a/railties/lib/rails/generators/named_base.rb b/railties/lib/rails/generators/named_base.rb index 5f602f1d52..44f5ab45d3 100644 --- a/railties/lib/rails/generators/named_base.rb +++ b/railties/lib/rails/generators/named_base.rb @@ -1,8 +1,8 @@ # frozen_string_literal: true require "active_support/core_ext/module/introspection" -require_relative "base" -require_relative "generated_attribute" +require "rails/generators/base" +require "rails/generators/generated_attribute" module Rails module Generators diff --git a/railties/lib/rails/generators/rails/app/app_generator.rb b/railties/lib/rails/generators/rails/app/app_generator.rb index 23fdf03b05..39ef0d62de 100644 --- a/railties/lib/rails/generators/rails/app/app_generator.rb +++ b/railties/lib/rails/generators/rails/app/app_generator.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require_relative "../../app_base" +require "rails/generators/app_base" module Rails module ActionMethods # :nodoc: @@ -161,7 +161,7 @@ module Rails def master_key return if options[:pretend] - require_relative "../master_key/master_key_generator" + require "rails/generators/rails/master_key/master_key_generator" after_bundle do Rails::Generators::MasterKeyGenerator.new([], quiet: options[:quiet]).add_master_key_file @@ -171,7 +171,7 @@ module Rails def credentials return if options[:pretend] - require_relative "../credentials/credentials_generator" + require "rails/generators/rails/credentials/credentials_generator" after_bundle do Rails::Generators::CredentialsGenerator.new([], quiet: options[:quiet]).add_credentials_file_silently @@ -559,7 +559,7 @@ module Rails def handle_version_request!(argument) if ["--version", "-v"].include?(argument) - require_relative "../../../version" + require "rails/version" puts "Rails #{Rails::VERSION::STRING}" exit(0) end diff --git a/railties/lib/rails/generators/rails/credentials/credentials_generator.rb b/railties/lib/rails/generators/rails/credentials/credentials_generator.rb index 21ca566818..52cb4bd8bf 100644 --- a/railties/lib/rails/generators/rails/credentials/credentials_generator.rb +++ b/railties/lib/rails/generators/rails/credentials/credentials_generator.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true -require_relative "../../base" -require_relative "../master_key/master_key_generator" +require "rails/generators/base" +require "rails/generators/rails/master_key/master_key_generator" require "active_support/encrypted_configuration" module Rails diff --git a/railties/lib/rails/generators/rails/encrypted_secrets/encrypted_secrets_generator.rb b/railties/lib/rails/generators/rails/encrypted_secrets/encrypted_secrets_generator.rb index d054e8cad2..1aa7a2622a 100644 --- a/railties/lib/rails/generators/rails/encrypted_secrets/encrypted_secrets_generator.rb +++ b/railties/lib/rails/generators/rails/encrypted_secrets/encrypted_secrets_generator.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true -require_relative "../../base" -require_relative "../../../secrets" +require "rails/generators/base" +require "rails/secrets" module Rails module Generators diff --git a/railties/lib/rails/generators/rails/master_key/master_key_generator.rb b/railties/lib/rails/generators/rails/master_key/master_key_generator.rb index 395687974a..23dbed20ac 100644 --- a/railties/lib/rails/generators/rails/master_key/master_key_generator.rb +++ b/railties/lib/rails/generators/rails/master_key/master_key_generator.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require_relative "../../base" +require "rails/generators/base" require "pathname" require "active_support/encrypted_file" diff --git a/railties/lib/rails/generators/rails/model/model_generator.rb b/railties/lib/rails/generators/rails/model/model_generator.rb index 1dca03e0bb..de4de2cae2 100644 --- a/railties/lib/rails/generators/rails/model/model_generator.rb +++ b/railties/lib/rails/generators/rails/model/model_generator.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require_relative "../../model_helpers" +require "rails/generators/model_helpers" module Rails module Generators diff --git a/railties/lib/rails/generators/rails/plugin/plugin_generator.rb b/railties/lib/rails/generators/rails/plugin/plugin_generator.rb index eb941adf95..d0dfb04162 100644 --- a/railties/lib/rails/generators/rails/plugin/plugin_generator.rb +++ b/railties/lib/rails/generators/rails/plugin/plugin_generator.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require "active_support/core_ext/hash/slice" -require_relative "../app/app_generator" +require "rails/generators/rails/app/app_generator" require "date" module Rails diff --git a/railties/lib/rails/generators/rails/resource/resource_generator.rb b/railties/lib/rails/generators/rails/resource/resource_generator.rb index 74b1574863..3ba25ef0fe 100644 --- a/railties/lib/rails/generators/rails/resource/resource_generator.rb +++ b/railties/lib/rails/generators/rails/resource/resource_generator.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true -require_relative "../../resource_helpers" -require_relative "../model/model_generator" +require "rails/generators/resource_helpers" +require "rails/generators/rails/model/model_generator" module Rails module Generators diff --git a/railties/lib/rails/generators/rails/scaffold/scaffold_generator.rb b/railties/lib/rails/generators/rails/scaffold/scaffold_generator.rb index c0fb873d36..8beb7416c0 100644 --- a/railties/lib/rails/generators/rails/scaffold/scaffold_generator.rb +++ b/railties/lib/rails/generators/rails/scaffold/scaffold_generator.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require_relative "../resource/resource_generator" +require "rails/generators/rails/resource/resource_generator" module Rails module Generators diff --git a/railties/lib/rails/generators/rails/scaffold_controller/scaffold_controller_generator.rb b/railties/lib/rails/generators/rails/scaffold_controller/scaffold_controller_generator.rb index 601a4b3a6e..7030561a33 100644 --- a/railties/lib/rails/generators/rails/scaffold_controller/scaffold_controller_generator.rb +++ b/railties/lib/rails/generators/rails/scaffold_controller/scaffold_controller_generator.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require_relative "../../resource_helpers" +require "rails/generators/resource_helpers" module Rails module Generators diff --git a/railties/lib/rails/generators/resource_helpers.rb b/railties/lib/rails/generators/resource_helpers.rb index 8bd5110940..a146a8fda6 100644 --- a/railties/lib/rails/generators/resource_helpers.rb +++ b/railties/lib/rails/generators/resource_helpers.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true -require_relative "active_model" -require_relative "model_helpers" +require "rails/generators/active_model" +require "rails/generators/model_helpers" module Rails module Generators diff --git a/railties/lib/rails/generators/test_case.rb b/railties/lib/rails/generators/test_case.rb index 9c06eed95a..5c71bf0be9 100644 --- a/railties/lib/rails/generators/test_case.rb +++ b/railties/lib/rails/generators/test_case.rb @@ -1,9 +1,9 @@ # frozen_string_literal: true -require_relative "../generators" -require_relative "testing/behaviour" -require_relative "testing/setup_and_teardown" -require_relative "testing/assertions" +require "rails/generators" +require "rails/generators/testing/behaviour" +require "rails/generators/testing/setup_and_teardown" +require "rails/generators/testing/assertions" require "fileutils" module Rails diff --git a/railties/lib/rails/generators/test_unit.rb b/railties/lib/rails/generators/test_unit.rb index 1aa03ace99..1005ac557c 100644 --- a/railties/lib/rails/generators/test_unit.rb +++ b/railties/lib/rails/generators/test_unit.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require_relative "named_base" +require "rails/generators/named_base" module TestUnit # :nodoc: module Generators # :nodoc: diff --git a/railties/lib/rails/generators/test_unit/controller/controller_generator.rb b/railties/lib/rails/generators/test_unit/controller/controller_generator.rb index 3947b74205..1a9ac6bf2a 100644 --- a/railties/lib/rails/generators/test_unit/controller/controller_generator.rb +++ b/railties/lib/rails/generators/test_unit/controller/controller_generator.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require_relative "../../test_unit" +require "rails/generators/test_unit" module TestUnit # :nodoc: module Generators # :nodoc: diff --git a/railties/lib/rails/generators/test_unit/generator/generator_generator.rb b/railties/lib/rails/generators/test_unit/generator/generator_generator.rb index 9f79e9eee1..19be4f2f51 100644 --- a/railties/lib/rails/generators/test_unit/generator/generator_generator.rb +++ b/railties/lib/rails/generators/test_unit/generator/generator_generator.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require_relative "../../test_unit" +require "rails/generators/test_unit" module TestUnit # :nodoc: module Generators # :nodoc: diff --git a/railties/lib/rails/generators/test_unit/helper/helper_generator.rb b/railties/lib/rails/generators/test_unit/helper/helper_generator.rb index 1c60c3573f..77308dcf7d 100644 --- a/railties/lib/rails/generators/test_unit/helper/helper_generator.rb +++ b/railties/lib/rails/generators/test_unit/helper/helper_generator.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require_relative "../../test_unit" +require "rails/generators/test_unit" module TestUnit # :nodoc: module Generators # :nodoc: diff --git a/railties/lib/rails/generators/test_unit/integration/integration_generator.rb b/railties/lib/rails/generators/test_unit/integration/integration_generator.rb index c859ba5e4e..ae307c5cd9 100644 --- a/railties/lib/rails/generators/test_unit/integration/integration_generator.rb +++ b/railties/lib/rails/generators/test_unit/integration/integration_generator.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require_relative "../../test_unit" +require "rails/generators/test_unit" module TestUnit # :nodoc: module Generators # :nodoc: diff --git a/railties/lib/rails/generators/test_unit/job/job_generator.rb b/railties/lib/rails/generators/test_unit/job/job_generator.rb index cbbcd1cd4e..9225af4e0c 100644 --- a/railties/lib/rails/generators/test_unit/job/job_generator.rb +++ b/railties/lib/rails/generators/test_unit/job/job_generator.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require_relative "../../test_unit" +require "rails/generators/test_unit" module TestUnit # :nodoc: module Generators # :nodoc: diff --git a/railties/lib/rails/generators/test_unit/mailer/mailer_generator.rb b/railties/lib/rails/generators/test_unit/mailer/mailer_generator.rb index 45f82158e9..610d47a729 100644 --- a/railties/lib/rails/generators/test_unit/mailer/mailer_generator.rb +++ b/railties/lib/rails/generators/test_unit/mailer/mailer_generator.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require_relative "../../test_unit" +require "rails/generators/test_unit" module TestUnit # :nodoc: module Generators # :nodoc: diff --git a/railties/lib/rails/generators/test_unit/model/model_generator.rb b/railties/lib/rails/generators/test_unit/model/model_generator.rb index 2b1cc50c20..02d7502592 100644 --- a/railties/lib/rails/generators/test_unit/model/model_generator.rb +++ b/railties/lib/rails/generators/test_unit/model/model_generator.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require_relative "../../test_unit" +require "rails/generators/test_unit" module TestUnit # :nodoc: module Generators # :nodoc: diff --git a/railties/lib/rails/generators/test_unit/plugin/plugin_generator.rb b/railties/lib/rails/generators/test_unit/plugin/plugin_generator.rb index 10fe27b2c3..0657bc2389 100644 --- a/railties/lib/rails/generators/test_unit/plugin/plugin_generator.rb +++ b/railties/lib/rails/generators/test_unit/plugin/plugin_generator.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require_relative "../../test_unit" +require "rails/generators/test_unit" module TestUnit # :nodoc: module Generators # :nodoc: diff --git a/railties/lib/rails/generators/test_unit/scaffold/scaffold_generator.rb b/railties/lib/rails/generators/test_unit/scaffold/scaffold_generator.rb index 23d5c63614..b6c13b41ae 100644 --- a/railties/lib/rails/generators/test_unit/scaffold/scaffold_generator.rb +++ b/railties/lib/rails/generators/test_unit/scaffold/scaffold_generator.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true -require_relative "../../test_unit" -require_relative "../../resource_helpers" +require "rails/generators/test_unit" +require "rails/generators/resource_helpers" module TestUnit # :nodoc: module Generators # :nodoc: diff --git a/railties/lib/rails/generators/test_unit/system/system_generator.rb b/railties/lib/rails/generators/test_unit/system/system_generator.rb index d3acbfd738..08504d4124 100644 --- a/railties/lib/rails/generators/test_unit/system/system_generator.rb +++ b/railties/lib/rails/generators/test_unit/system/system_generator.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require_relative "../../test_unit" +require "rails/generators/test_unit" module TestUnit # :nodoc: module Generators # :nodoc: diff --git a/railties/lib/rails/generators/testing/behaviour.rb b/railties/lib/rails/generators/testing/behaviour.rb index 97a09c1166..6ab88bd59f 100644 --- a/railties/lib/rails/generators/testing/behaviour.rb +++ b/railties/lib/rails/generators/testing/behaviour.rb @@ -6,7 +6,7 @@ require "active_support/core_ext/hash/reverse_merge" require "active_support/core_ext/kernel/reporting" require "active_support/testing/stream" require "active_support/concern" -require_relative "../../generators" +require "rails/generators" module Rails module Generators diff --git a/railties/lib/rails/info_controller.rb b/railties/lib/rails/info_controller.rb index 6535b5b6ad..b4f4a5922a 100644 --- a/railties/lib/rails/info_controller.rb +++ b/railties/lib/rails/info_controller.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require_relative "application_controller" +require "rails/application_controller" require "action_dispatch/routing/inspector" class Rails::InfoController < Rails::ApplicationController # :nodoc: diff --git a/railties/lib/rails/mailers_controller.rb b/railties/lib/rails/mailers_controller.rb index 6bd3161fdd..66636e5d6b 100644 --- a/railties/lib/rails/mailers_controller.rb +++ b/railties/lib/rails/mailers_controller.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require_relative "application_controller" +require "rails/application_controller" class Rails::MailersController < Rails::ApplicationController # :nodoc: prepend_view_path ActionDispatch::DebugExceptions::RESCUES_TEMPLATE_PATH diff --git a/railties/lib/rails/plugin/test.rb b/railties/lib/rails/plugin/test.rb index 2426521e35..18b6fd1757 100644 --- a/railties/lib/rails/plugin/test.rb +++ b/railties/lib/rails/plugin/test.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true -require_relative "../test_unit/runner" -require_relative "../test_unit/reporter" +require "rails/test_unit/runner" +require "rails/test_unit/reporter" Rails::TestUnitReporter.executable = "bin/test" diff --git a/railties/lib/rails/railtie.rb b/railties/lib/rails/railtie.rb index 42c4a82b1b..88dd932370 100644 --- a/railties/lib/rails/railtie.rb +++ b/railties/lib/rails/railtie.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require_relative "initializable" +require "rails/initializable" require "active_support/inflector" require "active_support/core_ext/module/introspection" require "active_support/core_ext/module/delegation" diff --git a/railties/lib/rails/railtie/configuration.rb b/railties/lib/rails/railtie/configuration.rb index d9997759f2..48853129bc 100644 --- a/railties/lib/rails/railtie/configuration.rb +++ b/railties/lib/rails/railtie/configuration.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require_relative "../configuration" +require "rails/configuration" module Rails class Railtie diff --git a/railties/lib/rails/tasks/annotations.rake b/railties/lib/rails/tasks/annotations.rake index 931f81ac7e..93bc66e2db 100644 --- a/railties/lib/rails/tasks/annotations.rake +++ b/railties/lib/rails/tasks/annotations.rake @@ -1,6 +1,6 @@ # frozen_string_literal: true -require_relative "../source_annotation_extractor" +require "rails/source_annotation_extractor" desc "Enumerate all annotations (use notes:optimize, :fixme, :todo for focus)" task :notes do diff --git a/railties/lib/rails/tasks/dev.rake b/railties/lib/rails/tasks/dev.rake index 90fd3ccd8b..5aea6f7dc5 100644 --- a/railties/lib/rails/tasks/dev.rake +++ b/railties/lib/rails/tasks/dev.rake @@ -1,6 +1,6 @@ # frozen_string_literal: true -require_relative "../dev_caching" +require "rails/dev_caching" namespace :dev do desc "Toggle development mode caching on/off" diff --git a/railties/lib/rails/tasks/engine.rake b/railties/lib/rails/tasks/engine.rake index 3ce49a1641..c24d1ad532 100644 --- a/railties/lib/rails/tasks/engine.rake +++ b/railties/lib/rails/tasks/engine.rake @@ -8,7 +8,7 @@ task "load_app" do task update: [ "update:bin" ] namespace :update do - require_relative "../engine/updater" + require "rails/engine/updater" # desc "Adds new executables to the engine bin/ directory" task :bin do Rails::Engine::Updater.run(:create_bin_files) diff --git a/railties/lib/rails/tasks/framework.rake b/railties/lib/rails/tasks/framework.rake index 8931aabcda..7dfcd14bd0 100644 --- a/railties/lib/rails/tasks/framework.rake +++ b/railties/lib/rails/tasks/framework.rake @@ -9,8 +9,8 @@ namespace :app do template = ENV["LOCATION"] raise "No LOCATION value given. Please set LOCATION either as path to a file or a URL" if template.blank? template = File.expand_path(template) if template !~ %r{\A[A-Za-z][A-Za-z0-9+\-\.]*://} - require_relative "../generators" - require_relative "../generators/rails/app/app_generator" + require "rails/generators" + require "rails/generators/rails/app/app_generator" generator = Rails::Generators::AppGenerator.new [Rails.root], {}, { destination_root: Rails.root } generator.apply template, verbose: false end @@ -38,7 +38,7 @@ namespace :app do end namespace :update do - require_relative "../app_updater" + require "rails/app_updater" # desc "Update config/boot.rb from your current rails install" task :configs do diff --git a/railties/lib/rails/tasks/statistics.rake b/railties/lib/rails/tasks/statistics.rake index 0449a13586..594db91eec 100644 --- a/railties/lib/rails/tasks/statistics.rake +++ b/railties/lib/rails/tasks/statistics.rake @@ -26,6 +26,6 @@ end.select { |name, dir| File.directory?(dir) } desc "Report code statistics (KLOCs, etc) from the application or engine" task :stats do - require_relative "../code_statistics" + require "rails/code_statistics" CodeStatistics.new(*STATS_DIRECTORIES).to_s end diff --git a/railties/lib/rails/test_help.rb b/railties/lib/rails/test_help.rb index f755474488..732c5c1e1f 100644 --- a/railties/lib/rails/test_help.rb +++ b/railties/lib/rails/test_help.rb @@ -8,7 +8,7 @@ require "active_support/test_case" require "action_controller" require "action_controller/test_case" require "action_dispatch/testing/integration" -require_relative "generators/test_case" +require "rails/generators/test_case" require "active_support/testing/autorun" diff --git a/railties/lib/rails/test_unit/railtie.rb b/railties/lib/rails/test_unit/railtie.rb index 05f9a177d0..42b6daa3d1 100644 --- a/railties/lib/rails/test_unit/railtie.rb +++ b/railties/lib/rails/test_unit/railtie.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require_relative "line_filtering" +require "rails/test_unit/line_filtering" if defined?(Rake.application) && Rake.application.top_level_tasks.grep(/^(default$|test(:|$))/).any? ENV["RAILS_ENV"] ||= Rake.application.options.show_tasks ? "development" : "test" diff --git a/railties/lib/rails/test_unit/testing.rake b/railties/lib/rails/test_unit/testing.rake index 18d699f806..32ac27a135 100644 --- a/railties/lib/rails/test_unit/testing.rake +++ b/railties/lib/rails/test_unit/testing.rake @@ -2,7 +2,7 @@ gem "minitest" require "minitest" -require_relative "runner" +require "rails/test_unit/runner" task default: :test diff --git a/railties/lib/rails/welcome_controller.rb b/railties/lib/rails/welcome_controller.rb index 0cb43e0f31..5b84b57679 100644 --- a/railties/lib/rails/welcome_controller.rb +++ b/railties/lib/rails/welcome_controller.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require_relative "application_controller" +require "rails/application_controller" class Rails::WelcomeController < Rails::ApplicationController # :nodoc: layout false |