railties 6.1.0 → 7.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +121 -276
- data/MIT-LICENSE +1 -1
- data/RDOC_MAIN.rdoc +16 -16
- data/README.rdoc +1 -2
- data/lib/rails/all.rb +0 -1
- data/lib/rails/api/task.rb +1 -1
- data/lib/rails/app_updater.rb +3 -5
- data/lib/rails/application/bootstrap.rb +21 -5
- data/lib/rails/application/configuration.rb +79 -33
- data/lib/rails/application/default_middleware_stack.rb +7 -3
- data/lib/rails/application/finisher.rb +42 -85
- data/lib/rails/application/routes_reloader.rb +8 -0
- data/lib/rails/application.rb +32 -51
- data/lib/rails/application_controller.rb +2 -2
- data/lib/rails/autoloaders/inflector.rb +21 -0
- data/lib/rails/autoloaders.rb +12 -16
- data/lib/rails/code_statistics.rb +2 -2
- data/lib/rails/code_statistics_calculator.rb +10 -1
- data/lib/rails/command/base.rb +26 -12
- data/lib/rails/command/behavior.rb +1 -1
- data/lib/rails/command/environment_argument.rb +1 -1
- data/lib/rails/command.rb +11 -10
- data/lib/rails/commands/credentials/USAGE +4 -2
- data/lib/rails/commands/credentials/credentials_command/diffing.rb +26 -16
- data/lib/rails/commands/credentials/credentials_command.rb +8 -3
- data/lib/rails/commands/dbconsole/dbconsole_command.rb +10 -11
- data/lib/rails/commands/help/USAGE +3 -2
- data/lib/rails/commands/notes/notes_command.rb +2 -2
- data/lib/rails/commands/runner/runner_command.rb +3 -2
- data/lib/rails/commands/server/server_command.rb +2 -5
- data/lib/rails/configuration.rb +18 -23
- data/lib/rails/engine/configuration.rb +3 -3
- data/lib/rails/engine.rb +18 -24
- data/lib/rails/gem_version.rb +2 -2
- data/lib/rails/generators/actions/create_migration.rb +4 -4
- data/lib/rails/generators/actions.rb +35 -13
- data/lib/rails/generators/app_base.rb +140 -102
- data/lib/rails/generators/app_name.rb +1 -1
- data/lib/rails/generators/base.rb +9 -13
- data/lib/rails/generators/erb/scaffold/scaffold_generator.rb +2 -0
- data/lib/rails/generators/erb/scaffold/templates/_form.html.erb.tt +8 -8
- data/lib/rails/generators/erb/scaffold/templates/edit.html.erb.tt +8 -4
- data/lib/rails/generators/erb/scaffold/templates/index.html.erb.tt +11 -28
- data/lib/rails/generators/erb/scaffold/templates/new.html.erb.tt +7 -3
- data/lib/rails/generators/erb/scaffold/templates/partial.html.erb.tt +17 -0
- data/lib/rails/generators/erb/scaffold/templates/show.html.erb.tt +8 -17
- data/lib/rails/generators/erb.rb +1 -1
- data/lib/rails/generators/generated_attribute.rb +45 -9
- data/lib/rails/generators/migration.rb +2 -6
- data/lib/rails/generators/model_helpers.rb +1 -1
- data/lib/rails/generators/named_base.rb +11 -11
- data/lib/rails/generators/rails/app/app_generator.rb +54 -93
- data/lib/rails/generators/rails/app/templates/Gemfile.tt +42 -52
- data/lib/rails/generators/rails/app/templates/app/assets/stylesheets/application.css.tt +2 -2
- data/lib/rails/generators/rails/app/templates/app/mailers/application_mailer.rb.tt +2 -2
- data/lib/rails/generators/rails/app/templates/app/models/application_record.rb.tt +1 -1
- data/lib/rails/generators/rails/app/templates/app/views/layouts/application.html.erb.tt +3 -9
- data/lib/rails/generators/rails/app/templates/bin/rails.tt +1 -4
- data/lib/rails/generators/rails/app/templates/bin/rake.tt +0 -3
- data/lib/rails/generators/rails/app/templates/bin/setup.tt +9 -14
- data/lib/rails/generators/rails/app/templates/config/application.rb.tt +0 -1
- data/lib/rails/generators/rails/app/templates/config/boot.rb.tt +1 -1
- data/lib/rails/generators/rails/app/templates/config/databases/jdbc.yml.tt +2 -2
- data/lib/rails/generators/rails/app/templates/config/databases/jdbcmysql.yml.tt +3 -3
- data/lib/rails/generators/rails/app/templates/config/databases/jdbcpostgresql.yml.tt +3 -3
- data/lib/rails/generators/rails/app/templates/config/databases/jdbcsqlite3.yml.tt +2 -2
- data/lib/rails/generators/rails/app/templates/config/databases/mysql.yml.tt +3 -3
- data/lib/rails/generators/rails/app/templates/config/databases/oracle.yml.tt +2 -2
- data/lib/rails/generators/rails/app/templates/config/databases/postgresql.yml.tt +3 -3
- data/lib/rails/generators/rails/app/templates/config/databases/sqlite3.yml.tt +1 -1
- data/lib/rails/generators/rails/app/templates/config/databases/sqlserver.yml.tt +5 -5
- data/lib/rails/generators/rails/app/templates/config/environments/development.rb.tt +6 -12
- data/lib/rails/generators/rails/app/templates/config/environments/production.rb.tt +11 -38
- data/lib/rails/generators/rails/app/templates/config/environments/test.rb.tt +6 -11
- data/lib/rails/generators/rails/app/templates/config/initializers/assets.rb.tt +1 -5
- data/lib/rails/generators/rails/app/templates/config/initializers/content_security_policy.rb.tt +19 -25
- data/lib/rails/generators/rails/app/templates/config/initializers/cors.rb.tt +2 -2
- data/lib/rails/generators/rails/app/templates/config/initializers/inflections.rb.tt +4 -4
- data/lib/rails/generators/rails/app/templates/config/initializers/new_framework_defaults_7_0.rb.tt +117 -0
- data/lib/rails/generators/rails/app/templates/config/locales/en.yml +3 -3
- data/lib/rails/generators/rails/app/templates/config/puma.rb.tt +1 -1
- data/lib/rails/generators/rails/app/templates/config/routes.rb.tt +4 -1
- data/lib/rails/generators/rails/app/templates/config/storage.yml.tt +5 -5
- data/lib/rails/generators/rails/app/templates/db/seeds.rb.tt +2 -2
- data/lib/rails/generators/rails/app/templates/gitattributes.tt +0 -5
- data/lib/rails/generators/rails/app/templates/gitignore.tt +3 -1
- data/lib/rails/generators/rails/app/templates/test/test_helper.rb.tt +1 -1
- data/lib/rails/generators/rails/controller/controller_generator.rb +1 -2
- data/lib/rails/generators/rails/controller/templates/controller.rb.tt +0 -4
- data/lib/rails/generators/rails/db/system/change/change_generator.rb +1 -1
- data/lib/rails/generators/rails/generator/templates/%file_name%_generator.rb.tt +1 -1
- data/lib/rails/generators/rails/plugin/plugin_generator.rb +42 -24
- data/lib/rails/generators/rails/plugin/templates/%name%.gemspec.tt +7 -3
- data/lib/rails/generators/rails/plugin/templates/Gemfile.tt +11 -20
- data/lib/rails/generators/rails/plugin/templates/README.md.tt +1 -1
- data/lib/rails/generators/rails/plugin/templates/app/mailers/%namespaced_name%/application_mailer.rb.tt +2 -2
- data/lib/rails/generators/rails/plugin/templates/app/views/layouts/%namespaced_name%/application.html.erb.tt +0 -3
- data/lib/rails/generators/rails/plugin/templates/bin/rails.tt +4 -5
- data/lib/rails/generators/rails/plugin/templates/gitignore.tt +0 -5
- data/lib/rails/generators/rails/plugin/templates/lib/%namespaced_name%/engine.rb.tt +2 -2
- data/lib/rails/generators/rails/plugin/templates/lib/%namespaced_name%/version.rb.tt +1 -1
- data/lib/rails/generators/rails/plugin/templates/rails/boot.rb.tt +2 -2
- data/lib/rails/generators/rails/plugin/templates/test/test_helper.rb.tt +2 -7
- data/lib/rails/generators/rails/scaffold/scaffold_generator.rb +0 -19
- data/lib/rails/generators/rails/scaffold_controller/templates/api_controller.rb.tt +1 -5
- data/lib/rails/generators/rails/scaffold_controller/templates/controller.rb.tt +6 -10
- data/lib/rails/generators/resource_helpers.rb +2 -2
- data/lib/rails/generators/test_unit/generator/templates/generator_test.rb.tt +1 -1
- data/lib/rails/generators/test_unit/model/templates/fixtures.yml.tt +2 -2
- data/lib/rails/generators/test_unit/scaffold/scaffold_generator.rb +3 -3
- data/lib/rails/generators/test_unit/scaffold/templates/api_functional_test.rb.tt +5 -5
- data/lib/rails/generators/test_unit/scaffold/templates/functional_test.rb.tt +7 -7
- data/lib/rails/generators/test_unit/scaffold/templates/system_test.rb.tt +9 -11
- data/lib/rails/generators/testing/behaviour.rb +3 -4
- data/lib/rails/generators.rb +9 -22
- data/lib/rails/info.rb +1 -1
- data/lib/rails/info_controller.rb +1 -3
- data/lib/rails/initializable.rb +1 -1
- data/lib/rails/mailers_controller.rb +2 -4
- data/lib/rails/rack/logger.rb +0 -1
- data/lib/rails/railtie/configuration.rb +1 -2
- data/lib/rails/railtie.rb +31 -14
- data/lib/rails/ruby_version_check.rb +3 -3
- data/lib/rails/secrets.rb +4 -1
- data/lib/rails/source_annotation_extractor.rb +1 -1
- data/lib/rails/tasks/framework.rake +2 -8
- data/lib/rails/tasks/statistics.rake +3 -1
- data/lib/rails/tasks/tmp.rake +8 -1
- data/lib/rails/tasks/yarn.rake +10 -7
- data/lib/rails/tasks/zeitwerk.rake +2 -10
- data/lib/rails/templates/layouts/application.html.erb +15 -0
- data/lib/rails/templates/rails/mailers/email.html.erb +13 -11
- data/lib/rails/templates/rails/welcome/index.html.erb +62 -47
- data/lib/rails/test_unit/railtie.rb +0 -4
- data/lib/rails/test_unit/runner.rb +16 -9
- data/lib/rails/test_unit/testing.rake +4 -9
- data/lib/rails/welcome_controller.rb +1 -0
- data/lib/rails.rb +5 -0
- metadata +33 -36
- data/lib/rails/command/spellchecker.rb +0 -57
- data/lib/rails/generators/css/assets/assets_generator.rb +0 -15
- data/lib/rails/generators/css/assets/templates/stylesheet.css +0 -4
- data/lib/rails/generators/css/scaffold/scaffold_generator.rb +0 -18
- data/lib/rails/generators/rails/app/templates/app/javascript/channels/consumer.js +0 -6
- data/lib/rails/generators/rails/app/templates/app/javascript/channels/index.js +0 -5
- data/lib/rails/generators/rails/app/templates/app/javascript/packs/application.js.tt +0 -23
- data/lib/rails/generators/rails/app/templates/bin/spring.tt +0 -9
- data/lib/rails/generators/rails/app/templates/bin/yarn.tt +0 -18
- data/lib/rails/generators/rails/app/templates/config/initializers/application_controller_renderer.rb.tt +0 -8
- data/lib/rails/generators/rails/app/templates/config/initializers/backtrace_silencers.rb.tt +0 -8
- data/lib/rails/generators/rails/app/templates/config/initializers/cookies_serializer.rb.tt +0 -5
- data/lib/rails/generators/rails/app/templates/config/initializers/mime_types.rb.tt +0 -4
- data/lib/rails/generators/rails/app/templates/config/initializers/new_framework_defaults_6_1.rb.tt +0 -63
- data/lib/rails/generators/rails/app/templates/config/initializers/wrap_parameters.rb.tt +0 -16
- data/lib/rails/generators/rails/app/templates/config/spring.rb.tt +0 -6
- data/lib/rails/generators/rails/app/templates/package.json.tt +0 -11
- data/lib/rails/generators/rails/assets/USAGE +0 -16
- data/lib/rails/generators/rails/assets/assets_generator.rb +0 -26
- data/lib/rails/generators/rails/assets/templates/stylesheet.css +0 -4
- data/lib/rails/generators/rails/scaffold/templates/scaffold.css +0 -80
@@ -2,10 +2,6 @@
|
|
2
2
|
|
3
3
|
require "rails/test_unit/line_filtering"
|
4
4
|
|
5
|
-
if defined?(Rake.application) && Rake.application.top_level_tasks.grep(/^(default$|test(:|$))/).any?
|
6
|
-
ENV["RAILS_ENV"] ||= Rake.application.options.show_tasks ? "development" : "test"
|
7
|
-
end
|
8
|
-
|
9
5
|
module Rails
|
10
6
|
class TestUnitRailtie < Rails::Railtie
|
11
7
|
config.app_generators do |c|
|
@@ -3,6 +3,7 @@
|
|
3
3
|
require "shellwords"
|
4
4
|
require "method_source"
|
5
5
|
require "rake/file_list"
|
6
|
+
require "active_support"
|
6
7
|
require "active_support/core_ext/module/attribute_accessors"
|
7
8
|
|
8
9
|
module Rails
|
@@ -30,9 +31,9 @@ module Rails
|
|
30
31
|
end
|
31
32
|
|
32
33
|
def rake_run(argv = [])
|
33
|
-
|
34
|
-
|
35
|
-
|
34
|
+
# Ensure the tests run during the Rake Task action, not when the process exits
|
35
|
+
success = system("rails", "test", *argv, *Shellwords.split(ENV["TESTOPTS"] || ""))
|
36
|
+
success || exit(false)
|
36
37
|
end
|
37
38
|
|
38
39
|
def run(argv = [])
|
@@ -42,11 +43,7 @@ module Rails
|
|
42
43
|
end
|
43
44
|
|
44
45
|
def load_tests(argv)
|
45
|
-
|
46
|
-
|
47
|
-
tests = Rake::FileList[patterns.any? ? patterns : default_test_glob]
|
48
|
-
tests.exclude(default_test_exclude_glob) if patterns.empty?
|
49
|
-
|
46
|
+
tests = list_tests(argv)
|
50
47
|
tests.to_a.each { |path| require File.expand_path(path) }
|
51
48
|
end
|
52
49
|
|
@@ -61,7 +58,9 @@ module Rails
|
|
61
58
|
private
|
62
59
|
def extract_filters(argv)
|
63
60
|
# Extract absolute and relative paths but skip -n /.*/ regexp filters.
|
64
|
-
argv.
|
61
|
+
argv.filter_map do |path|
|
62
|
+
next unless path_argument?(path) && !regexp_filter?(path)
|
63
|
+
|
65
64
|
path = path.tr("\\", "/")
|
66
65
|
case
|
67
66
|
when /(:\d+)+$/.match?(path)
|
@@ -92,6 +91,14 @@ module Rails
|
|
92
91
|
def path_argument?(arg)
|
93
92
|
%r"^[/\\]?\w+[/\\]".match?(arg)
|
94
93
|
end
|
94
|
+
|
95
|
+
def list_tests(argv)
|
96
|
+
patterns = extract_filters(argv)
|
97
|
+
|
98
|
+
tests = Rake::FileList[patterns.any? ? patterns : default_test_glob]
|
99
|
+
tests.exclude(default_test_exclude_glob) if patterns.empty?
|
100
|
+
tests
|
101
|
+
end
|
95
102
|
end
|
96
103
|
end
|
97
104
|
|
@@ -8,8 +8,6 @@ task default: :test
|
|
8
8
|
|
9
9
|
desc "Runs all tests in test folder except system ones"
|
10
10
|
task :test do
|
11
|
-
$: << "test"
|
12
|
-
|
13
11
|
if ENV.key?("TEST")
|
14
12
|
Rails::TestUnit::Runner.rake_run([ENV["TEST"]])
|
15
13
|
else
|
@@ -26,39 +24,36 @@ namespace :test do
|
|
26
24
|
task run: %w[test]
|
27
25
|
|
28
26
|
desc "Run tests quickly, but also reset db"
|
29
|
-
task
|
27
|
+
task :db do
|
28
|
+
success = system({ "RAILS_ENV" => ENV.fetch("RAILS_ENV", "test") }, "rake", "db:test:prepare", "test")
|
29
|
+
success || exit(false)
|
30
|
+
end
|
30
31
|
|
31
32
|
["models", "helpers", "channels", "controllers", "mailers", "integration", "jobs", "mailboxes"].each do |name|
|
32
33
|
task name => "test:prepare" do
|
33
|
-
$: << "test"
|
34
34
|
Rails::TestUnit::Runner.rake_run(["test/#{name}"])
|
35
35
|
end
|
36
36
|
end
|
37
37
|
|
38
38
|
desc "Runs all tests, including system tests"
|
39
39
|
task all: "test:prepare" do
|
40
|
-
$: << "test"
|
41
40
|
Rails::TestUnit::Runner.rake_run(["test/**/*_test.rb"])
|
42
41
|
end
|
43
42
|
|
44
43
|
task generators: "test:prepare" do
|
45
|
-
$: << "test"
|
46
44
|
Rails::TestUnit::Runner.rake_run(["test/lib/generators"])
|
47
45
|
end
|
48
46
|
|
49
47
|
task units: "test:prepare" do
|
50
|
-
$: << "test"
|
51
48
|
Rails::TestUnit::Runner.rake_run(["test/models", "test/helpers", "test/unit"])
|
52
49
|
end
|
53
50
|
|
54
51
|
task functionals: "test:prepare" do
|
55
|
-
$: << "test"
|
56
52
|
Rails::TestUnit::Runner.rake_run(["test/controllers", "test/mailers", "test/functional"])
|
57
53
|
end
|
58
54
|
|
59
55
|
desc "Run system tests only"
|
60
56
|
task system: "test:prepare" do
|
61
|
-
$: << "test"
|
62
57
|
Rails::TestUnit::Runner.rake_run(["test/system"])
|
63
58
|
end
|
64
59
|
end
|
data/lib/rails.rb
CHANGED
@@ -25,6 +25,7 @@ end
|
|
25
25
|
|
26
26
|
module Rails
|
27
27
|
extend ActiveSupport::Autoload
|
28
|
+
extend ActiveSupport::Benchmarkable
|
28
29
|
|
29
30
|
autoload :Info
|
30
31
|
autoload :InfoController
|
@@ -80,6 +81,10 @@ module Rails
|
|
80
81
|
@_env = ActiveSupport::EnvironmentInquirer.new(environment)
|
81
82
|
end
|
82
83
|
|
84
|
+
def error
|
85
|
+
application && application.executor.error_reporter
|
86
|
+
end
|
87
|
+
|
83
88
|
# Returns all Rails groups for loading based on:
|
84
89
|
#
|
85
90
|
# * The Rails environment;
|
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:
|
4
|
+
version: 7.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Heinemeier Hansson
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-12-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -16,42 +16,42 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 7.0.0
|
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:
|
26
|
+
version: 7.0.0
|
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:
|
33
|
+
version: 7.0.0
|
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:
|
40
|
+
version: 7.0.0
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rake
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version:
|
47
|
+
version: '12.2'
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version:
|
54
|
+
version: '12.2'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: thor
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -80,20 +80,34 @@ dependencies:
|
|
80
80
|
- - ">="
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: zeitwerk
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '2.5'
|
90
|
+
type: :runtime
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - "~>"
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '2.5'
|
83
97
|
- !ruby/object:Gem::Dependency
|
84
98
|
name: actionview
|
85
99
|
requirement: !ruby/object:Gem::Requirement
|
86
100
|
requirements:
|
87
101
|
- - '='
|
88
102
|
- !ruby/object:Gem::Version
|
89
|
-
version:
|
103
|
+
version: 7.0.0
|
90
104
|
type: :development
|
91
105
|
prerelease: false
|
92
106
|
version_requirements: !ruby/object:Gem::Requirement
|
93
107
|
requirements:
|
94
108
|
- - '='
|
95
109
|
- !ruby/object:Gem::Version
|
96
|
-
version:
|
110
|
+
version: 7.0.0
|
97
111
|
description: 'Rails internals: application bootup, plugins, generators, and rake tasks.'
|
98
112
|
email: david@loudthinking.com
|
99
113
|
executables:
|
@@ -122,6 +136,7 @@ files:
|
|
122
136
|
- lib/rails/application/routes_reloader.rb
|
123
137
|
- lib/rails/application_controller.rb
|
124
138
|
- lib/rails/autoloaders.rb
|
139
|
+
- lib/rails/autoloaders/inflector.rb
|
125
140
|
- lib/rails/backtrace_cleaner.rb
|
126
141
|
- lib/rails/cli.rb
|
127
142
|
- lib/rails/code_statistics.rb
|
@@ -132,7 +147,6 @@ files:
|
|
132
147
|
- lib/rails/command/behavior.rb
|
133
148
|
- lib/rails/command/environment_argument.rb
|
134
149
|
- lib/rails/command/helpers/editor.rb
|
135
|
-
- lib/rails/command/spellchecker.rb
|
136
150
|
- lib/rails/commands.rb
|
137
151
|
- lib/rails/commands/application/application_command.rb
|
138
152
|
- lib/rails/commands/console/console_command.rb
|
@@ -178,9 +192,6 @@ files:
|
|
178
192
|
- lib/rails/generators/app_base.rb
|
179
193
|
- lib/rails/generators/app_name.rb
|
180
194
|
- lib/rails/generators/base.rb
|
181
|
-
- lib/rails/generators/css/assets/assets_generator.rb
|
182
|
-
- lib/rails/generators/css/assets/templates/stylesheet.css
|
183
|
-
- lib/rails/generators/css/scaffold/scaffold_generator.rb
|
184
195
|
- lib/rails/generators/database.rb
|
185
196
|
- lib/rails/generators/erb.rb
|
186
197
|
- lib/rails/generators/erb/controller/controller_generator.rb
|
@@ -195,6 +206,7 @@ files:
|
|
195
206
|
- lib/rails/generators/erb/scaffold/templates/edit.html.erb.tt
|
196
207
|
- lib/rails/generators/erb/scaffold/templates/index.html.erb.tt
|
197
208
|
- lib/rails/generators/erb/scaffold/templates/new.html.erb.tt
|
209
|
+
- lib/rails/generators/erb/scaffold/templates/partial.html.erb.tt
|
198
210
|
- lib/rails/generators/erb/scaffold/templates/show.html.erb.tt
|
199
211
|
- lib/rails/generators/generated_attribute.rb
|
200
212
|
- lib/rails/generators/migration.rb
|
@@ -211,9 +223,6 @@ files:
|
|
211
223
|
- lib/rails/generators/rails/app/templates/app/channels/application_cable/connection.rb.tt
|
212
224
|
- lib/rails/generators/rails/app/templates/app/controllers/application_controller.rb.tt
|
213
225
|
- lib/rails/generators/rails/app/templates/app/helpers/application_helper.rb.tt
|
214
|
-
- lib/rails/generators/rails/app/templates/app/javascript/channels/consumer.js
|
215
|
-
- lib/rails/generators/rails/app/templates/app/javascript/channels/index.js
|
216
|
-
- lib/rails/generators/rails/app/templates/app/javascript/packs/application.js.tt
|
217
226
|
- lib/rails/generators/rails/app/templates/app/jobs/application_job.rb.tt
|
218
227
|
- lib/rails/generators/rails/app/templates/app/mailers/application_mailer.rb.tt
|
219
228
|
- lib/rails/generators/rails/app/templates/app/models/application_record.rb.tt
|
@@ -223,8 +232,6 @@ files:
|
|
223
232
|
- lib/rails/generators/rails/app/templates/bin/rails.tt
|
224
233
|
- lib/rails/generators/rails/app/templates/bin/rake.tt
|
225
234
|
- lib/rails/generators/rails/app/templates/bin/setup.tt
|
226
|
-
- lib/rails/generators/rails/app/templates/bin/spring.tt
|
227
|
-
- lib/rails/generators/rails/app/templates/bin/yarn.tt
|
228
235
|
- lib/rails/generators/rails/app/templates/config.ru.tt
|
229
236
|
- lib/rails/generators/rails/app/templates/config/application.rb.tt
|
230
237
|
- lib/rails/generators/rails/app/templates/config/boot.rb.tt
|
@@ -242,27 +249,20 @@ files:
|
|
242
249
|
- lib/rails/generators/rails/app/templates/config/environments/development.rb.tt
|
243
250
|
- lib/rails/generators/rails/app/templates/config/environments/production.rb.tt
|
244
251
|
- lib/rails/generators/rails/app/templates/config/environments/test.rb.tt
|
245
|
-
- lib/rails/generators/rails/app/templates/config/initializers/application_controller_renderer.rb.tt
|
246
252
|
- lib/rails/generators/rails/app/templates/config/initializers/assets.rb.tt
|
247
|
-
- lib/rails/generators/rails/app/templates/config/initializers/backtrace_silencers.rb.tt
|
248
253
|
- lib/rails/generators/rails/app/templates/config/initializers/content_security_policy.rb.tt
|
249
|
-
- lib/rails/generators/rails/app/templates/config/initializers/cookies_serializer.rb.tt
|
250
254
|
- lib/rails/generators/rails/app/templates/config/initializers/cors.rb.tt
|
251
255
|
- lib/rails/generators/rails/app/templates/config/initializers/filter_parameter_logging.rb.tt
|
252
256
|
- lib/rails/generators/rails/app/templates/config/initializers/inflections.rb.tt
|
253
|
-
- lib/rails/generators/rails/app/templates/config/initializers/
|
254
|
-
- lib/rails/generators/rails/app/templates/config/initializers/new_framework_defaults_6_1.rb.tt
|
257
|
+
- lib/rails/generators/rails/app/templates/config/initializers/new_framework_defaults_7_0.rb.tt
|
255
258
|
- lib/rails/generators/rails/app/templates/config/initializers/permissions_policy.rb.tt
|
256
|
-
- lib/rails/generators/rails/app/templates/config/initializers/wrap_parameters.rb.tt
|
257
259
|
- lib/rails/generators/rails/app/templates/config/locales/en.yml
|
258
260
|
- lib/rails/generators/rails/app/templates/config/puma.rb.tt
|
259
261
|
- lib/rails/generators/rails/app/templates/config/routes.rb.tt
|
260
|
-
- lib/rails/generators/rails/app/templates/config/spring.rb.tt
|
261
262
|
- lib/rails/generators/rails/app/templates/config/storage.yml.tt
|
262
263
|
- lib/rails/generators/rails/app/templates/db/seeds.rb.tt
|
263
264
|
- lib/rails/generators/rails/app/templates/gitattributes.tt
|
264
265
|
- lib/rails/generators/rails/app/templates/gitignore.tt
|
265
|
-
- lib/rails/generators/rails/app/templates/package.json.tt
|
266
266
|
- lib/rails/generators/rails/app/templates/public/404.html
|
267
267
|
- lib/rails/generators/rails/app/templates/public/422.html
|
268
268
|
- lib/rails/generators/rails/app/templates/public/500.html
|
@@ -275,9 +275,6 @@ files:
|
|
275
275
|
- lib/rails/generators/rails/app/templates/test/channels/application_cable/connection_test.rb.tt
|
276
276
|
- lib/rails/generators/rails/app/templates/test/test_helper.rb.tt
|
277
277
|
- lib/rails/generators/rails/application_record/application_record_generator.rb
|
278
|
-
- lib/rails/generators/rails/assets/USAGE
|
279
|
-
- lib/rails/generators/rails/assets/assets_generator.rb
|
280
|
-
- lib/rails/generators/rails/assets/templates/stylesheet.css
|
281
278
|
- lib/rails/generators/rails/benchmark/USAGE
|
282
279
|
- lib/rails/generators/rails/benchmark/benchmark_generator.rb
|
283
280
|
- lib/rails/generators/rails/benchmark/templates/benchmark.rb.tt
|
@@ -340,7 +337,6 @@ files:
|
|
340
337
|
- lib/rails/generators/rails/resource_route/resource_route_generator.rb
|
341
338
|
- lib/rails/generators/rails/scaffold/USAGE
|
342
339
|
- lib/rails/generators/rails/scaffold/scaffold_generator.rb
|
343
|
-
- lib/rails/generators/rails/scaffold/templates/scaffold.css
|
344
340
|
- lib/rails/generators/rails/scaffold_controller/USAGE
|
345
341
|
- lib/rails/generators/rails/scaffold_controller/scaffold_controller_generator.rb
|
346
342
|
- lib/rails/generators/rails/scaffold_controller/templates/api_controller.rb.tt
|
@@ -426,10 +422,11 @@ licenses:
|
|
426
422
|
- MIT
|
427
423
|
metadata:
|
428
424
|
bug_tracker_uri: https://github.com/rails/rails/issues
|
429
|
-
changelog_uri: https://github.com/rails/rails/blob/
|
430
|
-
documentation_uri: https://api.rubyonrails.org/
|
425
|
+
changelog_uri: https://github.com/rails/rails/blob/v7.0.0/railties/CHANGELOG.md
|
426
|
+
documentation_uri: https://api.rubyonrails.org/v7.0.0/
|
431
427
|
mailing_list_uri: https://discuss.rubyonrails.org/c/rubyonrails-talk
|
432
|
-
source_code_uri: https://github.com/rails/rails/tree/
|
428
|
+
source_code_uri: https://github.com/rails/rails/tree/v7.0.0/railties
|
429
|
+
rubygems_mfa_required: 'true'
|
433
430
|
post_install_message:
|
434
431
|
rdoc_options:
|
435
432
|
- "--exclude"
|
@@ -440,14 +437,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
440
437
|
requirements:
|
441
438
|
- - ">="
|
442
439
|
- !ruby/object:Gem::Version
|
443
|
-
version: 2.
|
440
|
+
version: 2.7.0
|
444
441
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
445
442
|
requirements:
|
446
443
|
- - ">="
|
447
444
|
- !ruby/object:Gem::Version
|
448
445
|
version: '0'
|
449
446
|
requirements: []
|
450
|
-
rubygems_version: 3.
|
447
|
+
rubygems_version: 3.2.32
|
451
448
|
signing_key:
|
452
449
|
specification_version: 4
|
453
450
|
summary: Tools for creating, working with, and running Rails applications.
|
@@ -1,57 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Rails
|
4
|
-
module Command
|
5
|
-
module Spellchecker # :nodoc:
|
6
|
-
class << self
|
7
|
-
def suggest(word, from:)
|
8
|
-
if defined?(DidYouMean::SpellChecker)
|
9
|
-
DidYouMean::SpellChecker.new(dictionary: from.map(&:to_s)).correct(word).first
|
10
|
-
else
|
11
|
-
from.sort_by { |w| levenshtein_distance(word, w) }.first
|
12
|
-
end
|
13
|
-
end
|
14
|
-
|
15
|
-
private
|
16
|
-
# This code is based directly on the Text gem implementation.
|
17
|
-
# Copyright (c) 2006-2013 Paul Battley, Michael Neumann, Tim Fletcher.
|
18
|
-
#
|
19
|
-
# Returns a value representing the "cost" of transforming str1 into str2.
|
20
|
-
def levenshtein_distance(str1, str2) # :doc:
|
21
|
-
s = str1
|
22
|
-
t = str2
|
23
|
-
n = s.length
|
24
|
-
m = t.length
|
25
|
-
|
26
|
-
return m if 0 == n
|
27
|
-
return n if 0 == m
|
28
|
-
|
29
|
-
d = (0..m).to_a
|
30
|
-
x = nil
|
31
|
-
|
32
|
-
# avoid duplicating an enumerable object in the loop
|
33
|
-
str2_codepoint_enumerable = str2.each_codepoint
|
34
|
-
|
35
|
-
str1.each_codepoint.with_index do |char1, i|
|
36
|
-
e = i + 1
|
37
|
-
|
38
|
-
str2_codepoint_enumerable.with_index do |char2, j|
|
39
|
-
cost = (char1 == char2) ? 0 : 1
|
40
|
-
x = [
|
41
|
-
d[j + 1] + 1, # insertion
|
42
|
-
e + 1, # deletion
|
43
|
-
d[j] + cost # substitution
|
44
|
-
].min
|
45
|
-
d[j] = e
|
46
|
-
e = x
|
47
|
-
end
|
48
|
-
|
49
|
-
d[m] = x
|
50
|
-
end
|
51
|
-
|
52
|
-
x
|
53
|
-
end
|
54
|
-
end
|
55
|
-
end
|
56
|
-
end
|
57
|
-
end
|
@@ -1,15 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require "rails/generators/named_base"
|
4
|
-
|
5
|
-
module Css # :nodoc:
|
6
|
-
module Generators # :nodoc:
|
7
|
-
class AssetsGenerator < Rails::Generators::NamedBase # :nodoc:
|
8
|
-
source_root File.expand_path("templates", __dir__)
|
9
|
-
|
10
|
-
def copy_stylesheet
|
11
|
-
copy_file "stylesheet.css", File.join("app/assets/stylesheets", class_path, "#{file_name}.css")
|
12
|
-
end
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|
@@ -1,18 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require "rails/generators/named_base"
|
4
|
-
|
5
|
-
module Css # :nodoc:
|
6
|
-
module Generators # :nodoc:
|
7
|
-
class ScaffoldGenerator < Rails::Generators::NamedBase # :nodoc:
|
8
|
-
source_root Rails::Generators::ScaffoldGenerator.source_root
|
9
|
-
|
10
|
-
# In order to allow the Sass generators to pick up the default Rails CSS and
|
11
|
-
# transform it, we leave it in a standard location for the CSS stylesheet
|
12
|
-
# generators to handle. For the simple, default case, just copy it over.
|
13
|
-
def copy_stylesheet
|
14
|
-
copy_file "scaffold.css", "app/assets/stylesheets/scaffold.css"
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end
|
@@ -1,6 +0,0 @@
|
|
1
|
-
// Action Cable provides the framework to deal with WebSockets in Rails.
|
2
|
-
// You can generate new channels where WebSocket features live using the `bin/rails generate channel` command.
|
3
|
-
|
4
|
-
import { createConsumer } from "@rails/actioncable"
|
5
|
-
|
6
|
-
export default createConsumer()
|
@@ -1,23 +0,0 @@
|
|
1
|
-
// This file is automatically compiled by Webpack, along with any other files
|
2
|
-
// present in this directory. You're encouraged to place your actual application logic in
|
3
|
-
// a relevant structure within app/javascript and only use these pack files to reference
|
4
|
-
// that code so it'll be compiled.
|
5
|
-
|
6
|
-
import Rails from "@rails/ujs"
|
7
|
-
<%- unless options[:skip_turbolinks] -%>
|
8
|
-
import Turbolinks from "turbolinks"
|
9
|
-
<%- end -%>
|
10
|
-
<%- unless skip_active_storage? -%>
|
11
|
-
import * as ActiveStorage from "@rails/activestorage"
|
12
|
-
<%- end -%>
|
13
|
-
<%- unless options[:skip_action_cable] -%>
|
14
|
-
import "channels"
|
15
|
-
<%- end -%>
|
16
|
-
|
17
|
-
Rails.start()
|
18
|
-
<%- unless options[:skip_turbolinks] -%>
|
19
|
-
Turbolinks.start()
|
20
|
-
<%- end -%>
|
21
|
-
<%- unless skip_active_storage? -%>
|
22
|
-
ActiveStorage.start()
|
23
|
-
<%- end -%>
|
@@ -1,9 +0,0 @@
|
|
1
|
-
if !defined?(Spring) && [nil, "development", "test"].include?(ENV["RAILS_ENV"])
|
2
|
-
# Load Spring without loading other gems in the Gemfile, for speed.
|
3
|
-
require "bundler"
|
4
|
-
Bundler.locked_gems.specs.find { |spec| spec.name == "spring" }&.tap do |spring|
|
5
|
-
Gem.use_paths Gem.dir, Bundler.bundle_path.to_s, *Gem.path
|
6
|
-
gem "spring", spring.version
|
7
|
-
require "spring/binstub"
|
8
|
-
end
|
9
|
-
end
|
@@ -1,18 +0,0 @@
|
|
1
|
-
require 'pathname'
|
2
|
-
|
3
|
-
APP_ROOT = File.expand_path('..', __dir__)
|
4
|
-
Dir.chdir(APP_ROOT) do
|
5
|
-
executable_path = ENV["PATH"].split(File::PATH_SEPARATOR).find do |path|
|
6
|
-
normalized_path = File.expand_path(path)
|
7
|
-
|
8
|
-
normalized_path != __dir__ && File.executable?(Pathname.new(normalized_path).join('yarn'))
|
9
|
-
end
|
10
|
-
|
11
|
-
if executable_path
|
12
|
-
exec File.expand_path(Pathname.new(executable_path).join('yarn')), *ARGV
|
13
|
-
else
|
14
|
-
$stderr.puts "Yarn executable was not detected in the system."
|
15
|
-
$stderr.puts "Download Yarn at https://yarnpkg.com/en/docs/install"
|
16
|
-
exit 1
|
17
|
-
end
|
18
|
-
end
|
@@ -1,8 +0,0 @@
|
|
1
|
-
# Be sure to restart your server when you modify this file.
|
2
|
-
|
3
|
-
# You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
|
4
|
-
# Rails.backtrace_cleaner.add_silencer { |line| /my_noisy_library/.match?(line) }
|
5
|
-
|
6
|
-
# You can also remove all the silencers if you're trying to debug a problem that might stem from framework code
|
7
|
-
# by setting BACKTRACE=1 before calling your invocation, like "BACKTRACE=1 ./bin/rails runner 'MyClass.perform'".
|
8
|
-
Rails.backtrace_cleaner.remove_silencers! if ENV["BACKTRACE"]
|
data/lib/rails/generators/rails/app/templates/config/initializers/new_framework_defaults_6_1.rb.tt
DELETED
@@ -1,63 +0,0 @@
|
|
1
|
-
# Be sure to restart your server when you modify this file.
|
2
|
-
#
|
3
|
-
# This file contains migration options to ease your Rails 6.1 upgrade.
|
4
|
-
#
|
5
|
-
# Once upgraded flip defaults one by one to migrate to the new default.
|
6
|
-
#
|
7
|
-
# Read the Guide for Upgrading Ruby on Rails for more info on each option.
|
8
|
-
|
9
|
-
# Support for inversing belongs_to -> has_many Active Record associations.
|
10
|
-
# Rails.application.config.active_record.has_many_inversing = true
|
11
|
-
|
12
|
-
# Track Active Storage variants in the database.
|
13
|
-
# Rails.application.config.active_storage.track_variants = true
|
14
|
-
|
15
|
-
# Apply random variation to the delay when retrying failed jobs.
|
16
|
-
# Rails.application.config.active_job.retry_jitter = 0.15
|
17
|
-
|
18
|
-
# Stop executing `after_enqueue`/`after_perform` callbacks if
|
19
|
-
# `before_enqueue`/`before_perform` respectively halts with `throw :abort`.
|
20
|
-
# Rails.application.config.active_job.skip_after_callbacks_if_terminated = true
|
21
|
-
|
22
|
-
# Specify cookies SameSite protection level: either :none, :lax, or :strict.
|
23
|
-
#
|
24
|
-
# This change is not backwards compatible with earlier Rails versions.
|
25
|
-
# It's best enabled when your entire app is migrated and stable on 6.1.
|
26
|
-
# Rails.application.config.action_dispatch.cookies_same_site_protection = :lax
|
27
|
-
|
28
|
-
# Generate CSRF tokens that are encoded in URL-safe Base64.
|
29
|
-
#
|
30
|
-
# This change is not backwards compatible with earlier Rails versions.
|
31
|
-
# It's best enabled when your entire app is migrated and stable on 6.1.
|
32
|
-
# Rails.application.config.action_controller.urlsafe_csrf_tokens = true
|
33
|
-
|
34
|
-
# Specify whether `ActiveSupport::TimeZone.utc_to_local` returns a time with an
|
35
|
-
# UTC offset or a UTC time.
|
36
|
-
# ActiveSupport.utc_to_local_returns_utc_offset_times = true
|
37
|
-
|
38
|
-
# Change the default HTTP status code to `308` when redirecting non-GET/HEAD
|
39
|
-
# requests to HTTPS in `ActionDispatch::SSL` middleware.
|
40
|
-
# Rails.application.config.action_dispatch.ssl_default_redirect_status = 308
|
41
|
-
|
42
|
-
# Use new connection handling API. For most applications this won't have any
|
43
|
-
# effect. For applications using multiple databases, this new API provides
|
44
|
-
# support for granular connection swapping.
|
45
|
-
# Rails.application.config.active_record.legacy_connection_handling = false
|
46
|
-
|
47
|
-
# Make `form_with` generate non-remote forms by default.
|
48
|
-
# Rails.application.config.action_view.form_with_generates_remote_forms = false
|
49
|
-
|
50
|
-
# Set the default queue name for the analysis job to the queue adapter default.
|
51
|
-
# Rails.application.config.active_storage.queues.analysis = nil
|
52
|
-
|
53
|
-
# Set the default queue name for the purge job to the queue adapter default.
|
54
|
-
# Rails.application.config.active_storage.queues.purge = nil
|
55
|
-
|
56
|
-
# Set the default queue name for the incineration job to the queue adapter default.
|
57
|
-
# Rails.application.config.action_mailbox.queues.incineration = nil
|
58
|
-
|
59
|
-
# Set the default queue name for the routing job to the queue adapter default.
|
60
|
-
# Rails.application.config.action_mailbox.queues.routing = nil
|
61
|
-
|
62
|
-
# Set the default queue name for the mail deliver job to the queue adapter default.
|
63
|
-
# Rails.application.config.action_mailer.deliver_later_queue_name = nil
|