omg-railties 8.0.0.alpha3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/CHANGELOG.md +171 -0
- data/MIT-LICENSE +20 -0
- data/RDOC_MAIN.md +99 -0
- data/README.rdoc +39 -0
- data/exe/rails +10 -0
- data/lib/minitest/rails_plugin.rb +140 -0
- data/lib/rails/all.rb +21 -0
- data/lib/rails/api/generator.rb +38 -0
- data/lib/rails/api/task.rb +235 -0
- data/lib/rails/app_loader.rb +77 -0
- data/lib/rails/application/bootstrap.rb +118 -0
- data/lib/rails/application/configuration.rb +659 -0
- data/lib/rails/application/default_middleware_stack.rb +140 -0
- data/lib/rails/application/dummy_config.rb +19 -0
- data/lib/rails/application/finisher.rb +238 -0
- data/lib/rails/application/routes_reloader.rb +79 -0
- data/lib/rails/application.rb +658 -0
- data/lib/rails/application_controller.rb +28 -0
- data/lib/rails/autoloaders/inflector.rb +21 -0
- data/lib/rails/autoloaders.rb +48 -0
- data/lib/rails/backtrace_cleaner.rb +42 -0
- data/lib/rails/cli.rb +21 -0
- data/lib/rails/code_statistics.rb +159 -0
- data/lib/rails/code_statistics_calculator.rb +99 -0
- data/lib/rails/command/actions.rb +52 -0
- data/lib/rails/command/base.rb +185 -0
- data/lib/rails/command/behavior.rb +84 -0
- data/lib/rails/command/environment_argument.rb +56 -0
- data/lib/rails/command/helpers/editor.rb +40 -0
- data/lib/rails/command.rb +172 -0
- data/lib/rails/commands/about/about_command.rb +14 -0
- data/lib/rails/commands/app/update_command.rb +94 -0
- data/lib/rails/commands/application/application_command.rb +33 -0
- data/lib/rails/commands/boot/boot_command.rb +14 -0
- data/lib/rails/commands/console/console_command.rb +91 -0
- data/lib/rails/commands/console/irb_console.rb +136 -0
- data/lib/rails/commands/credentials/USAGE +73 -0
- data/lib/rails/commands/credentials/credentials_command/diffing.rb +53 -0
- data/lib/rails/commands/credentials/credentials_command.rb +139 -0
- data/lib/rails/commands/db/system/change/change_command.rb +26 -0
- data/lib/rails/commands/dbconsole/dbconsole_command.rb +88 -0
- data/lib/rails/commands/destroy/destroy_command.rb +29 -0
- data/lib/rails/commands/dev/dev_command.rb +14 -0
- data/lib/rails/commands/devcontainer/devcontainer_command.rb +39 -0
- data/lib/rails/commands/encrypted/USAGE +23 -0
- data/lib/rails/commands/encrypted/encrypted_command.rb +98 -0
- data/lib/rails/commands/gem_help/USAGE +16 -0
- data/lib/rails/commands/gem_help/gem_help_command.rb +13 -0
- data/lib/rails/commands/generate/generate_command.rb +30 -0
- data/lib/rails/commands/help/USAGE +17 -0
- data/lib/rails/commands/help/help_command.rb +34 -0
- data/lib/rails/commands/initializers/initializers_command.rb +20 -0
- data/lib/rails/commands/middleware/middleware_command.rb +17 -0
- data/lib/rails/commands/new/new_command.rb +21 -0
- data/lib/rails/commands/notes/notes_command.rb +30 -0
- data/lib/rails/commands/plugin/plugin_command.rb +47 -0
- data/lib/rails/commands/rake/rake_command.rb +55 -0
- data/lib/rails/commands/restart/restart_command.rb +14 -0
- data/lib/rails/commands/routes/routes_command.rb +49 -0
- data/lib/rails/commands/runner/USAGE +22 -0
- data/lib/rails/commands/runner/runner_command.rb +81 -0
- data/lib/rails/commands/secret/secret_command.rb +13 -0
- data/lib/rails/commands/server/server_command.rb +290 -0
- data/lib/rails/commands/stats/stats_command.rb +19 -0
- data/lib/rails/commands/test/USAGE +14 -0
- data/lib/rails/commands/test/test_command.rb +81 -0
- data/lib/rails/commands/unused_routes/unused_routes_command.rb +75 -0
- data/lib/rails/commands/version/version_command.rb +12 -0
- data/lib/rails/commands.rb +18 -0
- data/lib/rails/configuration.rb +170 -0
- data/lib/rails/console/app.rb +8 -0
- data/lib/rails/console/helpers.rb +8 -0
- data/lib/rails/console/methods.rb +23 -0
- data/lib/rails/deprecator.rb +7 -0
- data/lib/rails/dev_caching.rb +44 -0
- data/lib/rails/engine/commands.rb +9 -0
- data/lib/rails/engine/configuration.rb +138 -0
- data/lib/rails/engine/lazy_route_set.rb +109 -0
- data/lib/rails/engine/railties.rb +23 -0
- data/lib/rails/engine/updater.rb +21 -0
- data/lib/rails/engine.rb +760 -0
- data/lib/rails/gem_version.rb +17 -0
- data/lib/rails/generators/actions/create_migration.rb +75 -0
- data/lib/rails/generators/actions.rb +528 -0
- data/lib/rails/generators/active_model.rb +94 -0
- data/lib/rails/generators/app_base.rb +806 -0
- data/lib/rails/generators/app_name.rb +39 -0
- data/lib/rails/generators/base.rb +432 -0
- data/lib/rails/generators/database.rb +287 -0
- data/lib/rails/generators/erb/authentication/authentication_generator.rb +15 -0
- data/lib/rails/generators/erb/authentication/templates/views/passwords/edit.html.erb +9 -0
- data/lib/rails/generators/erb/authentication/templates/views/passwords/new.html.erb +8 -0
- data/lib/rails/generators/erb/authentication/templates/views/sessions/new.html.erb +11 -0
- data/lib/rails/generators/erb/controller/controller_generator.rb +24 -0
- data/lib/rails/generators/erb/controller/templates/view.html.erb.tt +2 -0
- data/lib/rails/generators/erb/mailer/mailer_generator.rb +41 -0
- data/lib/rails/generators/erb/mailer/templates/layout.html.erb.tt +13 -0
- data/lib/rails/generators/erb/mailer/templates/layout.text.erb.tt +1 -0
- data/lib/rails/generators/erb/mailer/templates/view.html.erb.tt +5 -0
- data/lib/rails/generators/erb/mailer/templates/view.text.erb.tt +3 -0
- data/lib/rails/generators/erb/scaffold/scaffold_generator.rb +34 -0
- data/lib/rails/generators/erb/scaffold/templates/_form.html.erb.tt +37 -0
- data/lib/rails/generators/erb/scaffold/templates/edit.html.erb.tt +12 -0
- data/lib/rails/generators/erb/scaffold/templates/index.html.erb.tt +16 -0
- data/lib/rails/generators/erb/scaffold/templates/new.html.erb.tt +11 -0
- data/lib/rails/generators/erb/scaffold/templates/partial.html.erb.tt +17 -0
- data/lib/rails/generators/erb/scaffold/templates/show.html.erb.tt +10 -0
- data/lib/rails/generators/erb.rb +26 -0
- data/lib/rails/generators/generated_attribute.rb +274 -0
- data/lib/rails/generators/migration.rb +71 -0
- data/lib/rails/generators/model_helpers.rb +62 -0
- data/lib/rails/generators/named_base.rb +227 -0
- data/lib/rails/generators/rails/app/USAGE +31 -0
- data/lib/rails/generators/rails/app/app_generator.rb +678 -0
- data/lib/rails/generators/rails/app/templates/Dockerfile.tt +119 -0
- data/lib/rails/generators/rails/app/templates/Gemfile.tt +83 -0
- data/lib/rails/generators/rails/app/templates/README.md.tt +24 -0
- data/lib/rails/generators/rails/app/templates/Rakefile.tt +6 -0
- data/lib/rails/generators/rails/app/templates/app/assets/stylesheets/application.css.tt +15 -0
- data/lib/rails/generators/rails/app/templates/app/controllers/application_controller.rb.tt +6 -0
- data/lib/rails/generators/rails/app/templates/app/helpers/application_helper.rb.tt +2 -0
- data/lib/rails/generators/rails/app/templates/app/jobs/application_job.rb.tt +7 -0
- data/lib/rails/generators/rails/app/templates/app/mailers/application_mailer.rb.tt +4 -0
- data/lib/rails/generators/rails/app/templates/app/models/application_record.rb.tt +3 -0
- data/lib/rails/generators/rails/app/templates/app/views/layouts/application.html.erb.tt +33 -0
- data/lib/rails/generators/rails/app/templates/app/views/layouts/mailer.html.erb.tt +13 -0
- data/lib/rails/generators/rails/app/templates/app/views/layouts/mailer.text.erb.tt +1 -0
- data/lib/rails/generators/rails/app/templates/app/views/pwa/manifest.json.erb.tt +22 -0
- data/lib/rails/generators/rails/app/templates/app/views/pwa/service-worker.js +26 -0
- data/lib/rails/generators/rails/app/templates/bin/brakeman.tt +6 -0
- data/lib/rails/generators/rails/app/templates/bin/dev.tt +1 -0
- data/lib/rails/generators/rails/app/templates/bin/rails.tt +3 -0
- data/lib/rails/generators/rails/app/templates/bin/rake.tt +3 -0
- data/lib/rails/generators/rails/app/templates/bin/rubocop.tt +7 -0
- data/lib/rails/generators/rails/app/templates/bin/setup.tt +45 -0
- data/lib/rails/generators/rails/app/templates/bin/thrust.tt +4 -0
- data/lib/rails/generators/rails/app/templates/config/application.rb.tt +42 -0
- data/lib/rails/generators/rails/app/templates/config/boot.rb.tt +6 -0
- data/lib/rails/generators/rails/app/templates/config/cable.yml.tt +10 -0
- data/lib/rails/generators/rails/app/templates/config/databases/mysql.yml.tt +82 -0
- data/lib/rails/generators/rails/app/templates/config/databases/postgresql.yml.tt +114 -0
- data/lib/rails/generators/rails/app/templates/config/databases/sqlite3.yml.tt +72 -0
- data/lib/rails/generators/rails/app/templates/config/databases/trilogy.yml.tt +82 -0
- data/lib/rails/generators/rails/app/templates/config/deploy.yml.tt +107 -0
- data/lib/rails/generators/rails/app/templates/config/environment.rb.tt +5 -0
- data/lib/rails/generators/rails/app/templates/config/environments/development.rb.tt +89 -0
- data/lib/rails/generators/rails/app/templates/config/environments/production.rb.tt +125 -0
- data/lib/rails/generators/rails/app/templates/config/environments/test.rb.tt +62 -0
- data/lib/rails/generators/rails/app/templates/config/initializers/assets.rb.tt +7 -0
- data/lib/rails/generators/rails/app/templates/config/initializers/content_security_policy.rb.tt +25 -0
- data/lib/rails/generators/rails/app/templates/config/initializers/cors.rb.tt +16 -0
- data/lib/rails/generators/rails/app/templates/config/initializers/filter_parameter_logging.rb.tt +8 -0
- data/lib/rails/generators/rails/app/templates/config/initializers/inflections.rb.tt +16 -0
- data/lib/rails/generators/rails/app/templates/config/initializers/new_framework_defaults_8_0.rb.tt +25 -0
- data/lib/rails/generators/rails/app/templates/config/locales/en.yml +31 -0
- data/lib/rails/generators/rails/app/templates/config/puma.rb.tt +43 -0
- data/lib/rails/generators/rails/app/templates/config/routes.rb.tt +16 -0
- data/lib/rails/generators/rails/app/templates/config/storage.yml.tt +34 -0
- data/lib/rails/generators/rails/app/templates/config.ru.tt +6 -0
- data/lib/rails/generators/rails/app/templates/db/seeds.rb.tt +9 -0
- data/lib/rails/generators/rails/app/templates/docker-entrypoint.tt +16 -0
- data/lib/rails/generators/rails/app/templates/dockerignore.tt +56 -0
- data/lib/rails/generators/rails/app/templates/env.erb.tt +5 -0
- data/lib/rails/generators/rails/app/templates/gitattributes.tt +9 -0
- data/lib/rails/generators/rails/app/templates/github/ci.yml.tt +138 -0
- data/lib/rails/generators/rails/app/templates/github/dependabot.yml +12 -0
- data/lib/rails/generators/rails/app/templates/gitignore.tt +38 -0
- data/lib/rails/generators/rails/app/templates/node-version.tt +1 -0
- data/lib/rails/generators/rails/app/templates/public/400.html +67 -0
- data/lib/rails/generators/rails/app/templates/public/404.html +67 -0
- data/lib/rails/generators/rails/app/templates/public/406-unsupported-browser.html +66 -0
- data/lib/rails/generators/rails/app/templates/public/422.html +67 -0
- data/lib/rails/generators/rails/app/templates/public/500.html +66 -0
- data/lib/rails/generators/rails/app/templates/public/icon.png +0 -0
- data/lib/rails/generators/rails/app/templates/public/icon.svg +3 -0
- data/lib/rails/generators/rails/app/templates/public/robots.txt +1 -0
- data/lib/rails/generators/rails/app/templates/rubocop.yml.tt +8 -0
- data/lib/rails/generators/rails/app/templates/ruby-version.tt +1 -0
- data/lib/rails/generators/rails/app/templates/test/application_system_test_case.rb.tt +5 -0
- data/lib/rails/generators/rails/app/templates/test/test_helper.rb.tt +21 -0
- data/lib/rails/generators/rails/application_record/application_record_generator.rb +13 -0
- data/lib/rails/generators/rails/authentication/USAGE +6 -0
- data/lib/rails/generators/rails/authentication/authentication_generator.rb +54 -0
- data/lib/rails/generators/rails/authentication/templates/controllers/concerns/authentication.rb +55 -0
- data/lib/rails/generators/rails/authentication/templates/controllers/passwords_controller.rb +33 -0
- data/lib/rails/generators/rails/authentication/templates/controllers/sessions_controller.rb +21 -0
- data/lib/rails/generators/rails/authentication/templates/mailers/passwords_mailer.rb +6 -0
- data/lib/rails/generators/rails/authentication/templates/models/current.rb +4 -0
- data/lib/rails/generators/rails/authentication/templates/models/session.rb +3 -0
- data/lib/rails/generators/rails/authentication/templates/models/user.rb +6 -0
- data/lib/rails/generators/rails/authentication/templates/test/mailers/previews/passwords_mailer_preview.rb +7 -0
- data/lib/rails/generators/rails/authentication/templates/views/passwords_mailer/reset.html.erb +4 -0
- data/lib/rails/generators/rails/authentication/templates/views/passwords_mailer/reset.text.erb +2 -0
- data/lib/rails/generators/rails/benchmark/USAGE +19 -0
- data/lib/rails/generators/rails/benchmark/benchmark_generator.rb +30 -0
- data/lib/rails/generators/rails/benchmark/templates/benchmark.rb.tt +15 -0
- data/lib/rails/generators/rails/controller/USAGE +26 -0
- data/lib/rails/generators/rails/controller/controller_generator.rb +42 -0
- data/lib/rails/generators/rails/controller/templates/controller.rb.tt +9 -0
- data/lib/rails/generators/rails/credentials/credentials_generator.rb +61 -0
- data/lib/rails/generators/rails/credentials/templates/credentials.yml.tt +12 -0
- data/lib/rails/generators/rails/db/system/change/change_generator.rb +206 -0
- data/lib/rails/generators/rails/devcontainer/devcontainer_generator.rb +168 -0
- data/lib/rails/generators/rails/devcontainer/templates/devcontainer/Dockerfile.tt +3 -0
- data/lib/rails/generators/rails/devcontainer/templates/devcontainer/compose.yaml.tt +47 -0
- data/lib/rails/generators/rails/devcontainer/templates/devcontainer/devcontainer.json.tt +37 -0
- data/lib/rails/generators/rails/encrypted_file/encrypted_file_generator.rb +31 -0
- data/lib/rails/generators/rails/encryption_key_file/encryption_key_file_generator.rb +57 -0
- data/lib/rails/generators/rails/generator/USAGE +13 -0
- data/lib/rails/generators/rails/generator/generator_generator.rb +27 -0
- data/lib/rails/generators/rails/generator/templates/%file_name%_generator.rb.tt +3 -0
- data/lib/rails/generators/rails/generator/templates/USAGE.tt +8 -0
- data/lib/rails/generators/rails/generator/templates/templates/.empty_directory +0 -0
- data/lib/rails/generators/rails/helper/USAGE +12 -0
- data/lib/rails/generators/rails/helper/helper_generator.rb +20 -0
- data/lib/rails/generators/rails/helper/templates/helper.rb.tt +4 -0
- data/lib/rails/generators/rails/integration_test/USAGE +10 -0
- data/lib/rails/generators/rails/integration_test/integration_test_generator.rb +9 -0
- data/lib/rails/generators/rails/master_key/master_key_generator.rb +53 -0
- data/lib/rails/generators/rails/migration/USAGE +45 -0
- data/lib/rails/generators/rails/migration/migration_generator.rb +14 -0
- data/lib/rails/generators/rails/model/model_generator.rb +18 -0
- data/lib/rails/generators/rails/plugin/USAGE +21 -0
- data/lib/rails/generators/rails/plugin/plugin_generator.rb +499 -0
- data/lib/rails/generators/rails/plugin/templates/%name%.gemspec.tt +28 -0
- data/lib/rails/generators/rails/plugin/templates/Gemfile.tt +23 -0
- data/lib/rails/generators/rails/plugin/templates/MIT-LICENSE.tt +20 -0
- data/lib/rails/generators/rails/plugin/templates/README.md.tt +28 -0
- data/lib/rails/generators/rails/plugin/templates/Rakefile.tt +14 -0
- data/lib/rails/generators/rails/plugin/templates/app/controllers/%namespaced_name%/application_controller.rb.tt +5 -0
- data/lib/rails/generators/rails/plugin/templates/app/helpers/%namespaced_name%/application_helper.rb.tt +5 -0
- data/lib/rails/generators/rails/plugin/templates/app/jobs/%namespaced_name%/application_job.rb.tt +5 -0
- data/lib/rails/generators/rails/plugin/templates/app/mailers/%namespaced_name%/application_mailer.rb.tt +7 -0
- data/lib/rails/generators/rails/plugin/templates/app/models/%namespaced_name%/application_record.rb.tt +6 -0
- data/lib/rails/generators/rails/plugin/templates/app/views/layouts/%namespaced_name%/application.html.erb.tt +17 -0
- data/lib/rails/generators/rails/plugin/templates/bin/rails.tt +15 -0
- data/lib/rails/generators/rails/plugin/templates/bin/rubocop.tt +7 -0
- data/lib/rails/generators/rails/plugin/templates/bin/test.tt +4 -0
- data/lib/rails/generators/rails/plugin/templates/config/routes.rb.tt +6 -0
- data/lib/rails/generators/rails/plugin/templates/github/ci.yml.tt +103 -0
- data/lib/rails/generators/rails/plugin/templates/github/dependabot.yml +12 -0
- data/lib/rails/generators/rails/plugin/templates/gitignore.tt +14 -0
- data/lib/rails/generators/rails/plugin/templates/lib/%namespaced_name%/engine.rb.tt +7 -0
- data/lib/rails/generators/rails/plugin/templates/lib/%namespaced_name%/railtie.rb.tt +5 -0
- data/lib/rails/generators/rails/plugin/templates/lib/%namespaced_name%/version.rb.tt +1 -0
- data/lib/rails/generators/rails/plugin/templates/lib/%namespaced_name%.rb.tt +8 -0
- data/lib/rails/generators/rails/plugin/templates/lib/tasks/%namespaced_name%_tasks.rake.tt +4 -0
- data/lib/rails/generators/rails/plugin/templates/rails/boot.rb.tt +5 -0
- data/lib/rails/generators/rails/plugin/templates/rails/routes.rb.tt +3 -0
- data/lib/rails/generators/rails/plugin/templates/rails/stylesheets.css +15 -0
- data/lib/rails/generators/rails/plugin/templates/rubocop.yml.tt +8 -0
- data/lib/rails/generators/rails/plugin/templates/test/%namespaced_name%_test.rb.tt +7 -0
- data/lib/rails/generators/rails/plugin/templates/test/application_system_test_case.rb.tt +5 -0
- data/lib/rails/generators/rails/plugin/templates/test/integration/navigation_test.rb.tt +7 -0
- data/lib/rails/generators/rails/plugin/templates/test/test_helper.rb.tt +21 -0
- data/lib/rails/generators/rails/resource/USAGE +23 -0
- data/lib/rails/generators/rails/resource/resource_generator.rb +27 -0
- data/lib/rails/generators/rails/resource_route/resource_route_generator.rb +23 -0
- data/lib/rails/generators/rails/scaffold/USAGE +41 -0
- data/lib/rails/generators/rails/scaffold/scaffold_generator.rb +18 -0
- data/lib/rails/generators/rails/scaffold_controller/USAGE +19 -0
- data/lib/rails/generators/rails/scaffold_controller/scaffold_controller_generator.rb +56 -0
- data/lib/rails/generators/rails/scaffold_controller/templates/api_controller.rb.tt +57 -0
- data/lib/rails/generators/rails/scaffold_controller/templates/controller.rb.tt +64 -0
- data/lib/rails/generators/rails/script/USAGE +18 -0
- data/lib/rails/generators/rails/script/script_generator.rb +18 -0
- data/lib/rails/generators/rails/script/templates/script.rb.tt +3 -0
- data/lib/rails/generators/rails/system_test/USAGE +10 -0
- data/lib/rails/generators/rails/system_test/system_test_generator.rb +9 -0
- data/lib/rails/generators/rails/task/USAGE +9 -0
- data/lib/rails/generators/rails/task/task_generator.rb +13 -0
- data/lib/rails/generators/rails/task/templates/task.rb.tt +8 -0
- data/lib/rails/generators/resource_helpers.rb +82 -0
- data/lib/rails/generators/test_case.rb +37 -0
- data/lib/rails/generators/test_unit/controller/controller_generator.rb +19 -0
- data/lib/rails/generators/test_unit/controller/templates/functional_test.rb.tt +23 -0
- data/lib/rails/generators/test_unit/generator/generator_generator.rb +27 -0
- data/lib/rails/generators/test_unit/generator/templates/generator_test.rb.tt +16 -0
- data/lib/rails/generators/test_unit/helper/helper_generator.rb +11 -0
- data/lib/rails/generators/test_unit/integration/integration_generator.rb +20 -0
- data/lib/rails/generators/test_unit/integration/templates/integration_test.rb.tt +9 -0
- data/lib/rails/generators/test_unit/job/job_generator.rb +20 -0
- data/lib/rails/generators/test_unit/job/templates/unit_test.rb.tt +9 -0
- data/lib/rails/generators/test_unit/mailer/mailer_generator.rb +28 -0
- data/lib/rails/generators/test_unit/mailer/templates/functional_test.rb.tt +23 -0
- data/lib/rails/generators/test_unit/mailer/templates/preview.rb.tt +14 -0
- data/lib/rails/generators/test_unit/model/model_generator.rb +37 -0
- data/lib/rails/generators/test_unit/model/templates/fixtures.yml.tt +29 -0
- data/lib/rails/generators/test_unit/model/templates/unit_test.rb.tt +9 -0
- data/lib/rails/generators/test_unit/plugin/plugin_generator.rb +15 -0
- data/lib/rails/generators/test_unit/plugin/templates/%file_name%_test.rb.tt +7 -0
- data/lib/rails/generators/test_unit/plugin/templates/test_helper.rb +2 -0
- data/lib/rails/generators/test_unit/scaffold/scaffold_generator.rb +82 -0
- data/lib/rails/generators/test_unit/scaffold/templates/api_functional_test.rb.tt +44 -0
- data/lib/rails/generators/test_unit/scaffold/templates/functional_test.rb.tt +54 -0
- data/lib/rails/generators/test_unit/scaffold/templates/system_test.rb.tt +57 -0
- data/lib/rails/generators/test_unit/system/system_generator.rb +24 -0
- data/lib/rails/generators/test_unit/system/templates/application_system_test_case.rb.tt +5 -0
- data/lib/rails/generators/test_unit/system/templates/system_test.rb.tt +9 -0
- data/lib/rails/generators/test_unit.rb +10 -0
- data/lib/rails/generators/testing/assertions.rb +147 -0
- data/lib/rails/generators/testing/behavior.rb +116 -0
- data/lib/rails/generators/testing/setup_and_teardown.rb +20 -0
- data/lib/rails/generators.rb +327 -0
- data/lib/rails/health_controller.rb +55 -0
- data/lib/rails/info.rb +105 -0
- data/lib/rails/info_controller.rb +71 -0
- data/lib/rails/initializable.rb +95 -0
- data/lib/rails/mailers_controller.rb +122 -0
- data/lib/rails/paths.rb +246 -0
- data/lib/rails/plugin/test.rb +9 -0
- data/lib/rails/pwa_controller.rb +15 -0
- data/lib/rails/rack/logger.rb +88 -0
- data/lib/rails/rack/silence_request.rb +33 -0
- data/lib/rails/rack.rb +8 -0
- data/lib/rails/rackup/server.rb +15 -0
- data/lib/rails/railtie/configurable.rb +36 -0
- data/lib/rails/railtie/configuration.rb +114 -0
- data/lib/rails/railtie.rb +302 -0
- data/lib/rails/source_annotation_extractor.rb +214 -0
- data/lib/rails/tasks/engine.rake +85 -0
- data/lib/rails/tasks/framework.rake +34 -0
- data/lib/rails/tasks/log.rake +41 -0
- data/lib/rails/tasks/misc.rake +68 -0
- data/lib/rails/tasks/statistics.rake +23 -0
- data/lib/rails/tasks/tmp.rake +51 -0
- data/lib/rails/tasks/yarn.rake +29 -0
- data/lib/rails/tasks/zeitwerk.rake +41 -0
- data/lib/rails/tasks.rb +17 -0
- data/lib/rails/templates/layouts/application.html.erb +51 -0
- data/lib/rails/templates/rails/info/notes.html.erb +65 -0
- data/lib/rails/templates/rails/info/properties.html.erb +1 -0
- data/lib/rails/templates/rails/info/routes.html.erb +9 -0
- data/lib/rails/templates/rails/mailers/email.html.erb +201 -0
- data/lib/rails/templates/rails/mailers/index.html.erb +15 -0
- data/lib/rails/templates/rails/mailers/mailer.html.erb +12 -0
- data/lib/rails/templates/rails/welcome/index.html.erb +93 -0
- data/lib/rails/test_help.rb +47 -0
- data/lib/rails/test_unit/line_filtering.rb +13 -0
- data/lib/rails/test_unit/railtie.rb +25 -0
- data/lib/rails/test_unit/reporter.rb +121 -0
- data/lib/rails/test_unit/runner.rb +209 -0
- data/lib/rails/test_unit/test_parser.rb +133 -0
- data/lib/rails/test_unit/testing.rake +39 -0
- data/lib/rails/testing/maintain_test_schema.rb +16 -0
- data/lib/rails/version.rb +10 -0
- data/lib/rails/welcome_controller.rb +11 -0
- data/lib/rails/zeitwerk_checker.rb +15 -0
- data/lib/rails.rb +130 -0
- metadata +518 -0
@@ -0,0 +1,23 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Rails
|
4
|
+
module ConsoleMethods
|
5
|
+
def self.include(_mod, ...)
|
6
|
+
raise_deprecation_warning
|
7
|
+
super
|
8
|
+
end
|
9
|
+
|
10
|
+
def self.method_added(_method_name)
|
11
|
+
raise_deprecation_warning
|
12
|
+
super
|
13
|
+
end
|
14
|
+
|
15
|
+
def self.raise_deprecation_warning
|
16
|
+
Rails.deprecator.warn(<<~MSG, caller_locations(2..2))
|
17
|
+
Extending Rails console through `Rails::ConsoleMethods` is deprecated and will be removed in Rails 8.0.
|
18
|
+
Please directly use IRB's extension API to add new commands or helpers to the console.
|
19
|
+
For more details, please visit: https://github.com/ruby/irb/blob/master/EXTEND_IRB.md
|
20
|
+
MSG
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,44 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "fileutils"
|
4
|
+
|
5
|
+
module Rails
|
6
|
+
module DevCaching # :nodoc:
|
7
|
+
class << self
|
8
|
+
FILE = "tmp/caching-dev.txt"
|
9
|
+
|
10
|
+
def enable_by_file
|
11
|
+
FileUtils.mkdir_p("tmp")
|
12
|
+
|
13
|
+
if File.exist?(FILE)
|
14
|
+
delete_cache_file
|
15
|
+
puts "Action Controller caching disabled for development mode."
|
16
|
+
else
|
17
|
+
create_cache_file
|
18
|
+
puts "Action Controller caching enabled for development mode."
|
19
|
+
end
|
20
|
+
|
21
|
+
FileUtils.touch "tmp/restart.txt"
|
22
|
+
end
|
23
|
+
|
24
|
+
def enable_by_argument(caching)
|
25
|
+
FileUtils.mkdir_p("tmp")
|
26
|
+
|
27
|
+
if caching
|
28
|
+
create_cache_file
|
29
|
+
elsif caching == false && File.exist?(FILE)
|
30
|
+
delete_cache_file
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
private
|
35
|
+
def create_cache_file
|
36
|
+
FileUtils.touch FILE
|
37
|
+
end
|
38
|
+
|
39
|
+
def delete_cache_file
|
40
|
+
File.delete FILE
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
@@ -0,0 +1,138 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "rails/railtie/configuration"
|
4
|
+
|
5
|
+
module Rails
|
6
|
+
class Engine
|
7
|
+
class Configuration < ::Rails::Railtie::Configuration
|
8
|
+
attr_reader :root
|
9
|
+
attr_accessor :middleware, :javascript_path, :route_set_class, :default_scope
|
10
|
+
attr_writer :eager_load_paths, :autoload_once_paths, :autoload_paths
|
11
|
+
|
12
|
+
# An array of custom autoload paths to be added to the ones defined
|
13
|
+
# automatically by Rails. These won't be eager loaded, unless you push
|
14
|
+
# them to +eager_load_paths+ too, which is recommended.
|
15
|
+
#
|
16
|
+
# This collection is empty by default, it accepts strings and +Pathname+
|
17
|
+
# objects.
|
18
|
+
#
|
19
|
+
# If you'd like to add +lib+ to it, please see +autoload_lib+.
|
20
|
+
attr_reader :autoload_paths
|
21
|
+
|
22
|
+
# An array of custom autoload once paths. These won't be eager loaded
|
23
|
+
# unless you push them to +eager_load_paths+ too, which is recommended.
|
24
|
+
#
|
25
|
+
# This collection is empty by default, it accepts strings and +Pathname+
|
26
|
+
# objects.
|
27
|
+
#
|
28
|
+
# If you'd like to add +lib+ to it, please see +autoload_lib_once+.
|
29
|
+
attr_reader :autoload_once_paths
|
30
|
+
|
31
|
+
# An array of custom eager load paths to be added to the ones defined
|
32
|
+
# automatically by Rails. Anything in this collection is considered to be
|
33
|
+
# an autoload path regardless of whether it was added to +autoload_paths+.
|
34
|
+
#
|
35
|
+
# This collection is empty by default, it accepts strings and +Pathname+
|
36
|
+
# objects.
|
37
|
+
#
|
38
|
+
# If you'd like to add +lib+ to it, please see +autoload_lib+.
|
39
|
+
attr_reader :eager_load_paths
|
40
|
+
|
41
|
+
def initialize(root = nil)
|
42
|
+
super()
|
43
|
+
@root = root
|
44
|
+
@generators = app_generators.dup
|
45
|
+
@middleware = Rails::Configuration::MiddlewareStackProxy.new
|
46
|
+
@javascript_path = "javascript"
|
47
|
+
@route_set_class = ActionDispatch::Routing::RouteSet
|
48
|
+
@default_scope = nil
|
49
|
+
|
50
|
+
@autoload_paths = []
|
51
|
+
@autoload_once_paths = []
|
52
|
+
@eager_load_paths = []
|
53
|
+
end
|
54
|
+
|
55
|
+
# Holds generators configuration:
|
56
|
+
#
|
57
|
+
# config.generators do |g|
|
58
|
+
# g.orm :data_mapper, migration: true
|
59
|
+
# g.template_engine :haml
|
60
|
+
# g.test_framework :rspec
|
61
|
+
# end
|
62
|
+
#
|
63
|
+
# If you want to disable color in console, do:
|
64
|
+
#
|
65
|
+
# config.generators.colorize_logging = false
|
66
|
+
#
|
67
|
+
def generators
|
68
|
+
@generators ||= Rails::Configuration::Generators.new
|
69
|
+
yield(@generators) if block_given?
|
70
|
+
@generators
|
71
|
+
end
|
72
|
+
|
73
|
+
def paths
|
74
|
+
@paths ||= begin
|
75
|
+
paths = Rails::Paths::Root.new(@root)
|
76
|
+
|
77
|
+
paths.add "app", eager_load: true,
|
78
|
+
glob: "{*,*/concerns}",
|
79
|
+
exclude: ["assets", javascript_path]
|
80
|
+
paths.add "app/assets", glob: "*"
|
81
|
+
paths.add "app/controllers", eager_load: true
|
82
|
+
paths.add "app/channels", eager_load: true
|
83
|
+
paths.add "app/helpers", eager_load: true
|
84
|
+
paths.add "app/models", eager_load: true
|
85
|
+
paths.add "app/mailers", eager_load: true
|
86
|
+
paths.add "app/views"
|
87
|
+
|
88
|
+
# If you add more lib subdirectories here that should not be managed
|
89
|
+
# by the main autoloader, please update the config.autoload_lib call
|
90
|
+
# in the template that generates config/application.rb accordingly.
|
91
|
+
paths.add "lib", load_path: true
|
92
|
+
paths.add "lib/assets", glob: "*"
|
93
|
+
paths.add "lib/tasks", glob: "**/*.rake"
|
94
|
+
|
95
|
+
paths.add "config"
|
96
|
+
paths.add "config/environments", glob: -"#{Rails.env}.rb"
|
97
|
+
paths.add "config/initializers", glob: "**/*.rb"
|
98
|
+
paths.add "config/locales", glob: "**/*.{rb,yml}"
|
99
|
+
paths.add "config/routes.rb"
|
100
|
+
paths.add "config/routes", glob: "**/*.rb"
|
101
|
+
|
102
|
+
paths.add "db"
|
103
|
+
paths.add "db/migrate"
|
104
|
+
paths.add "db/seeds.rb"
|
105
|
+
|
106
|
+
paths.add "vendor", load_path: true
|
107
|
+
paths.add "vendor/assets", glob: "*"
|
108
|
+
|
109
|
+
paths.add "test/mailers/previews", autoload: true
|
110
|
+
|
111
|
+
paths
|
112
|
+
end
|
113
|
+
end
|
114
|
+
|
115
|
+
def root=(value)
|
116
|
+
@root = paths.path = Pathname.new(value).expand_path
|
117
|
+
end
|
118
|
+
|
119
|
+
# Private method that adds custom autoload paths to the ones defined by
|
120
|
+
# +paths+.
|
121
|
+
def all_autoload_paths # :nodoc:
|
122
|
+
autoload_paths + paths.autoload_paths
|
123
|
+
end
|
124
|
+
|
125
|
+
# Private method that adds custom autoload once paths to the ones defined
|
126
|
+
# by +paths+.
|
127
|
+
def all_autoload_once_paths # :nodoc:
|
128
|
+
autoload_once_paths + paths.autoload_once
|
129
|
+
end
|
130
|
+
|
131
|
+
# Private method that adds custom eager load paths to the ones defined by
|
132
|
+
# +paths+.
|
133
|
+
def all_eager_load_paths # :nodoc:
|
134
|
+
eager_load_paths + paths.eager_load
|
135
|
+
end
|
136
|
+
end
|
137
|
+
end
|
138
|
+
end
|
@@ -0,0 +1,109 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# :markup: markdown
|
4
|
+
|
5
|
+
require "action_dispatch/routing/route_set"
|
6
|
+
|
7
|
+
module Rails
|
8
|
+
class Engine
|
9
|
+
class LazyRouteSet < ActionDispatch::Routing::RouteSet # :nodoc:
|
10
|
+
class NamedRouteCollection < ActionDispatch::Routing::RouteSet::NamedRouteCollection
|
11
|
+
def route_defined?(name)
|
12
|
+
Rails.application&.reload_routes_unless_loaded
|
13
|
+
super
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
module ProxyUrlHelpers
|
18
|
+
def url_for(options)
|
19
|
+
Rails.application&.reload_routes_unless_loaded
|
20
|
+
super
|
21
|
+
end
|
22
|
+
|
23
|
+
def full_url_for(options)
|
24
|
+
Rails.application&.reload_routes_unless_loaded
|
25
|
+
super
|
26
|
+
end
|
27
|
+
|
28
|
+
def route_for(name, *args)
|
29
|
+
Rails.application&.reload_routes_unless_loaded
|
30
|
+
super
|
31
|
+
end
|
32
|
+
|
33
|
+
def optimize_routes_generation?
|
34
|
+
Rails.application&.reload_routes_unless_loaded
|
35
|
+
super
|
36
|
+
end
|
37
|
+
|
38
|
+
def polymorphic_url(record_or_hash_or_array, options = {})
|
39
|
+
Rails.application&.reload_routes_unless_loaded
|
40
|
+
super
|
41
|
+
end
|
42
|
+
|
43
|
+
def polymorphic_path(record_or_hash_or_array, options = {})
|
44
|
+
Rails.application&.reload_routes_unless_loaded
|
45
|
+
super
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
def initialize(config = DEFAULT_CONFIG)
|
50
|
+
super
|
51
|
+
self.named_routes = NamedRouteCollection.new
|
52
|
+
named_routes.url_helpers_module.prepend(method_missing_module)
|
53
|
+
named_routes.path_helpers_module.prepend(method_missing_module)
|
54
|
+
end
|
55
|
+
|
56
|
+
def generate_extras(options, recall = {})
|
57
|
+
Rails.application&.reload_routes_unless_loaded
|
58
|
+
|
59
|
+
super(options, recall)
|
60
|
+
end
|
61
|
+
|
62
|
+
def generate_url_helpers(supports_path)
|
63
|
+
super.tap { |mod| mod.singleton_class.prepend(ProxyUrlHelpers) }
|
64
|
+
end
|
65
|
+
|
66
|
+
def call(req)
|
67
|
+
Rails.application&.reload_routes_unless_loaded
|
68
|
+
super
|
69
|
+
end
|
70
|
+
|
71
|
+
def draw(&block)
|
72
|
+
Rails.application&.reload_routes_unless_loaded
|
73
|
+
super
|
74
|
+
end
|
75
|
+
|
76
|
+
def recognize_path(path, environment = {})
|
77
|
+
Rails.application&.reload_routes_unless_loaded
|
78
|
+
super
|
79
|
+
end
|
80
|
+
|
81
|
+
def routes
|
82
|
+
Rails.application&.reload_routes_unless_loaded
|
83
|
+
super
|
84
|
+
end
|
85
|
+
|
86
|
+
private
|
87
|
+
def method_missing_module
|
88
|
+
@method_missing_module ||= Module.new do
|
89
|
+
private
|
90
|
+
def method_missing(method_name, *args, &block)
|
91
|
+
if Rails.application&.reload_routes_unless_loaded
|
92
|
+
public_send(method_name, *args, &block)
|
93
|
+
else
|
94
|
+
super(method_name, *args, &block)
|
95
|
+
end
|
96
|
+
end
|
97
|
+
|
98
|
+
def respond_to_missing?(method_name, *args)
|
99
|
+
if Rails.application&.reload_routes_unless_loaded
|
100
|
+
respond_to?(method_name, *args)
|
101
|
+
else
|
102
|
+
super(method_name, *args)
|
103
|
+
end
|
104
|
+
end
|
105
|
+
end
|
106
|
+
end
|
107
|
+
end
|
108
|
+
end
|
109
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Rails
|
4
|
+
class Engine < Railtie
|
5
|
+
class Railties
|
6
|
+
include Enumerable
|
7
|
+
attr_reader :_all
|
8
|
+
|
9
|
+
def initialize
|
10
|
+
@_all ||= ::Rails::Railtie.subclasses.map(&:instance) +
|
11
|
+
::Rails::Engine.subclasses.map(&:instance)
|
12
|
+
end
|
13
|
+
|
14
|
+
def each(*args, &block)
|
15
|
+
_all.each(*args, &block)
|
16
|
+
end
|
17
|
+
|
18
|
+
def -(others)
|
19
|
+
_all - others
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "rails/generators"
|
4
|
+
require "rails/generators/rails/plugin/plugin_generator"
|
5
|
+
|
6
|
+
module Rails
|
7
|
+
class Engine
|
8
|
+
class Updater
|
9
|
+
class << self
|
10
|
+
def generator
|
11
|
+
@generator ||= Rails::Generators::PluginGenerator.new ["plugin"],
|
12
|
+
{ engine: true }, { destination_root: ENGINE_ROOT }
|
13
|
+
end
|
14
|
+
|
15
|
+
def run(action)
|
16
|
+
generator.public_send(action)
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|