railties 6.1.6 → 7.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +626 -259
- data/MIT-LICENSE +1 -1
- data/RDOC_MAIN.md +99 -0
- data/README.rdoc +5 -6
- data/lib/minitest/rails_plugin.rb +64 -1
- data/lib/rails/all.rb +0 -1
- data/lib/rails/api/task.rb +35 -4
- data/lib/rails/app_updater.rb +9 -6
- data/lib/rails/application/bootstrap.rb +41 -7
- data/lib/rails/application/configuration.rb +262 -88
- data/lib/rails/application/default_middleware_stack.rb +29 -4
- data/lib/rails/application/dummy_config.rb +19 -0
- data/lib/rails/application/finisher.rb +89 -124
- data/lib/rails/application/routes_reloader.rb +8 -0
- data/lib/rails/application.rb +200 -125
- data/lib/rails/application_controller.rb +3 -3
- data/lib/rails/autoloaders/inflector.rb +21 -0
- data/lib/rails/autoloaders.rb +42 -42
- data/lib/rails/backtrace_cleaner.rb +1 -1
- data/lib/rails/cli.rb +5 -2
- data/lib/rails/code_statistics.rb +2 -2
- data/lib/rails/code_statistics_calculator.rb +10 -1
- data/lib/rails/command/actions.rb +10 -12
- data/lib/rails/command/base.rb +61 -45
- data/lib/rails/command/behavior.rb +1 -1
- data/lib/rails/command/environment_argument.rb +33 -17
- data/lib/rails/command/helpers/editor.rb +17 -12
- data/lib/rails/command.rb +90 -36
- 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 +17 -13
- data/lib/rails/commands/credentials/USAGE +53 -53
- data/lib/rails/commands/credentials/credentials_command/diffing.rb +31 -19
- data/lib/rails/commands/credentials/credentials_command.rb +67 -69
- data/lib/rails/commands/db/system/change/change_command.rb +2 -1
- data/lib/rails/commands/dbconsole/dbconsole_command.rb +26 -117
- 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 +15 -14
- 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 +34 -21
- 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 +20 -38
- data/lib/rails/commands/server/server_command.rb +33 -30
- 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 +23 -28
- data/lib/rails/console/app.rb +1 -4
- data/lib/rails/console/helpers.rb +2 -2
- data/lib/rails/deprecator.rb +7 -0
- data/lib/rails/engine/configuration.rb +53 -9
- data/lib/rails/engine.rb +63 -48
- data/lib/rails/gem_version.rb +3 -3
- data/lib/rails/generators/actions/create_migration.rb +2 -4
- data/lib/rails/generators/actions.rb +231 -73
- data/lib/rails/generators/active_model.rb +28 -14
- data/lib/rails/generators/app_base.rb +476 -176
- data/lib/rails/generators/app_name.rb +3 -14
- data/lib/rails/generators/base.rb +24 -20
- data/lib/rails/generators/database.rb +39 -1
- data/lib/rails/generators/erb/mailer/templates/layout.html.erb.tt +1 -1
- 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 +57 -9
- data/lib/rails/generators/migration.rb +2 -7
- data/lib/rails/generators/model_helpers.rb +3 -2
- data/lib/rails/generators/named_base.rb +13 -13
- data/lib/rails/generators/rails/app/USAGE +22 -6
- data/lib/rails/generators/rails/app/app_generator.rb +113 -114
- data/lib/rails/generators/rails/app/templates/Dockerfile.tt +103 -0
- data/lib/rails/generators/rails/app/templates/Gemfile.tt +43 -53
- 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/app/views/layouts/mailer.html.erb.tt +1 -1
- 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 +16 -12
- data/lib/rails/generators/rails/app/templates/config/application.rb.tt +6 -18
- 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 +7 -7
- data/lib/rails/generators/rails/app/templates/config/databases/jdbcsqlite3.yml.tt +5 -5
- 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 +7 -9
- data/lib/rails/generators/rails/app/templates/config/databases/sqlite3.yml.tt +4 -4
- data/lib/rails/generators/rails/app/templates/config/databases/sqlserver.yml.tt +5 -5
- 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 +16 -12
- data/lib/rails/generators/rails/app/templates/config/environments/production.rb.tt +38 -61
- data/lib/rails/generators/rails/app/templates/config/environments/test.rb.tt +14 -15
- data/lib/rails/generators/rails/app/templates/config/initializers/assets.rb.tt +3 -5
- data/lib/rails/generators/rails/app/templates/config/initializers/content_security_policy.rb.tt +21 -28
- data/lib/rails/generators/rails/app/templates/config/initializers/cors.rb.tt +3 -3
- data/lib/rails/generators/rails/app/templates/config/initializers/filter_parameter_logging.rb.tt +3 -1
- 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_1.rb.tt +283 -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 +13 -15
- data/lib/rails/generators/rails/app/templates/config/puma.rb.tt +12 -20
- data/lib/rails/generators/rails/app/templates/config/routes.rb.tt +8 -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 +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/gitattributes.tt +0 -5
- data/lib/rails/generators/rails/app/templates/gitignore.tt +7 -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 +10 -8
- 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 +6 -2
- data/lib/rails/generators/rails/controller/templates/controller.rb.tt +1 -5
- 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/db/system/change/change_generator.rb +31 -1
- data/lib/rails/generators/rails/encryption_key_file/encryption_key_file_generator.rb +1 -2
- data/lib/rails/generators/rails/generator/templates/%file_name%_generator.rb.tt +1 -1
- 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 +69 -30
- data/lib/rails/generators/rails/plugin/templates/%name%.gemspec.tt +7 -3
- data/lib/rails/generators/rails/plugin/templates/Gemfile.tt +9 -31
- data/lib/rails/generators/rails/plugin/templates/MIT-LICENSE.tt +1 -1
- 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 +5 -20
- data/lib/rails/generators/rails/plugin/templates/gitignore.tt +0 -7
- 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 +6 -11
- data/lib/rails/generators/rails/resource/resource_generator.rb +6 -0
- data/lib/rails/generators/rails/scaffold/scaffold_generator.rb +2 -20
- data/lib/rails/generators/rails/scaffold_controller/scaffold_controller_generator.rb +1 -1
- 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_case.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 +4 -4
- 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 → behavior.rb} +7 -5
- data/lib/rails/generators.rb +14 -29
- data/lib/rails/health_controller.rb +55 -0
- data/lib/rails/info.rb +2 -2
- data/lib/rails/info_controller.rb +31 -13
- data/lib/rails/initializable.rb +1 -1
- data/lib/rails/mailers_controller.rb +17 -9
- data/lib/rails/paths.rb +14 -11
- data/lib/rails/rack/logger.rb +16 -15
- data/lib/rails/rackup/server.rb +15 -0
- data/lib/rails/railtie/configuration.rb +15 -3
- data/lib/rails/railtie.rb +54 -31
- data/lib/rails/ruby_version_check.rb +5 -3
- data/lib/rails/secrets.rb +10 -8
- data/lib/rails/source_annotation_extractor.rb +68 -19
- data/lib/rails/tasks/engine.rake +8 -8
- data/lib/rails/tasks/framework.rake +4 -12
- data/lib/rails/tasks/log.rake +1 -1
- data/lib/rails/tasks/misc.rake +3 -14
- data/lib/rails/tasks/statistics.rake +8 -5
- data/lib/rails/tasks/tmp.rake +13 -6
- data/lib/rails/tasks/yarn.rake +8 -9
- data/lib/rails/tasks/zeitwerk.rake +14 -42
- data/lib/rails/tasks.rb +0 -2
- data/lib/rails/templates/layouts/application.html.erb +15 -0
- data/lib/rails/templates/rails/mailers/email.html.erb +45 -11
- 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 +65 -48
- data/lib/rails/test_help.rb +13 -14
- data/lib/rails/test_unit/line_filtering.rb +1 -1
- data/lib/rails/test_unit/railtie.rb +0 -4
- data/lib/rails/test_unit/reporter.rb +6 -2
- data/lib/rails/test_unit/runner.rb +45 -20
- data/lib/rails/test_unit/test_parser.rb +88 -0
- data/lib/rails/test_unit/testing.rake +18 -43
- data/lib/rails/testing/maintain_test_schema.rb +16 -0
- data/lib/rails/version.rb +1 -1
- data/lib/rails/welcome_controller.rb +1 -0
- data/lib/rails/zeitwerk_checker.rb +15 -0
- data/lib/rails.rb +26 -15
- metadata +74 -42
- data/RDOC_MAIN.rdoc +0 -97
- data/lib/rails/.DS_Store +0 -0
- data/lib/rails/application/dummy_erb_compiler.rb +0 -18
- 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 -13
- data/lib/rails/generators/rails/app/templates/bin/yarn.tt +0 -16
- 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 -67
- 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/model/USAGE +0 -113
- data/lib/rails/generators/rails/scaffold/templates/scaffold.css +0 -80
- data/lib/rails/tasks/middleware.rake +0 -9
- data/lib/rails/tasks/restart.rake +0 -9
@@ -1,15 +1,31 @@
|
|
1
1
|
Description:
|
2
|
-
The
|
2
|
+
The `rails new` command creates a new Rails application with a default
|
3
3
|
directory structure and configuration at the path you specify.
|
4
4
|
|
5
5
|
You can specify extra command-line arguments to be used every time
|
6
|
-
|
6
|
+
`rails new` runs in the .railsrc configuration file in your home directory,
|
7
7
|
or in $XDG_CONFIG_HOME/rails/railsrc if XDG_CONFIG_HOME is set.
|
8
8
|
|
9
9
|
Note that the arguments specified in the .railsrc file don't affect the
|
10
|
-
|
10
|
+
default values shown above in this help message.
|
11
11
|
|
12
|
-
|
13
|
-
rails new
|
12
|
+
You can specify which version to use when creating a new rails application
|
13
|
+
using `rails _<version>_ new`.
|
14
14
|
|
15
|
-
|
15
|
+
Examples:
|
16
|
+
`rails new ~/Code/Ruby/weblog`
|
17
|
+
|
18
|
+
This generates a new Rails app in ~/Code/Ruby/weblog.
|
19
|
+
|
20
|
+
`rails _<version>_ new weblog`
|
21
|
+
|
22
|
+
This generates a new Rails app with the provided version in ./weblog.
|
23
|
+
|
24
|
+
`rails new weblog --api`
|
25
|
+
|
26
|
+
This generates a new Rails app in API mode in ./weblog.
|
27
|
+
|
28
|
+
`rails new weblog --skip-action-mailer`
|
29
|
+
|
30
|
+
This generates a new Rails app without Action Mailer in ./weblog.
|
31
|
+
Any part of Rails can be skipped during app generation.
|
@@ -21,8 +21,8 @@ module Rails
|
|
21
21
|
RUBY
|
22
22
|
end
|
23
23
|
|
24
|
-
def method_missing(
|
25
|
-
@generator.send(
|
24
|
+
def method_missing(...)
|
25
|
+
@generator.send(...)
|
26
26
|
end
|
27
27
|
end
|
28
28
|
|
@@ -54,6 +54,10 @@ module Rails
|
|
54
54
|
template "ruby-version", ".ruby-version"
|
55
55
|
end
|
56
56
|
|
57
|
+
def node_version
|
58
|
+
template "node-version", ".node-version"
|
59
|
+
end
|
60
|
+
|
57
61
|
def gemfile
|
58
62
|
template "Gemfile"
|
59
63
|
end
|
@@ -70,16 +74,20 @@ module Rails
|
|
70
74
|
template "gitattributes", ".gitattributes"
|
71
75
|
end
|
72
76
|
|
77
|
+
def dockerfiles
|
78
|
+
template "Dockerfile"
|
79
|
+
template "dockerignore", ".dockerignore"
|
80
|
+
|
81
|
+
template "docker-entrypoint", "bin/docker-entrypoint"
|
82
|
+
chmod "bin/docker-entrypoint", 0755 & ~File.umask, verbose: false
|
83
|
+
end
|
84
|
+
|
73
85
|
def version_control
|
74
86
|
if !options[:skip_git] && !options[:pretend]
|
75
|
-
run
|
87
|
+
run git_init_command, capture: options[:quiet], abort_on_failure: false
|
76
88
|
end
|
77
89
|
end
|
78
90
|
|
79
|
-
def package_json
|
80
|
-
template "package.json"
|
81
|
-
end
|
82
|
-
|
83
91
|
def app
|
84
92
|
directory "app"
|
85
93
|
|
@@ -94,58 +102,42 @@ module Rails
|
|
94
102
|
"#{shebang}\n" + content
|
95
103
|
end
|
96
104
|
chmod "bin", 0755 & ~File.umask, verbose: false
|
97
|
-
|
98
|
-
remove_file "bin/spring" unless spring_install?
|
99
|
-
remove_file "bin/yarn" if options[:skip_javascript]
|
100
105
|
end
|
101
106
|
|
102
107
|
def bin_when_updating
|
103
108
|
bin
|
104
109
|
end
|
105
110
|
|
106
|
-
def yarn_when_updating
|
107
|
-
template "bin/yarn", force: true do |content|
|
108
|
-
"#{shebang}\n" + content
|
109
|
-
end
|
110
|
-
|
111
|
-
chmod "bin", 0755 & ~File.umask, verbose: false
|
112
|
-
end
|
113
|
-
|
114
111
|
def config
|
115
112
|
empty_directory "config"
|
116
113
|
|
117
114
|
inside "config" do
|
118
|
-
template "routes.rb"
|
115
|
+
template "routes.rb" unless options[:update]
|
119
116
|
template "application.rb"
|
120
117
|
template "environment.rb"
|
121
|
-
template "cable.yml" unless options[:skip_action_cable]
|
122
|
-
template "puma.rb" unless options[:
|
123
|
-
template "
|
124
|
-
template "storage.yml" unless skip_active_storage?
|
118
|
+
template "cable.yml" unless options[:update] || options[:skip_action_cable]
|
119
|
+
template "puma.rb" unless options[:update]
|
120
|
+
template "storage.yml" unless options[:update] || skip_active_storage?
|
125
121
|
|
126
122
|
directory "environments"
|
127
123
|
directory "initializers"
|
128
|
-
directory "locales"
|
124
|
+
directory "locales" unless options[:update]
|
129
125
|
end
|
130
126
|
end
|
131
127
|
|
132
128
|
def config_when_updating
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
129
|
+
action_cable_config_exist = File.exist?("config/cable.yml")
|
130
|
+
active_storage_config_exist = File.exist?("config/storage.yml")
|
131
|
+
rack_cors_config_exist = File.exist?("config/initializers/cors.rb")
|
132
|
+
assets_config_exist = File.exist?("config/initializers/assets.rb")
|
133
|
+
asset_manifest_exist = File.exist?("app/assets/config/manifest.js")
|
134
|
+
asset_app_stylesheet_exist = File.exist?("app/assets/stylesheets/application.css")
|
135
|
+
csp_config_exist = File.exist?("config/initializers/content_security_policy.rb")
|
139
136
|
permissions_policy_config_exist = File.exist?("config/initializers/permissions_policy.rb")
|
140
137
|
|
141
138
|
@config_target_version = Rails.application.config.loaded_config_version || "5.0"
|
142
139
|
|
143
140
|
config
|
144
|
-
configru
|
145
|
-
|
146
|
-
unless cookie_serializer_config_exist
|
147
|
-
gsub_file "config/initializers/cookies_serializer.rb", /json(?!,)/, "marshal"
|
148
|
-
end
|
149
141
|
|
150
142
|
if !options[:skip_action_cable] && !action_cable_config_exist
|
151
143
|
template "config/cable.yml"
|
@@ -155,19 +147,23 @@ module Rails
|
|
155
147
|
template "config/storage.yml"
|
156
148
|
end
|
157
149
|
|
158
|
-
if
|
150
|
+
if skip_sprockets? && skip_propshaft? && !assets_config_exist
|
159
151
|
remove_file "config/initializers/assets.rb"
|
160
152
|
end
|
161
153
|
|
154
|
+
if skip_sprockets? && !asset_manifest_exist
|
155
|
+
remove_file "app/assets/config/manifest.js"
|
156
|
+
end
|
157
|
+
|
158
|
+
if skip_sprockets? && !asset_app_stylesheet_exist
|
159
|
+
remove_file "app/assets/stylesheets/application.css"
|
160
|
+
end
|
161
|
+
|
162
162
|
unless rack_cors_config_exist
|
163
163
|
remove_file "config/initializers/cors.rb"
|
164
164
|
end
|
165
165
|
|
166
166
|
if options[:api]
|
167
|
-
unless cookie_serializer_config_exist
|
168
|
-
remove_file "config/initializers/cookies_serializer.rb"
|
169
|
-
end
|
170
|
-
|
171
167
|
unless csp_config_exist
|
172
168
|
remove_file "config/initializers/content_security_policy.rb"
|
173
169
|
end
|
@@ -191,7 +187,15 @@ module Rails
|
|
191
187
|
return if options[:pretend] || options[:dummy_app]
|
192
188
|
|
193
189
|
require "rails/generators/rails/credentials/credentials_generator"
|
194
|
-
Rails::Generators::CredentialsGenerator.new([], quiet:
|
190
|
+
Rails::Generators::CredentialsGenerator.new([], quiet: true).add_credentials_file
|
191
|
+
end
|
192
|
+
|
193
|
+
def credentials_diff_enroll
|
194
|
+
return if options[:skip_decrypted_diffs] || options[:dummy_app] || options[:pretend]
|
195
|
+
|
196
|
+
@generator.shell.mute do
|
197
|
+
rails_command "credentials:diff --enroll", inline: true, shell: @generator.shell
|
198
|
+
end
|
195
199
|
end
|
196
200
|
|
197
201
|
def database_yml
|
@@ -263,74 +267,73 @@ module Rails
|
|
263
267
|
class AppGenerator < AppBase
|
264
268
|
# :stopdoc:
|
265
269
|
|
266
|
-
WEBPACKS = %w( react vue angular elm stimulus )
|
267
|
-
|
268
270
|
add_shared_options_for "application"
|
269
271
|
|
270
272
|
# Add rails command options
|
271
|
-
class_option :version, type: :boolean, aliases: "-v", group: :rails,
|
272
|
-
|
273
|
-
|
274
|
-
class_option :
|
275
|
-
|
276
|
-
|
277
|
-
class_option :
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
273
|
+
class_option :version, type: :boolean, aliases: "-v", group: :rails, desc: "Show Rails version number and quit"
|
274
|
+
class_option :api, type: :boolean, desc: "Preconfigure smaller stack for API only apps"
|
275
|
+
class_option :minimal, type: :boolean, desc: "Preconfigure a minimal rails app"
|
276
|
+
class_option :javascript, type: :string, aliases: ["-j", "--js"], default: "importmap", desc: "Choose JavaScript approach [options: importmap (default), bun, webpack, esbuild, rollup]"
|
277
|
+
class_option :css, type: :string, aliases: "-c", desc: "Choose CSS processor [options: tailwind, bootstrap, bulma, postcss, sass] check https://github.com/rails/cssbundling-rails for more options"
|
278
|
+
class_option :skip_bundle, type: :boolean, aliases: "-B", default: nil, desc: "Don't run bundle install"
|
279
|
+
class_option :skip_decrypted_diffs, type: :boolean, default: nil, desc: "Don't configure git to show decrypted diffs of encrypted credentials"
|
280
|
+
|
281
|
+
OPTION_IMPLICATIONS = # :nodoc:
|
282
|
+
AppBase::OPTION_IMPLICATIONS.merge(
|
283
|
+
skip_git: [:skip_decrypted_diffs],
|
284
|
+
minimal: [
|
285
|
+
:skip_action_cable,
|
286
|
+
:skip_action_mailbox,
|
287
|
+
:skip_action_mailer,
|
288
|
+
:skip_action_text,
|
289
|
+
:skip_active_job,
|
290
|
+
:skip_active_storage,
|
291
|
+
:skip_bootsnap,
|
292
|
+
:skip_dev_gems,
|
293
|
+
:skip_hotwire,
|
294
|
+
:skip_javascript,
|
295
|
+
:skip_jbuilder,
|
296
|
+
:skip_system_test,
|
297
|
+
],
|
298
|
+
api: [
|
299
|
+
:skip_asset_pipeline,
|
300
|
+
:skip_javascript,
|
301
|
+
],
|
302
|
+
) do |option, implications, more_implications|
|
303
|
+
implications + more_implications
|
304
|
+
end
|
282
305
|
|
283
|
-
|
284
|
-
desc: "Preconfigure Webpack with a particular framework (options: #{WEBPACKS.join(", ")})"
|
306
|
+
META_OPTIONS = [:minimal] # :nodoc:
|
285
307
|
|
286
|
-
|
287
|
-
|
308
|
+
def self.apply_rails_template(template, destination) # :nodoc:
|
309
|
+
generator = new([destination], { template: template }, { destination_root: destination })
|
310
|
+
generator.set_default_accessors!
|
311
|
+
generator.apply_rails_template
|
312
|
+
generator.run_bundle
|
313
|
+
generator.run_after_bundle_callbacks
|
314
|
+
end
|
288
315
|
|
289
316
|
def initialize(*args)
|
290
317
|
super
|
291
318
|
|
319
|
+
imply_options(OPTION_IMPLICATIONS, meta_options: META_OPTIONS)
|
320
|
+
|
292
321
|
if !options[:skip_active_record] && !DATABASES.include?(options[:database])
|
293
322
|
raise Error, "Invalid value for --database option. Supported preconfigurations are: #{DATABASES.join(", ")}."
|
294
323
|
end
|
295
324
|
|
296
|
-
# Force sprockets and yarn to be skipped when generating API only apps.
|
297
|
-
# Can't modify options hash as it's frozen by default.
|
298
|
-
if options[:api]
|
299
|
-
self.options = options.merge(skip_sprockets: true, skip_javascript: true).freeze
|
300
|
-
end
|
301
|
-
|
302
|
-
if options[:minimal]
|
303
|
-
self.options = options.merge(
|
304
|
-
skip_action_cable: true,
|
305
|
-
skip_action_mailer: true,
|
306
|
-
skip_action_mailbox: true,
|
307
|
-
skip_action_text: true,
|
308
|
-
skip_active_job: true,
|
309
|
-
skip_active_storage: true,
|
310
|
-
skip_bootsnap: true,
|
311
|
-
skip_dev_gems: true,
|
312
|
-
skip_javascript: true,
|
313
|
-
skip_jbuilder: true,
|
314
|
-
skip_spring: true,
|
315
|
-
skip_system_test: true,
|
316
|
-
skip_webpack_install: true,
|
317
|
-
skip_turbolinks: true).tap do |option|
|
318
|
-
if option[:webpack]
|
319
|
-
option[:skip_webpack_install] = false
|
320
|
-
option[:skip_javascript] = false
|
321
|
-
end
|
322
|
-
end.freeze
|
323
|
-
end
|
324
|
-
|
325
325
|
@after_bundle_callbacks = []
|
326
326
|
end
|
327
327
|
|
328
|
+
public_task :report_implied_options
|
328
329
|
public_task :set_default_accessors!
|
329
330
|
public_task :create_root
|
331
|
+
public_task :target_rails_prerelease
|
330
332
|
|
331
333
|
def create_root_files
|
332
334
|
build(:readme)
|
333
335
|
build(:rakefile)
|
336
|
+
build(:node_version) if using_node?
|
334
337
|
build(:ruby_version)
|
335
338
|
build(:configru)
|
336
339
|
|
@@ -339,9 +342,8 @@ module Rails
|
|
339
342
|
build(:gitattributes)
|
340
343
|
end
|
341
344
|
|
342
|
-
build(:gemfile)
|
345
|
+
build(:gemfile)
|
343
346
|
build(:version_control)
|
344
|
-
build(:package_json) unless options[:skip_javascript]
|
345
347
|
end
|
346
348
|
|
347
349
|
def create_app_files
|
@@ -357,11 +359,6 @@ module Rails
|
|
357
359
|
end
|
358
360
|
remove_task :update_bin_files
|
359
361
|
|
360
|
-
def update_bin_yarn
|
361
|
-
build(:yarn_when_updating)
|
362
|
-
end
|
363
|
-
remove_task :update_bin_yarn
|
364
|
-
|
365
362
|
def update_active_storage
|
366
363
|
unless skip_active_storage?
|
367
364
|
rails_command "active_storage:update", inline: true
|
@@ -369,6 +366,11 @@ module Rails
|
|
369
366
|
end
|
370
367
|
remove_task :update_active_storage
|
371
368
|
|
369
|
+
def create_dockerfiles
|
370
|
+
return if options[:skip_docker] || options[:dummy_app]
|
371
|
+
build(:dockerfiles)
|
372
|
+
end
|
373
|
+
|
372
374
|
def create_config_files
|
373
375
|
build(:config)
|
374
376
|
end
|
@@ -384,6 +386,7 @@ module Rails
|
|
384
386
|
|
385
387
|
def create_credentials
|
386
388
|
build(:credentials)
|
389
|
+
build(:credentials_diff_enroll)
|
387
390
|
end
|
388
391
|
|
389
392
|
def display_upgrade_guide_info
|
@@ -434,7 +437,7 @@ module Rails
|
|
434
437
|
end
|
435
438
|
|
436
439
|
def create_storage_files
|
437
|
-
build(:storage)
|
440
|
+
build(:storage)
|
438
441
|
end
|
439
442
|
|
440
443
|
def delete_app_assets_if_api_option
|
@@ -473,22 +476,16 @@ module Rails
|
|
473
476
|
end
|
474
477
|
end
|
475
478
|
|
476
|
-
def
|
477
|
-
if
|
478
|
-
|
479
|
-
end
|
480
|
-
end
|
481
|
-
|
482
|
-
def delete_js_packs_when_minimal_skipping_webpack
|
483
|
-
if options[:minimal] && options[:skip_webpack_install]
|
484
|
-
remove_dir "app/javascript/packs"
|
485
|
-
keep_file "app/javascript"
|
479
|
+
def delete_assets_initializer_skipping_sprockets_and_propshaft
|
480
|
+
if skip_sprockets? && skip_propshaft?
|
481
|
+
remove_file "config/initializers/assets.rb"
|
486
482
|
end
|
487
|
-
end
|
488
483
|
|
489
|
-
|
490
|
-
|
491
|
-
|
484
|
+
if skip_sprockets?
|
485
|
+
remove_file "app/assets/config/manifest.js"
|
486
|
+
remove_dir "app/assets/config"
|
487
|
+
remove_file "app/assets/stylesheets/application.css"
|
488
|
+
create_file "app/assets/stylesheets/application.css", "/* Application styles */\n" unless options[:api]
|
492
489
|
end
|
493
490
|
end
|
494
491
|
|
@@ -523,7 +520,6 @@ module Rails
|
|
523
520
|
|
524
521
|
def delete_non_api_initializers_if_api_option
|
525
522
|
if options[:api]
|
526
|
-
remove_file "config/initializers/cookies_serializer.rb"
|
527
523
|
remove_file "config/initializers/content_security_policy.rb"
|
528
524
|
remove_file "config/initializers/permissions_policy.rb"
|
529
525
|
end
|
@@ -537,7 +533,7 @@ module Rails
|
|
537
533
|
|
538
534
|
def delete_new_framework_defaults
|
539
535
|
unless options[:update]
|
540
|
-
remove_file "config/initializers/
|
536
|
+
remove_file "config/initializers/new_framework_defaults_#{Rails::VERSION::MAJOR}_#{Rails::VERSION::MINOR}.rb"
|
541
537
|
end
|
542
538
|
end
|
543
539
|
|
@@ -545,9 +541,12 @@ module Rails
|
|
545
541
|
build(:leftovers)
|
546
542
|
end
|
547
543
|
|
548
|
-
public_task :apply_rails_template
|
544
|
+
public_task :apply_rails_template
|
545
|
+
public_task :run_bundle
|
549
546
|
public_task :generate_bundler_binstub
|
550
|
-
public_task :
|
547
|
+
public_task :run_javascript
|
548
|
+
public_task :run_hotwire
|
549
|
+
public_task :run_css
|
551
550
|
|
552
551
|
def run_after_bundle_callbacks
|
553
552
|
@after_bundle_callbacks.each(&:call)
|
@@ -565,7 +564,7 @@ module Rails
|
|
565
564
|
create_file(*args, &block)
|
566
565
|
end
|
567
566
|
|
568
|
-
# Registers a callback to be executed after bundle
|
567
|
+
# Registers a callback to be executed after bundle binstubs
|
569
568
|
# have run.
|
570
569
|
#
|
571
570
|
# after_bundle do
|
@@ -0,0 +1,103 @@
|
|
1
|
+
# syntax = docker/dockerfile:1
|
2
|
+
|
3
|
+
# Make sure RUBY_VERSION matches the Ruby version in .ruby-version and Gemfile
|
4
|
+
ARG RUBY_VERSION=<%= gem_ruby_version %>
|
5
|
+
FROM registry.docker.com/library/ruby:$RUBY_VERSION-slim as base
|
6
|
+
|
7
|
+
# Rails app lives here
|
8
|
+
WORKDIR /rails
|
9
|
+
|
10
|
+
# Set production environment
|
11
|
+
ENV RAILS_ENV="production" \
|
12
|
+
BUNDLE_DEPLOYMENT="1" \
|
13
|
+
BUNDLE_PATH="/usr/local/bundle" \
|
14
|
+
BUNDLE_WITHOUT="development"
|
15
|
+
|
16
|
+
|
17
|
+
# Throw-away build stage to reduce size of final image
|
18
|
+
FROM base as build
|
19
|
+
|
20
|
+
# Install packages needed to build gems<%= using_node? ? " and node modules" : "" %>
|
21
|
+
RUN apt-get update -qq && \
|
22
|
+
apt-get install --no-install-recommends -y <%= dockerfile_build_packages.join(" ") %>
|
23
|
+
|
24
|
+
<% if using_node? -%>
|
25
|
+
# Install JavaScript dependencies
|
26
|
+
ARG NODE_VERSION=<%= node_version %>
|
27
|
+
ARG YARN_VERSION=<%= dockerfile_yarn_version %>
|
28
|
+
ENV PATH=/usr/local/node/bin:$PATH
|
29
|
+
RUN curl -sL https://github.com/nodenv/node-build/archive/master.tar.gz | tar xz -C /tmp/ && \
|
30
|
+
/tmp/node-build-master/bin/node-build "${NODE_VERSION}" /usr/local/node && \
|
31
|
+
npm install -g yarn@$YARN_VERSION && \
|
32
|
+
rm -rf /tmp/node-build-master
|
33
|
+
|
34
|
+
<% end -%>
|
35
|
+
<% if using_bun? -%>
|
36
|
+
ENV BUN_INSTALL=/usr/local/bun
|
37
|
+
ENV PATH=/usr/local/bun/bin:$PATH
|
38
|
+
ARG BUN_VERSION=<%= dockerfile_bun_version %>
|
39
|
+
RUN curl -fsSL https://bun.sh/install | bash -s -- "bun-v${BUN_VERSION}"
|
40
|
+
|
41
|
+
<% end -%>
|
42
|
+
# Install application gems
|
43
|
+
COPY Gemfile Gemfile.lock ./
|
44
|
+
RUN bundle install && \
|
45
|
+
rm -rf ~/.bundle/ "${BUNDLE_PATH}"/ruby/*/cache "${BUNDLE_PATH}"/ruby/*/bundler/gems/*/.git<% if depend_on_bootsnap? -%> && \
|
46
|
+
bundle exec bootsnap precompile --gemfile<% end %>
|
47
|
+
|
48
|
+
<% if using_node? -%>
|
49
|
+
# Install node modules
|
50
|
+
COPY package.json yarn.lock ./
|
51
|
+
RUN yarn install --frozen-lockfile
|
52
|
+
|
53
|
+
<% end -%>
|
54
|
+
<% if using_bun? -%>
|
55
|
+
# Install node modules
|
56
|
+
COPY package.json bun.lockb ./
|
57
|
+
RUN bun install --frozen-lockfile
|
58
|
+
|
59
|
+
<% end -%>
|
60
|
+
# Copy application code
|
61
|
+
COPY . .
|
62
|
+
|
63
|
+
<% if depend_on_bootsnap? -%>
|
64
|
+
# Precompile bootsnap code for faster boot times
|
65
|
+
RUN bundle exec bootsnap precompile app/ lib/
|
66
|
+
|
67
|
+
<% end -%>
|
68
|
+
<% unless dockerfile_binfile_fixups.empty? -%>
|
69
|
+
# Adjust binfiles to be executable on Linux
|
70
|
+
<%= "RUN " + dockerfile_binfile_fixups.join(" && \\\n ") %>
|
71
|
+
|
72
|
+
<% end -%>
|
73
|
+
<% unless options.api? || skip_asset_pipeline? -%>
|
74
|
+
# Precompiling assets for production without requiring secret RAILS_MASTER_KEY
|
75
|
+
RUN SECRET_KEY_BASE_DUMMY=1 ./bin/rails assets:precompile
|
76
|
+
|
77
|
+
<% end -%>
|
78
|
+
|
79
|
+
# Final stage for app image
|
80
|
+
FROM base
|
81
|
+
|
82
|
+
<% unless dockerfile_deploy_packages.empty? -%>
|
83
|
+
# Install packages needed for deployment
|
84
|
+
RUN apt-get update -qq && \
|
85
|
+
apt-get install --no-install-recommends -y <%= dockerfile_deploy_packages.join(" ") %> && \
|
86
|
+
rm -rf /var/lib/apt/lists /var/cache/apt/archives
|
87
|
+
|
88
|
+
<% end -%>
|
89
|
+
# Copy built artifacts: gems, application
|
90
|
+
COPY --from=build /usr/local/bundle /usr/local/bundle
|
91
|
+
COPY --from=build /rails /rails
|
92
|
+
|
93
|
+
# Run and own only the runtime files as a non-root user for security
|
94
|
+
RUN useradd rails --create-home --shell /bin/bash && \
|
95
|
+
chown -R rails:rails <%= dockerfile_chown_directories.join(" ") %>
|
96
|
+
USER rails:rails
|
97
|
+
|
98
|
+
# Entrypoint prepares the database.
|
99
|
+
ENTRYPOINT ["/rails/bin/docker-entrypoint"]
|
100
|
+
|
101
|
+
# Start the server by default, this can be overwritten at runtime
|
102
|
+
EXPOSE 3000
|
103
|
+
CMD ["./bin/rails", "server"]
|
@@ -1,78 +1,68 @@
|
|
1
|
-
source
|
2
|
-
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
|
1
|
+
source "https://rubygems.org"
|
3
2
|
|
4
|
-
ruby <%= "
|
3
|
+
ruby <%= "\"#{gem_ruby_version}\"" -%>
|
5
4
|
|
6
|
-
<%
|
7
|
-
|
8
|
-
<% end -%>
|
9
|
-
<% gemfile_entries.each do |gem| -%>
|
10
|
-
<% if gem.comment -%>
|
11
|
-
|
12
|
-
# <%= gem.comment %>
|
13
|
-
<% end -%>
|
14
|
-
<%= gem.commented_out ? '# ' : '' %>gem '<%= gem.name %>'<%= %(, '#{gem.version}') if gem.version -%>
|
15
|
-
<% if gem.options.any? -%>
|
16
|
-
, <%= gem.options.map { |k,v|
|
17
|
-
"#{k}: #{v.inspect.gsub('"', '\'')}" }.join(', ') %>
|
18
|
-
<% end -%>
|
5
|
+
<% gemfile_entries.each do |gemfile_entry| %>
|
6
|
+
<%= gemfile_entry %>
|
19
7
|
<% end -%>
|
8
|
+
<% unless options.minimal? -%>
|
20
9
|
|
21
|
-
# Use
|
22
|
-
# gem
|
23
|
-
<% unless skip_active_storage? -%>
|
10
|
+
# Use Kredis to get higher-level data types in Redis [https://github.com/rails/kredis]
|
11
|
+
# gem "kredis"
|
24
12
|
|
25
|
-
# Use Active
|
26
|
-
# gem
|
13
|
+
# Use Active Model has_secure_password [https://guides.rubyonrails.org/active_model_basics.html#securepassword]
|
14
|
+
# gem "bcrypt", "~> 3.1.7"
|
27
15
|
<% end -%>
|
28
16
|
|
17
|
+
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
|
18
|
+
gem "tzinfo-data", platforms: %i[ <%= bundler_windows_platforms %> jruby ]
|
29
19
|
<% if depend_on_bootsnap? -%>
|
20
|
+
|
30
21
|
# Reduces boot times through caching; required in config/boot.rb
|
31
|
-
gem
|
22
|
+
gem "bootsnap", require: false
|
23
|
+
<% end -%>
|
24
|
+
<% unless skip_active_storage? -%>
|
32
25
|
|
33
|
-
|
26
|
+
# Use Active Storage variants [https://guides.rubyonrails.org/active_storage_overview.html#transforming-images]
|
27
|
+
# gem "image_processing", "~> 1.2"
|
28
|
+
<% end -%>
|
34
29
|
<%- if options.api? -%>
|
35
|
-
# Use Rack CORS for handling Cross-Origin Resource Sharing (CORS), making cross-origin AJAX possible
|
36
|
-
# gem 'rack-cors'
|
37
30
|
|
31
|
+
# Use Rack CORS for handling Cross-Origin Resource Sharing (CORS), making cross-origin Ajax possible
|
32
|
+
# gem "rack-cors"
|
38
33
|
<%- end -%>
|
39
|
-
<% if RUBY_ENGINE ==
|
34
|
+
<% if RUBY_ENGINE == "ruby" -%>
|
35
|
+
|
40
36
|
group :development, :test do
|
41
|
-
#
|
42
|
-
gem
|
37
|
+
# See https://guides.rubyonrails.org/debugging_rails_applications.html#debugging-with-the-debug-gem
|
38
|
+
gem "debug", platforms: %i[ mri <%= bundler_windows_platforms %> ]
|
43
39
|
end
|
44
|
-
|
45
40
|
<% end -%>
|
41
|
+
|
46
42
|
group :development do
|
47
43
|
<%- unless options.api? || options.skip_dev_gems? -%>
|
48
|
-
#
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
gem
|
53
|
-
|
54
|
-
|
55
|
-
#
|
56
|
-
gem
|
44
|
+
# Use console on exceptions pages [https://github.com/rails/web-console]
|
45
|
+
gem "web-console"
|
46
|
+
|
47
|
+
# Add speed badges [https://github.com/MiniProfiler/rack-mini-profiler]
|
48
|
+
# gem "rack-mini-profiler"
|
49
|
+
|
50
|
+
<%- end -%>
|
51
|
+
# Speed up commands on slow machines / big apps [https://github.com/rails/spring]
|
52
|
+
# gem "spring"
|
53
|
+
<%- if RUBY_VERSION >= "3.1" && RUBY_VERSION < "3.2" -%>
|
54
|
+
|
55
|
+
gem "error_highlight", ">= 0.4.0", platforms: [:ruby]
|
57
56
|
<%- end -%>
|
58
|
-
<% if depend_on_listen? -%>
|
59
|
-
gem 'listen', '~> 3.3'
|
60
|
-
<% end -%>
|
61
|
-
<% if spring_install? -%>
|
62
|
-
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
|
63
|
-
gem 'spring'
|
64
|
-
<% end -%>
|
65
57
|
end
|
66
58
|
|
67
59
|
<%- if depends_on_system_test? -%>
|
68
60
|
group :test do
|
69
|
-
#
|
70
|
-
gem
|
71
|
-
gem
|
72
|
-
|
73
|
-
gem
|
61
|
+
# Use system testing [https://guides.rubyonrails.org/testing.html#system-testing]
|
62
|
+
gem "capybara"
|
63
|
+
gem "selenium-webdriver"
|
64
|
+
<%- if RUBY_VERSION < "3.0" -%>
|
65
|
+
gem "webdrivers"
|
66
|
+
<%- end -%>
|
74
67
|
end
|
75
|
-
|
76
68
|
<%- end -%>
|
77
|
-
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
|
78
|
-
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
|