railties 7.0.8.6 → 7.1.0.beta1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +572 -226
- data/MIT-LICENSE +1 -1
- data/RDOC_MAIN.md +99 -0
- data/README.rdoc +4 -4
- data/lib/minitest/rails_plugin.rb +63 -0
- data/lib/rails/api/task.rb +35 -4
- data/lib/rails/app_updater.rb +1 -1
- data/lib/rails/application/bootstrap.rb +12 -3
- data/lib/rails/application/configuration.rb +179 -67
- data/lib/rails/application/default_middleware_stack.rb +8 -2
- data/lib/rails/application/dummy_config.rb +19 -0
- data/lib/rails/application/finisher.rb +40 -33
- data/lib/rails/application.rb +112 -24
- data/lib/rails/backtrace_cleaner.rb +1 -1
- data/lib/rails/cli.rb +5 -2
- data/lib/rails/command/actions.rb +10 -12
- data/lib/rails/command/base.rb +55 -53
- data/lib/rails/command/environment_argument.rb +32 -16
- data/lib/rails/command/helpers/editor.rb +17 -12
- data/lib/rails/command.rb +84 -33
- data/lib/rails/commands/about/about_command.rb +14 -0
- data/lib/rails/commands/application/application_command.rb +2 -0
- data/lib/rails/commands/console/console_command.rb +14 -14
- data/lib/rails/commands/credentials/USAGE +53 -55
- data/lib/rails/commands/credentials/credentials_command/diffing.rb +5 -3
- data/lib/rails/commands/credentials/credentials_command.rb +64 -70
- data/lib/rails/commands/db/system/change/change_command.rb +2 -1
- data/lib/rails/commands/dbconsole/dbconsole_command.rb +25 -115
- data/lib/rails/commands/destroy/destroy_command.rb +3 -2
- data/lib/rails/commands/dev/dev_command.rb +1 -6
- data/lib/rails/commands/encrypted/USAGE +15 -20
- data/lib/rails/commands/encrypted/encrypted_command.rb +46 -35
- 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 +2 -2
- data/lib/rails/commands/help/USAGE +13 -13
- data/lib/rails/commands/help/help_command.rb +21 -2
- data/lib/rails/commands/initializers/initializers_command.rb +1 -4
- data/lib/rails/commands/middleware/middleware_command.rb +17 -0
- data/lib/rails/commands/new/new_command.rb +2 -0
- data/lib/rails/commands/notes/notes_command.rb +2 -1
- data/lib/rails/commands/plugin/plugin_command.rb +2 -0
- data/lib/rails/commands/rake/rake_command.rb +25 -22
- data/lib/rails/commands/restart/restart_command.rb +14 -0
- data/lib/rails/commands/routes/routes_command.rb +13 -1
- data/lib/rails/commands/runner/USAGE +14 -12
- data/lib/rails/commands/runner/runner_command.rb +32 -20
- data/lib/rails/commands/secret/secret_command.rb +13 -0
- data/lib/rails/commands/secrets/USAGE +44 -49
- data/lib/rails/commands/secrets/secrets_command.rb +19 -38
- data/lib/rails/commands/server/server_command.rb +32 -31
- data/lib/rails/commands/test/USAGE +14 -0
- data/lib/rails/commands/test/test_command.rb +56 -14
- data/lib/rails/commands/unused_routes/unused_routes_command.rb +75 -0
- data/lib/rails/commands/version/version_command.rb +1 -0
- data/lib/rails/configuration.rb +5 -5
- data/lib/rails/console/app.rb +1 -4
- data/lib/rails/deprecator.rb +7 -0
- data/lib/rails/engine/configuration.rb +5 -0
- data/lib/rails/engine.rb +32 -11
- data/lib/rails/gem_version.rb +4 -4
- data/lib/rails/generators/actions.rb +6 -15
- data/lib/rails/generators/active_model.rb +2 -2
- data/lib/rails/generators/app_base.rb +354 -83
- data/lib/rails/generators/app_name.rb +3 -14
- data/lib/rails/generators/base.rb +12 -4
- data/lib/rails/generators/database.rb +19 -1
- data/lib/rails/generators/erb/mailer/templates/layout.html.erb.tt +1 -1
- data/lib/rails/generators/generated_attribute.rb +2 -0
- data/lib/rails/generators/migration.rb +1 -2
- data/lib/rails/generators/model_helpers.rb +2 -1
- data/lib/rails/generators/rails/app/USAGE +15 -6
- data/lib/rails/generators/rails/app/app_generator.rb +84 -60
- data/lib/rails/generators/rails/app/templates/Dockerfile.tt +107 -0
- data/lib/rails/generators/rails/app/templates/Gemfile.tt +8 -10
- data/lib/rails/generators/rails/app/templates/app/views/layouts/mailer.html.erb.tt +1 -1
- data/lib/rails/generators/rails/app/templates/bin/setup.tt +10 -1
- data/lib/rails/generators/rails/app/templates/config/application.rb.tt +4 -17
- data/lib/rails/generators/rails/app/templates/config/databases/jdbcsqlite3.yml.tt +3 -3
- data/lib/rails/generators/rails/app/templates/config/databases/postgresql.yml.tt +0 -2
- data/lib/rails/generators/rails/app/templates/config/databases/sqlite3.yml.tt +3 -3
- data/lib/rails/generators/rails/app/templates/config/databases/trilogy.yml.tt +59 -0
- data/lib/rails/generators/rails/app/templates/config/environments/development.rb.tt +10 -2
- data/lib/rails/generators/rails/app/templates/config/environments/production.rb.tt +28 -24
- data/lib/rails/generators/rails/app/templates/config/environments/test.rb.tt +11 -7
- data/lib/rails/generators/rails/app/templates/config/initializers/assets.rb.tt +2 -0
- data/lib/rails/generators/rails/app/templates/config/initializers/content_security_policy.rb.tt +2 -2
- data/lib/rails/generators/rails/app/templates/config/initializers/cors.rb.tt +1 -1
- data/lib/rails/generators/rails/app/templates/config/initializers/new_framework_defaults_7_1.rb.tt +223 -0
- data/lib/rails/generators/rails/app/templates/config/initializers/permissions_policy.rb.tt +11 -9
- data/lib/rails/generators/rails/app/templates/config/locales/en.yml +11 -13
- data/lib/rails/generators/rails/app/templates/config/puma.rb.tt +10 -19
- data/lib/rails/generators/rails/app/templates/config/routes.rb.tt +4 -0
- data/lib/rails/generators/rails/app/templates/db/seeds.rb.tt +6 -4
- data/lib/rails/generators/rails/app/templates/docker-entrypoint.tt +10 -0
- data/lib/rails/generators/rails/app/templates/dockerignore.tt +43 -0
- data/lib/rails/generators/rails/app/templates/gitignore.tt +1 -9
- data/lib/rails/generators/rails/app/templates/node-version.tt +1 -0
- data/lib/rails/generators/rails/app/templates/test/channels/application_cable/connection_test.rb.tt +10 -8
- data/lib/rails/generators/rails/app/templates/test/test_helper.rb.tt +9 -7
- data/lib/rails/generators/rails/application_record/application_record_generator.rb +4 -0
- data/lib/rails/generators/rails/benchmark/benchmark_generator.rb +2 -1
- data/lib/rails/generators/rails/controller/USAGE +12 -4
- data/lib/rails/generators/rails/controller/controller_generator.rb +5 -0
- data/lib/rails/generators/rails/controller/templates/controller.rb.tt +1 -1
- data/lib/rails/generators/rails/credentials/credentials_generator.rb +29 -24
- data/lib/rails/generators/rails/credentials/templates/credentials.yml.tt +8 -0
- data/lib/rails/generators/rails/encryption_key_file/encryption_key_file_generator.rb +1 -2
- data/lib/rails/generators/rails/migration/USAGE +21 -11
- data/lib/rails/generators/rails/model/model_generator.rb +4 -0
- data/lib/rails/generators/rails/plugin/USAGE +17 -6
- data/lib/rails/generators/rails/plugin/plugin_generator.rb +5 -15
- data/lib/rails/generators/rails/plugin/templates/Gemfile.tt +2 -2
- data/lib/rails/generators/rails/plugin/templates/MIT-LICENSE.tt +1 -1
- data/lib/rails/generators/rails/plugin/templates/bin/rails.tt +1 -17
- data/lib/rails/generators/rails/plugin/templates/gitignore.tt +0 -2
- data/lib/rails/generators/rails/plugin/templates/test/test_helper.rb.tt +4 -4
- data/lib/rails/generators/rails/resource/resource_generator.rb +6 -0
- data/lib/rails/generators/rails/scaffold/scaffold_generator.rb +2 -1
- data/lib/rails/generators/rails/scaffold_controller/scaffold_controller_generator.rb +1 -1
- data/lib/rails/generators/test_case.rb +2 -2
- data/lib/rails/generators/test_unit/scaffold/scaffold_generator.rb +1 -1
- data/lib/rails/generators/testing/{behaviour.rb → behavior.rb} +4 -1
- data/lib/rails/generators.rb +5 -13
- data/lib/rails/health_controller.rb +55 -0
- data/lib/rails/info.rb +1 -1
- data/lib/rails/info_controller.rb +31 -11
- data/lib/rails/mailers_controller.rb +15 -5
- data/lib/rails/paths.rb +13 -10
- data/lib/rails/rack/logger.rb +15 -12
- data/lib/rails/rackup/server.rb +15 -0
- data/lib/rails/railtie/configuration.rb +14 -1
- data/lib/rails/railtie.rb +18 -18
- data/lib/rails/ruby_version_check.rb +2 -0
- data/lib/rails/source_annotation_extractor.rb +67 -18
- data/lib/rails/tasks/engine.rake +8 -8
- data/lib/rails/tasks/framework.rake +4 -10
- data/lib/rails/tasks/log.rake +1 -1
- data/lib/rails/tasks/misc.rake +3 -14
- data/lib/rails/tasks/statistics.rake +5 -4
- data/lib/rails/tasks/tmp.rake +5 -5
- data/lib/rails/tasks/zeitwerk.rake +1 -1
- data/lib/rails/tasks.rb +0 -2
- data/lib/rails/templates/rails/mailers/email.html.erb +25 -0
- data/lib/rails/templates/rails/mailers/index.html.erb +14 -7
- data/lib/rails/templates/rails/mailers/mailer.html.erb +11 -5
- data/lib/rails/templates/rails/welcome/index.html.erb +1 -0
- data/lib/rails/test_help.rb +7 -7
- data/lib/rails/test_unit/line_filtering.rb +1 -1
- data/lib/rails/test_unit/reporter.rb +6 -2
- data/lib/rails/test_unit/runner.rb +36 -18
- data/lib/rails/test_unit/test_parser.rb +88 -0
- data/lib/rails/test_unit/testing.rake +13 -33
- data/lib/rails/version.rb +1 -1
- data/lib/rails.rb +15 -15
- metadata +69 -34
- data/RDOC_MAIN.rdoc +0 -97
- data/lib/rails/application/dummy_erb_compiler.rb +0 -18
- data/lib/rails/generators/rails/app/templates/config/initializers/new_framework_defaults_7_0.rb.tt +0 -143
- data/lib/rails/generators/rails/model/USAGE +0 -113
- data/lib/rails/tasks/middleware.rake +0 -9
- data/lib/rails/tasks/restart.rake +0 -9
@@ -0,0 +1,88 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "ripper"
|
4
|
+
|
5
|
+
module Rails
|
6
|
+
module TestUnit
|
7
|
+
# Parse a test file to extract the line ranges of all tests in both
|
8
|
+
# method-style (def test_foo) and declarative-style (test "foo" do)
|
9
|
+
class TestParser < Ripper # :nodoc:
|
10
|
+
# Helper to translate a method object into the path and line range where
|
11
|
+
# the method was defined.
|
12
|
+
def self.definition_for(method_obj)
|
13
|
+
path, begin_line = method_obj.source_location
|
14
|
+
begins_to_ends = new(File.read(path), path).parse
|
15
|
+
return unless end_line = begins_to_ends[begin_line]
|
16
|
+
[path, (begin_line..end_line)]
|
17
|
+
end
|
18
|
+
|
19
|
+
def initialize(*)
|
20
|
+
# A hash mapping the 1-indexed line numbers that tests start on to where they end.
|
21
|
+
@begins_to_ends = {}
|
22
|
+
super
|
23
|
+
end
|
24
|
+
|
25
|
+
def parse
|
26
|
+
super
|
27
|
+
@begins_to_ends
|
28
|
+
end
|
29
|
+
|
30
|
+
# method test e.g. `def test_some_description`
|
31
|
+
# This event's first argument gets the `ident` node containing the method
|
32
|
+
# name, which we have overridden to return the line number of the ident
|
33
|
+
# instead.
|
34
|
+
def on_def(begin_line, *)
|
35
|
+
@begins_to_ends[begin_line] = lineno
|
36
|
+
end
|
37
|
+
|
38
|
+
# Everything past this point is to support declarative tests, which
|
39
|
+
# require more work to get right because of the many different ways
|
40
|
+
# methods can be invoked in ruby, all of which are parsed differently.
|
41
|
+
#
|
42
|
+
# The approach is just to store the current line number when the
|
43
|
+
# "test" method is called and pass it up the tree so it's available at
|
44
|
+
# the point when we also know the line where the associated block ends.
|
45
|
+
|
46
|
+
def on_method_add_block(begin_line, end_line)
|
47
|
+
if begin_line && end_line
|
48
|
+
@begins_to_ends[begin_line] = end_line
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
def on_command_call(*, begin_lineno, _args)
|
53
|
+
begin_lineno
|
54
|
+
end
|
55
|
+
|
56
|
+
def first_arg(arg, *)
|
57
|
+
arg
|
58
|
+
end
|
59
|
+
|
60
|
+
def just_lineno(*)
|
61
|
+
lineno
|
62
|
+
end
|
63
|
+
|
64
|
+
alias on_method_add_arg first_arg
|
65
|
+
alias on_command first_arg
|
66
|
+
alias on_stmts_add first_arg
|
67
|
+
alias on_arg_paren first_arg
|
68
|
+
alias on_bodystmt first_arg
|
69
|
+
|
70
|
+
alias on_ident just_lineno
|
71
|
+
alias on_do_block just_lineno
|
72
|
+
alias on_stmts_new just_lineno
|
73
|
+
alias on_brace_block just_lineno
|
74
|
+
|
75
|
+
def on_args_new
|
76
|
+
[]
|
77
|
+
end
|
78
|
+
|
79
|
+
def on_args_add(parts, part)
|
80
|
+
parts << part
|
81
|
+
end
|
82
|
+
|
83
|
+
def on_args_add_block(args, *rest)
|
84
|
+
args.first
|
85
|
+
end
|
86
|
+
end
|
87
|
+
end
|
88
|
+
end
|
@@ -1,18 +1,13 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
gem "minitest"
|
4
3
|
require "minitest"
|
5
4
|
require "rails/test_unit/runner"
|
6
5
|
|
7
6
|
task default: :test
|
8
7
|
|
9
|
-
desc "
|
8
|
+
desc "Run all tests in test folder except system ones"
|
10
9
|
task :test do
|
11
|
-
|
12
|
-
Rails::TestUnit::Runner.rake_run([ENV["TEST"]])
|
13
|
-
else
|
14
|
-
Rails::TestUnit::Runner.rake_run
|
15
|
-
end
|
10
|
+
Rails::TestUnit::Runner.run_from_rake("test", Array(ENV["TEST"]))
|
16
11
|
end
|
17
12
|
|
18
13
|
namespace :test do
|
@@ -23,37 +18,22 @@ namespace :test do
|
|
23
18
|
|
24
19
|
task run: %w[test]
|
25
20
|
|
26
|
-
desc "
|
21
|
+
desc "Reset the database and run `bin/rails test`"
|
27
22
|
task :db do
|
28
23
|
success = system({ "RAILS_ENV" => ENV.fetch("RAILS_ENV", "test") }, "rake", "db:test:prepare", "test")
|
29
24
|
success || exit(false)
|
30
25
|
end
|
31
26
|
|
32
|
-
[
|
33
|
-
|
34
|
-
|
27
|
+
[
|
28
|
+
*Rails::TestUnit::Runner::TEST_FOLDERS,
|
29
|
+
:all,
|
30
|
+
:generators,
|
31
|
+
:units,
|
32
|
+
:functionals,
|
33
|
+
:system,
|
34
|
+
].each do |name|
|
35
|
+
task name do
|
36
|
+
Rails::TestUnit::Runner.run_from_rake("test:#{name}")
|
35
37
|
end
|
36
38
|
end
|
37
|
-
|
38
|
-
desc "Runs all tests, including system tests"
|
39
|
-
task all: "test:prepare" do
|
40
|
-
Rails::TestUnit::Runner.rake_run(["test/**/*_test.rb"])
|
41
|
-
end
|
42
|
-
|
43
|
-
task generators: "test:prepare" do
|
44
|
-
Rails::TestUnit::Runner.rake_run(["test/lib/generators"])
|
45
|
-
end
|
46
|
-
|
47
|
-
task units: "test:prepare" do
|
48
|
-
Rails::TestUnit::Runner.rake_run(["test/models", "test/helpers", "test/unit"])
|
49
|
-
end
|
50
|
-
|
51
|
-
task functionals: "test:prepare" do
|
52
|
-
Rails::TestUnit::Runner.rake_run(["test/controllers", "test/mailers", "test/functional"])
|
53
|
-
end
|
54
|
-
|
55
|
-
desc "Run system tests only"
|
56
|
-
task system: "test:prepare" do
|
57
|
-
Rails::TestUnit::Runner.rake_run(["test/system"])
|
58
|
-
end
|
59
39
|
end
|
data/lib/rails/version.rb
CHANGED
data/lib/rails.rb
CHANGED
@@ -10,8 +10,10 @@ require "active_support/core_ext/module/delegation"
|
|
10
10
|
require "active_support/core_ext/array/extract_options"
|
11
11
|
require "active_support/core_ext/object/blank"
|
12
12
|
|
13
|
-
require "rails/application"
|
14
13
|
require "rails/version"
|
14
|
+
require "rails/deprecator"
|
15
|
+
require "rails/application"
|
16
|
+
require "rails/backtrace_cleaner"
|
15
17
|
|
16
18
|
require "active_support/railtie"
|
17
19
|
require "action_dispatch/railtie"
|
@@ -22,10 +24,12 @@ silence_warnings do
|
|
22
24
|
Encoding.default_internal = Encoding::UTF_8
|
23
25
|
end
|
24
26
|
|
27
|
+
# :include: railties/README.rdoc
|
25
28
|
module Rails
|
26
29
|
extend ActiveSupport::Autoload
|
27
30
|
extend ActiveSupport::Benchmarkable
|
28
31
|
|
32
|
+
autoload :HealthController
|
29
33
|
autoload :Info
|
30
34
|
autoload :InfoController
|
31
35
|
autoload :MailersController
|
@@ -42,20 +46,16 @@ module Rails
|
|
42
46
|
|
43
47
|
delegate :initialize!, :initialized?, to: :application
|
44
48
|
|
45
|
-
# The Configuration instance used to configure the Rails environment
|
49
|
+
# The Configuration instance used to configure the \Rails environment
|
46
50
|
def configuration
|
47
51
|
application.config
|
48
52
|
end
|
49
53
|
|
50
54
|
def backtrace_cleaner
|
51
|
-
@backtrace_cleaner ||=
|
52
|
-
# Relies on Active Support, so we have to lazy load to postpone definition until Active Support has been loaded
|
53
|
-
require "rails/backtrace_cleaner"
|
54
|
-
Rails::BacktraceCleaner.new
|
55
|
-
end
|
55
|
+
@backtrace_cleaner ||= Rails::BacktraceCleaner.new
|
56
56
|
end
|
57
57
|
|
58
|
-
# Returns a Pathname object of the current Rails project,
|
58
|
+
# Returns a Pathname object of the current \Rails project,
|
59
59
|
# otherwise it returns +nil+ if there is no project:
|
60
60
|
#
|
61
61
|
# Rails.root
|
@@ -64,7 +64,7 @@ module Rails
|
|
64
64
|
application && application.config.root
|
65
65
|
end
|
66
66
|
|
67
|
-
# Returns the current Rails environment.
|
67
|
+
# Returns the current \Rails environment.
|
68
68
|
#
|
69
69
|
# Rails.env # => "development"
|
70
70
|
# Rails.env.development? # => true
|
@@ -73,14 +73,14 @@ module Rails
|
|
73
73
|
@_env ||= ActiveSupport::EnvironmentInquirer.new(ENV["RAILS_ENV"].presence || ENV["RACK_ENV"].presence || "development")
|
74
74
|
end
|
75
75
|
|
76
|
-
# Sets the Rails environment.
|
76
|
+
# Sets the \Rails environment.
|
77
77
|
#
|
78
78
|
# Rails.env = "staging" # => "staging"
|
79
79
|
def env=(environment)
|
80
80
|
@_env = ActiveSupport::EnvironmentInquirer.new(environment)
|
81
81
|
end
|
82
82
|
|
83
|
-
# Returns the ActiveSupport::ErrorReporter of the current Rails project,
|
83
|
+
# Returns the ActiveSupport::ErrorReporter of the current \Rails project,
|
84
84
|
# otherwise it returns +nil+ if there is no project.
|
85
85
|
#
|
86
86
|
# Rails.error.handle(IOError) do
|
@@ -88,12 +88,12 @@ module Rails
|
|
88
88
|
# end
|
89
89
|
# Rails.error.report(error)
|
90
90
|
def error
|
91
|
-
|
91
|
+
ActiveSupport.error_reporter
|
92
92
|
end
|
93
93
|
|
94
|
-
# Returns all Rails groups for loading based on:
|
94
|
+
# Returns all \Rails groups for loading based on:
|
95
95
|
#
|
96
|
-
# * The Rails environment;
|
96
|
+
# * The \Rails environment;
|
97
97
|
# * The environment variable RAILS_GROUPS;
|
98
98
|
# * The optional envs given as argument and the hash with group dependencies;
|
99
99
|
#
|
@@ -112,7 +112,7 @@ module Rails
|
|
112
112
|
end
|
113
113
|
|
114
114
|
# Returns a Pathname object of the public folder of the current
|
115
|
-
# Rails project, otherwise it returns +nil+ if there is no project:
|
115
|
+
# \Rails project, otherwise it returns +nil+ if there is no project:
|
116
116
|
#
|
117
117
|
# Rails.public_path
|
118
118
|
# # => #<Pathname:/Users/someuser/some/path/project/public>
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: railties
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 7.0.
|
4
|
+
version: 7.1.0.beta1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Heinemeier Hansson
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-09-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -16,28 +16,42 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 7.0.
|
19
|
+
version: 7.1.0.beta1
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - '='
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 7.0.
|
26
|
+
version: 7.1.0.beta1
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: actionpack
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - '='
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 7.0.
|
33
|
+
version: 7.1.0.beta1
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - '='
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 7.0.
|
40
|
+
version: 7.1.0.beta1
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rackup
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: 1.0.0
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: 1.0.0
|
41
55
|
- !ruby/object:Gem::Dependency
|
42
56
|
name: rake
|
43
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -59,6 +73,9 @@ dependencies:
|
|
59
73
|
- - "~>"
|
60
74
|
- !ruby/object:Gem::Version
|
61
75
|
version: '1.0'
|
76
|
+
- - ">="
|
77
|
+
- !ruby/object:Gem::Version
|
78
|
+
version: 1.2.2
|
62
79
|
type: :runtime
|
63
80
|
prerelease: false
|
64
81
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -66,48 +83,51 @@ dependencies:
|
|
66
83
|
- - "~>"
|
67
84
|
- !ruby/object:Gem::Version
|
68
85
|
version: '1.0'
|
86
|
+
- - ">="
|
87
|
+
- !ruby/object:Gem::Version
|
88
|
+
version: 1.2.2
|
69
89
|
- !ruby/object:Gem::Dependency
|
70
|
-
name:
|
90
|
+
name: zeitwerk
|
71
91
|
requirement: !ruby/object:Gem::Requirement
|
72
92
|
requirements:
|
73
|
-
- - "
|
93
|
+
- - "~>"
|
74
94
|
- !ruby/object:Gem::Version
|
75
|
-
version: '
|
95
|
+
version: '2.6'
|
76
96
|
type: :runtime
|
77
97
|
prerelease: false
|
78
98
|
version_requirements: !ruby/object:Gem::Requirement
|
79
99
|
requirements:
|
80
|
-
- - "
|
100
|
+
- - "~>"
|
81
101
|
- !ruby/object:Gem::Version
|
82
|
-
version: '
|
102
|
+
version: '2.6'
|
83
103
|
- !ruby/object:Gem::Dependency
|
84
|
-
name:
|
104
|
+
name: irb
|
85
105
|
requirement: !ruby/object:Gem::Requirement
|
86
106
|
requirements:
|
87
|
-
- - "
|
107
|
+
- - ">="
|
88
108
|
- !ruby/object:Gem::Version
|
89
|
-
version: '
|
109
|
+
version: '0'
|
90
110
|
type: :runtime
|
91
111
|
prerelease: false
|
92
112
|
version_requirements: !ruby/object:Gem::Requirement
|
93
113
|
requirements:
|
94
|
-
- - "
|
114
|
+
- - ">="
|
95
115
|
- !ruby/object:Gem::Version
|
96
|
-
version: '
|
116
|
+
version: '0'
|
97
117
|
- !ruby/object:Gem::Dependency
|
98
118
|
name: actionview
|
99
119
|
requirement: !ruby/object:Gem::Requirement
|
100
120
|
requirements:
|
101
121
|
- - '='
|
102
122
|
- !ruby/object:Gem::Version
|
103
|
-
version: 7.0.
|
123
|
+
version: 7.1.0.beta1
|
104
124
|
type: :development
|
105
125
|
prerelease: false
|
106
126
|
version_requirements: !ruby/object:Gem::Requirement
|
107
127
|
requirements:
|
108
128
|
- - '='
|
109
129
|
- !ruby/object:Gem::Version
|
110
|
-
version: 7.0.
|
130
|
+
version: 7.1.0.beta1
|
111
131
|
description: 'Rails internals: application bootup, plugins, generators, and rake tasks.'
|
112
132
|
email: david@loudthinking.com
|
113
133
|
executables:
|
@@ -117,7 +137,7 @@ extra_rdoc_files: []
|
|
117
137
|
files:
|
118
138
|
- CHANGELOG.md
|
119
139
|
- MIT-LICENSE
|
120
|
-
- RDOC_MAIN.
|
140
|
+
- RDOC_MAIN.md
|
121
141
|
- README.rdoc
|
122
142
|
- exe/rails
|
123
143
|
- lib/minitest/rails_plugin.rb
|
@@ -131,7 +151,7 @@ files:
|
|
131
151
|
- lib/rails/application/bootstrap.rb
|
132
152
|
- lib/rails/application/configuration.rb
|
133
153
|
- lib/rails/application/default_middleware_stack.rb
|
134
|
-
- lib/rails/application/
|
154
|
+
- lib/rails/application/dummy_config.rb
|
135
155
|
- lib/rails/application/finisher.rb
|
136
156
|
- lib/rails/application/routes_reloader.rb
|
137
157
|
- lib/rails/application_controller.rb
|
@@ -148,6 +168,7 @@ files:
|
|
148
168
|
- lib/rails/command/environment_argument.rb
|
149
169
|
- lib/rails/command/helpers/editor.rb
|
150
170
|
- lib/rails/commands.rb
|
171
|
+
- lib/rails/commands/about/about_command.rb
|
151
172
|
- lib/rails/commands/application/application_command.rb
|
152
173
|
- lib/rails/commands/console/console_command.rb
|
153
174
|
- lib/rails/commands/credentials/USAGE
|
@@ -159,25 +180,33 @@ files:
|
|
159
180
|
- lib/rails/commands/dev/dev_command.rb
|
160
181
|
- lib/rails/commands/encrypted/USAGE
|
161
182
|
- lib/rails/commands/encrypted/encrypted_command.rb
|
183
|
+
- lib/rails/commands/gem_help/USAGE
|
184
|
+
- lib/rails/commands/gem_help/gem_help_command.rb
|
162
185
|
- lib/rails/commands/generate/generate_command.rb
|
163
186
|
- lib/rails/commands/help/USAGE
|
164
187
|
- lib/rails/commands/help/help_command.rb
|
165
188
|
- lib/rails/commands/initializers/initializers_command.rb
|
189
|
+
- lib/rails/commands/middleware/middleware_command.rb
|
166
190
|
- lib/rails/commands/new/new_command.rb
|
167
191
|
- lib/rails/commands/notes/notes_command.rb
|
168
192
|
- lib/rails/commands/plugin/plugin_command.rb
|
169
193
|
- lib/rails/commands/rake/rake_command.rb
|
194
|
+
- lib/rails/commands/restart/restart_command.rb
|
170
195
|
- lib/rails/commands/routes/routes_command.rb
|
171
196
|
- lib/rails/commands/runner/USAGE
|
172
197
|
- lib/rails/commands/runner/runner_command.rb
|
198
|
+
- lib/rails/commands/secret/secret_command.rb
|
173
199
|
- lib/rails/commands/secrets/USAGE
|
174
200
|
- lib/rails/commands/secrets/secrets_command.rb
|
175
201
|
- lib/rails/commands/server/server_command.rb
|
202
|
+
- lib/rails/commands/test/USAGE
|
176
203
|
- lib/rails/commands/test/test_command.rb
|
204
|
+
- lib/rails/commands/unused_routes/unused_routes_command.rb
|
177
205
|
- lib/rails/commands/version/version_command.rb
|
178
206
|
- lib/rails/configuration.rb
|
179
207
|
- lib/rails/console/app.rb
|
180
208
|
- lib/rails/console/helpers.rb
|
209
|
+
- lib/rails/deprecator.rb
|
181
210
|
- lib/rails/dev_caching.rb
|
182
211
|
- lib/rails/engine.rb
|
183
212
|
- lib/rails/engine/commands.rb
|
@@ -214,6 +243,7 @@ files:
|
|
214
243
|
- lib/rails/generators/named_base.rb
|
215
244
|
- lib/rails/generators/rails/app/USAGE
|
216
245
|
- lib/rails/generators/rails/app/app_generator.rb
|
246
|
+
- lib/rails/generators/rails/app/templates/Dockerfile.tt
|
217
247
|
- lib/rails/generators/rails/app/templates/Gemfile.tt
|
218
248
|
- lib/rails/generators/rails/app/templates/README.md.tt
|
219
249
|
- lib/rails/generators/rails/app/templates/Rakefile.tt
|
@@ -245,6 +275,7 @@ files:
|
|
245
275
|
- lib/rails/generators/rails/app/templates/config/databases/postgresql.yml.tt
|
246
276
|
- lib/rails/generators/rails/app/templates/config/databases/sqlite3.yml.tt
|
247
277
|
- lib/rails/generators/rails/app/templates/config/databases/sqlserver.yml.tt
|
278
|
+
- lib/rails/generators/rails/app/templates/config/databases/trilogy.yml.tt
|
248
279
|
- lib/rails/generators/rails/app/templates/config/environment.rb.tt
|
249
280
|
- lib/rails/generators/rails/app/templates/config/environments/development.rb.tt
|
250
281
|
- lib/rails/generators/rails/app/templates/config/environments/production.rb.tt
|
@@ -254,15 +285,18 @@ files:
|
|
254
285
|
- lib/rails/generators/rails/app/templates/config/initializers/cors.rb.tt
|
255
286
|
- lib/rails/generators/rails/app/templates/config/initializers/filter_parameter_logging.rb.tt
|
256
287
|
- lib/rails/generators/rails/app/templates/config/initializers/inflections.rb.tt
|
257
|
-
- lib/rails/generators/rails/app/templates/config/initializers/
|
288
|
+
- lib/rails/generators/rails/app/templates/config/initializers/new_framework_defaults_7_1.rb.tt
|
258
289
|
- lib/rails/generators/rails/app/templates/config/initializers/permissions_policy.rb.tt
|
259
290
|
- lib/rails/generators/rails/app/templates/config/locales/en.yml
|
260
291
|
- lib/rails/generators/rails/app/templates/config/puma.rb.tt
|
261
292
|
- lib/rails/generators/rails/app/templates/config/routes.rb.tt
|
262
293
|
- lib/rails/generators/rails/app/templates/config/storage.yml.tt
|
263
294
|
- lib/rails/generators/rails/app/templates/db/seeds.rb.tt
|
295
|
+
- lib/rails/generators/rails/app/templates/docker-entrypoint.tt
|
296
|
+
- lib/rails/generators/rails/app/templates/dockerignore.tt
|
264
297
|
- lib/rails/generators/rails/app/templates/gitattributes.tt
|
265
298
|
- lib/rails/generators/rails/app/templates/gitignore.tt
|
299
|
+
- lib/rails/generators/rails/app/templates/node-version.tt
|
266
300
|
- lib/rails/generators/rails/app/templates/public/404.html
|
267
301
|
- lib/rails/generators/rails/app/templates/public/422.html
|
268
302
|
- lib/rails/generators/rails/app/templates/public/500.html
|
@@ -282,6 +316,7 @@ files:
|
|
282
316
|
- lib/rails/generators/rails/controller/controller_generator.rb
|
283
317
|
- lib/rails/generators/rails/controller/templates/controller.rb.tt
|
284
318
|
- lib/rails/generators/rails/credentials/credentials_generator.rb
|
319
|
+
- lib/rails/generators/rails/credentials/templates/credentials.yml.tt
|
285
320
|
- lib/rails/generators/rails/db/system/change/change_generator.rb
|
286
321
|
- lib/rails/generators/rails/encrypted_file/encrypted_file_generator.rb
|
287
322
|
- lib/rails/generators/rails/encryption_key_file/encryption_key_file_generator.rb
|
@@ -298,7 +333,6 @@ files:
|
|
298
333
|
- lib/rails/generators/rails/master_key/master_key_generator.rb
|
299
334
|
- lib/rails/generators/rails/migration/USAGE
|
300
335
|
- lib/rails/generators/rails/migration/migration_generator.rb
|
301
|
-
- lib/rails/generators/rails/model/USAGE
|
302
336
|
- lib/rails/generators/rails/model/model_generator.rb
|
303
337
|
- lib/rails/generators/rails/plugin/USAGE
|
304
338
|
- lib/rails/generators/rails/plugin/plugin_generator.rb
|
@@ -375,8 +409,9 @@ files:
|
|
375
409
|
- lib/rails/generators/test_unit/system/templates/application_system_test_case.rb.tt
|
376
410
|
- lib/rails/generators/test_unit/system/templates/system_test.rb.tt
|
377
411
|
- lib/rails/generators/testing/assertions.rb
|
378
|
-
- lib/rails/generators/testing/
|
412
|
+
- lib/rails/generators/testing/behavior.rb
|
379
413
|
- lib/rails/generators/testing/setup_and_teardown.rb
|
414
|
+
- lib/rails/health_controller.rb
|
380
415
|
- lib/rails/info.rb
|
381
416
|
- lib/rails/info_controller.rb
|
382
417
|
- lib/rails/initializable.rb
|
@@ -385,6 +420,7 @@ files:
|
|
385
420
|
- lib/rails/plugin/test.rb
|
386
421
|
- lib/rails/rack.rb
|
387
422
|
- lib/rails/rack/logger.rb
|
423
|
+
- lib/rails/rackup/server.rb
|
388
424
|
- lib/rails/railtie.rb
|
389
425
|
- lib/rails/railtie/configurable.rb
|
390
426
|
- lib/rails/railtie/configuration.rb
|
@@ -395,9 +431,7 @@ files:
|
|
395
431
|
- lib/rails/tasks/engine.rake
|
396
432
|
- lib/rails/tasks/framework.rake
|
397
433
|
- lib/rails/tasks/log.rake
|
398
|
-
- lib/rails/tasks/middleware.rake
|
399
434
|
- lib/rails/tasks/misc.rake
|
400
|
-
- lib/rails/tasks/restart.rake
|
401
435
|
- lib/rails/tasks/statistics.rake
|
402
436
|
- lib/rails/tasks/tmp.rake
|
403
437
|
- lib/rails/tasks/yarn.rake
|
@@ -414,6 +448,7 @@ files:
|
|
414
448
|
- lib/rails/test_unit/railtie.rb
|
415
449
|
- lib/rails/test_unit/reporter.rb
|
416
450
|
- lib/rails/test_unit/runner.rb
|
451
|
+
- lib/rails/test_unit/test_parser.rb
|
417
452
|
- lib/rails/test_unit/testing.rake
|
418
453
|
- lib/rails/version.rb
|
419
454
|
- lib/rails/welcome_controller.rb
|
@@ -422,12 +457,12 @@ licenses:
|
|
422
457
|
- MIT
|
423
458
|
metadata:
|
424
459
|
bug_tracker_uri: https://github.com/rails/rails/issues
|
425
|
-
changelog_uri: https://github.com/rails/rails/blob/v7.0.
|
426
|
-
documentation_uri: https://api.rubyonrails.org/v7.0.
|
460
|
+
changelog_uri: https://github.com/rails/rails/blob/v7.1.0.beta1/railties/CHANGELOG.md
|
461
|
+
documentation_uri: https://api.rubyonrails.org/v7.1.0.beta1/
|
427
462
|
mailing_list_uri: https://discuss.rubyonrails.org/c/rubyonrails-talk
|
428
|
-
source_code_uri: https://github.com/rails/rails/tree/v7.0.
|
463
|
+
source_code_uri: https://github.com/rails/rails/tree/v7.1.0.beta1/railties
|
429
464
|
rubygems_mfa_required: 'true'
|
430
|
-
post_install_message:
|
465
|
+
post_install_message:
|
431
466
|
rdoc_options:
|
432
467
|
- "--exclude"
|
433
468
|
- "."
|
@@ -440,12 +475,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
440
475
|
version: 2.7.0
|
441
476
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
442
477
|
requirements:
|
443
|
-
- - "
|
478
|
+
- - ">"
|
444
479
|
- !ruby/object:Gem::Version
|
445
|
-
version:
|
480
|
+
version: 1.3.1
|
446
481
|
requirements: []
|
447
|
-
rubygems_version: 3.
|
448
|
-
signing_key:
|
482
|
+
rubygems_version: 3.4.18
|
483
|
+
signing_key:
|
449
484
|
specification_version: 4
|
450
485
|
summary: Tools for creating, working with, and running Rails applications.
|
451
486
|
test_files: []
|
data/RDOC_MAIN.rdoc
DELETED
@@ -1,97 +0,0 @@
|
|
1
|
-
= Welcome to \Rails
|
2
|
-
|
3
|
-
== What's \Rails
|
4
|
-
|
5
|
-
\Rails is a web-application framework that includes everything needed to
|
6
|
-
create database-backed web applications according to the
|
7
|
-
{Model-View-Controller (MVC)}[https://en.wikipedia.org/wiki/Model-view-controller]
|
8
|
-
pattern.
|
9
|
-
|
10
|
-
Understanding the MVC pattern is key to understanding \Rails. MVC divides your
|
11
|
-
application into three layers: Model, View, and Controller, each with a specific responsibility.
|
12
|
-
|
13
|
-
== Model layer
|
14
|
-
|
15
|
-
The <em><b>Model layer</b></em> represents the domain model (such as Account, Product,
|
16
|
-
Person, Post, etc.) and encapsulates the business logic specific to
|
17
|
-
your application. In \Rails, database-backed model classes are derived from
|
18
|
-
<tt>ActiveRecord::Base</tt>. {Active Record}[link:/files/activerecord/README_rdoc.html] allows you to present the data from
|
19
|
-
database rows as objects and embellish these data objects with business logic
|
20
|
-
methods. Although most \Rails models are backed by a database, models can also be ordinary
|
21
|
-
Ruby classes, or Ruby classes that implement a set of interfaces as provided by
|
22
|
-
the {Active Model}[link:/files/activemodel/README_rdoc.html] module.
|
23
|
-
|
24
|
-
== Controller layer
|
25
|
-
|
26
|
-
The <em><b>Controller layer</b></em> is responsible for handling incoming HTTP requests and
|
27
|
-
providing a suitable response. Usually, this means returning \HTML, but \Rails controllers
|
28
|
-
can also generate XML, JSON, PDFs, mobile-specific views, and more. Controllers load and
|
29
|
-
manipulate models and render view templates in order to generate the appropriate HTTP response.
|
30
|
-
In \Rails, incoming requests are routed by Action Dispatch to an appropriate controller, and
|
31
|
-
controller classes are derived from <tt>ActionController::Base</tt>. Action Dispatch and Action Controller
|
32
|
-
are bundled together in {Action Pack}[link:/files/actionpack/README_rdoc.html].
|
33
|
-
|
34
|
-
== View layer
|
35
|
-
|
36
|
-
The <em><b>View layer</b></em> is composed of "templates" that are responsible for providing
|
37
|
-
appropriate representations of your application's resources. Templates can
|
38
|
-
come in a variety of formats, but most view templates are \HTML with embedded
|
39
|
-
Ruby code (ERB files). Views are typically rendered to generate a controller response,
|
40
|
-
or to generate the body of an email. In \Rails, View generation is handled by {Action View}[link:/files/actionview/README_rdoc.html].
|
41
|
-
|
42
|
-
== Frameworks and libraries
|
43
|
-
|
44
|
-
{Active Record}[link:/files/activerecord/README_rdoc.html], {Active Model}[link:/files/activemodel/README_rdoc.html],
|
45
|
-
{Action Pack}[link:/files/actionpack/README_rdoc.html], and {Action View}[link:/files/actionview/README_rdoc.html] can each be used independently outside \Rails.
|
46
|
-
In addition to that, \Rails also comes with {Action Mailer}[link:/files/actionmailer/README_rdoc.html], a library
|
47
|
-
to generate and send emails; {Action Mailbox}[link:/files/actionmailbox/README_md.html], a library to receive emails within a Rails application;
|
48
|
-
{Active Job}[link:/files/activejob/README_md.html], a framework for declaring jobs and making them run on a variety of queueing
|
49
|
-
backends; {Action Cable}[link:/files/actioncable/README_md.html], a framework to
|
50
|
-
integrate WebSockets with a \Rails application; {Active Storage}[link:/files/activestorage/README_md.html],
|
51
|
-
a library to attach cloud and local files to \Rails applications; {Action Text}[link:/files/actiontext/README_md.html], a library to handle rich text content;
|
52
|
-
and {Active Support}[link:/files/activesupport/README_rdoc.html], a collection
|
53
|
-
of utility classes and standard library extensions that are useful for \Rails,
|
54
|
-
and may also be used independently outside \Rails.
|
55
|
-
|
56
|
-
== Getting Started
|
57
|
-
|
58
|
-
1. Install \Rails at the command prompt if you haven't yet:
|
59
|
-
|
60
|
-
$ gem install rails
|
61
|
-
|
62
|
-
2. At the command prompt, create a new \Rails application:
|
63
|
-
|
64
|
-
$ rails new myapp
|
65
|
-
|
66
|
-
where "myapp" is the application name.
|
67
|
-
|
68
|
-
3. Change directory to +myapp+ and start the web server:
|
69
|
-
|
70
|
-
$ cd myapp
|
71
|
-
$ bin/rails server
|
72
|
-
|
73
|
-
Run with <tt>--help</tt> or <tt>-h</tt> for options.
|
74
|
-
|
75
|
-
4. Go to <tt>http://localhost:3000</tt>, and you'll see: "Yay! You’re on \Rails!"
|
76
|
-
|
77
|
-
5. Follow the guidelines to start developing your application. You may find the following resources handy:
|
78
|
-
|
79
|
-
* The \README file created within your application.
|
80
|
-
* {Getting Started with \Rails}[https://guides.rubyonrails.org/getting_started.html].
|
81
|
-
* {Ruby on \Rails Guides}[https://guides.rubyonrails.org].
|
82
|
-
* {The API Documentation}[https://api.rubyonrails.org].
|
83
|
-
|
84
|
-
== Contributing
|
85
|
-
|
86
|
-
We encourage you to contribute to Ruby on \Rails! Please check out the
|
87
|
-
{Contributing to Ruby on \Rails guide}[https://guides.rubyonrails.org/contributing_to_ruby_on_rails.html] for guidelines about how to proceed. {Join us!}[http://contributors.rubyonrails.org]
|
88
|
-
|
89
|
-
Trying to report a possible security vulnerability in \Rails? Please
|
90
|
-
check out our {security policy}[https://rubyonrails.org/security/] for
|
91
|
-
guidelines about how to proceed.
|
92
|
-
|
93
|
-
Everyone interacting in \Rails and its sub-projects' codebases, issue trackers, chat rooms, and mailing lists is expected to follow the \Rails {code of conduct}[http://rubyonrails.org/conduct/].
|
94
|
-
|
95
|
-
== License
|
96
|
-
|
97
|
-
Ruby on \Rails is released under the {MIT License}[https://opensource.org/licenses/MIT].
|