railties 5.1.7 → 5.2.0.beta1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/CHANGELOG.md +77 -241
- data/RDOC_MAIN.rdoc +61 -43
- data/README.rdoc +1 -2
- data/exe/rails +3 -2
- data/lib/minitest/rails_plugin.rb +9 -13
- data/lib/rails.rb +4 -2
- data/lib/rails/all.rb +3 -0
- data/lib/rails/api/generator.rb +10 -1
- data/lib/rails/api/task.rb +11 -1
- data/lib/rails/app_loader.rb +18 -5
- data/lib/rails/app_updater.rb +34 -0
- data/lib/rails/application.rb +90 -18
- data/lib/rails/application/bootstrap.rb +2 -0
- data/lib/rails/application/configuration.rb +79 -36
- data/lib/rails/application/default_middleware_stack.rb +7 -1
- data/lib/rails/application/finisher.rb +3 -1
- data/lib/rails/application/routes_reloader.rb +21 -3
- data/lib/rails/application_controller.rb +3 -1
- data/lib/rails/backtrace_cleaner.rb +3 -1
- data/lib/rails/cli.rb +2 -0
- data/lib/rails/code_statistics.rb +2 -0
- data/lib/rails/code_statistics_calculator.rb +2 -0
- data/lib/rails/command.rb +3 -1
- data/lib/rails/command/actions.rb +6 -4
- data/lib/rails/command/base.rb +5 -3
- data/lib/rails/command/behavior.rb +2 -0
- data/lib/rails/command/environment_argument.rb +14 -1
- data/lib/rails/command/helpers/editor.rb +35 -0
- data/lib/rails/commands.rb +2 -0
- data/lib/rails/commands/application/application_command.rb +2 -0
- data/lib/rails/commands/console/console_command.rb +2 -3
- data/lib/rails/commands/credentials/USAGE +40 -0
- data/lib/rails/commands/credentials/credentials_command.rb +72 -0
- data/lib/rails/commands/dbconsole/dbconsole_command.rb +18 -7
- data/lib/rails/commands/destroy/destroy_command.rb +2 -0
- data/lib/rails/commands/encrypted/encrypted_command.rb +77 -0
- data/lib/rails/commands/generate/generate_command.rb +2 -0
- data/lib/rails/commands/help/help_command.rb +2 -0
- data/lib/rails/commands/new/new_command.rb +2 -0
- data/lib/rails/commands/plugin/plugin_command.rb +2 -0
- data/lib/rails/commands/rake/rake_command.rb +2 -0
- data/lib/rails/commands/runner/USAGE +3 -0
- data/lib/rails/commands/runner/runner_command.rb +7 -3
- data/lib/rails/commands/secrets/secrets_command.rb +15 -10
- data/lib/rails/commands/server/server_command.rb +24 -3
- data/lib/rails/commands/test/test_command.rb +18 -23
- data/lib/rails/commands/version/version_command.rb +2 -0
- data/lib/rails/configuration.rb +2 -0
- data/lib/rails/console/app.rb +2 -0
- data/lib/rails/console/helpers.rb +2 -0
- data/lib/rails/dev_caching.rb +2 -1
- data/lib/rails/engine.rb +3 -1
- data/lib/rails/engine/commands.rb +2 -0
- data/lib/rails/engine/configuration.rb +2 -0
- data/lib/rails/engine/railties.rb +2 -0
- data/lib/rails/engine/updater.rb +3 -1
- data/lib/rails/gem_version.rb +5 -3
- data/lib/rails/generators.rb +8 -3
- data/lib/rails/generators/actions.rb +53 -24
- data/lib/rails/generators/actions/create_migration.rb +2 -0
- data/lib/rails/generators/active_model.rb +2 -0
- data/lib/rails/generators/app_base.rb +94 -57
- data/lib/rails/generators/base.rb +40 -1
- data/lib/rails/generators/css/assets/assets_generator.rb +3 -1
- data/lib/rails/generators/css/scaffold/scaffold_generator.rb +5 -3
- data/lib/rails/generators/erb.rb +2 -0
- data/lib/rails/generators/erb/controller/controller_generator.rb +2 -0
- data/lib/rails/generators/erb/controller/templates/{view.html.erb → view.html.erb.tt} +0 -0
- data/lib/rails/generators/erb/mailer/mailer_generator.rb +2 -0
- data/lib/rails/generators/erb/mailer/templates/{view.html.erb → view.html.erb.tt} +0 -0
- data/lib/rails/generators/erb/mailer/templates/{view.text.erb → view.text.erb.tt} +0 -0
- data/lib/rails/generators/erb/scaffold/scaffold_generator.rb +2 -0
- data/lib/rails/generators/erb/scaffold/templates/{_form.html.erb → _form.html.erb.tt} +4 -4
- data/lib/rails/generators/erb/scaffold/templates/{edit.html.erb → edit.html.erb.tt} +0 -0
- data/lib/rails/generators/erb/scaffold/templates/{index.html.erb → index.html.erb.tt} +4 -4
- data/lib/rails/generators/erb/scaffold/templates/{new.html.erb → new.html.erb.tt} +0 -0
- data/lib/rails/generators/erb/scaffold/templates/{show.html.erb → show.html.erb.tt} +0 -0
- data/lib/rails/generators/generated_attribute.rb +3 -1
- data/lib/rails/generators/js/assets/assets_generator.rb +3 -1
- data/lib/rails/generators/migration.rb +2 -0
- data/lib/rails/generators/model_helpers.rb +2 -0
- data/lib/rails/generators/named_base.rb +35 -45
- data/lib/rails/generators/rails/app/app_generator.rb +64 -23
- data/lib/rails/generators/rails/app/templates/{Gemfile → Gemfile.tt} +17 -6
- data/lib/rails/generators/rails/app/templates/{README.md → README.md.tt} +0 -0
- data/lib/rails/generators/rails/app/templates/{Rakefile → Rakefile.tt} +0 -0
- data/lib/rails/generators/rails/app/templates/app/assets/javascripts/application.js.tt +3 -0
- data/lib/rails/generators/rails/app/templates/app/assets/javascripts/{cable.js → cable.js.tt} +0 -0
- data/lib/rails/generators/rails/app/templates/app/assets/stylesheets/{application.css → application.css.tt} +0 -0
- data/lib/rails/generators/rails/app/templates/app/channels/application_cable/{channel.rb → channel.rb.tt} +0 -0
- data/lib/rails/generators/rails/app/templates/app/channels/application_cable/{connection.rb → connection.rb.tt} +0 -0
- data/lib/rails/generators/rails/app/templates/app/controllers/application_controller.rb.tt +1 -4
- data/lib/rails/generators/rails/app/templates/app/helpers/{application_helper.rb → application_helper.rb.tt} +0 -0
- data/lib/rails/generators/rails/app/templates/app/jobs/{application_job.rb → application_job.rb.tt} +0 -0
- data/lib/rails/generators/rails/app/templates/app/mailers/{application_mailer.rb → application_mailer.rb.tt} +0 -0
- data/lib/rails/generators/rails/app/templates/app/models/{application_record.rb → application_record.rb.tt} +0 -0
- data/lib/rails/generators/rails/app/templates/bin/bundle.tt +2 -0
- data/lib/rails/generators/rails/app/templates/bin/{rails → rails.tt} +0 -0
- data/lib/rails/generators/rails/app/templates/bin/{rake → rake.tt} +0 -0
- data/lib/rails/generators/rails/app/templates/bin/setup.tt +5 -5
- data/lib/rails/generators/rails/app/templates/bin/update.tt +7 -3
- data/lib/rails/generators/rails/app/templates/bin/{yarn → yarn.tt} +3 -3
- data/lib/rails/generators/rails/app/templates/{config.ru → config.ru.tt} +0 -0
- data/lib/rails/generators/rails/app/templates/config/{application.rb → application.rb.tt} +2 -1
- data/lib/rails/generators/rails/app/templates/config/{boot.rb → boot.rb.tt} +1 -0
- data/lib/rails/generators/rails/app/templates/config/{cable.yml → cable.yml.tt} +1 -1
- data/lib/rails/generators/rails/app/templates/config/databases/{frontbase.yml → frontbase.yml.tt} +0 -0
- data/lib/rails/generators/rails/app/templates/config/databases/{ibm_db.yml → ibm_db.yml.tt} +0 -0
- data/lib/rails/generators/rails/app/templates/config/databases/{jdbc.yml → jdbc.yml.tt} +0 -0
- data/lib/rails/generators/rails/app/templates/config/databases/{jdbcmysql.yml → jdbcmysql.yml.tt} +1 -1
- data/lib/rails/generators/rails/app/templates/config/databases/{jdbcpostgresql.yml → jdbcpostgresql.yml.tt} +0 -0
- data/lib/rails/generators/rails/app/templates/config/databases/{jdbcsqlite3.yml → jdbcsqlite3.yml.tt} +0 -0
- data/lib/rails/generators/rails/app/templates/config/databases/{mysql.yml → mysql.yml.tt} +1 -1
- data/lib/rails/generators/rails/app/templates/config/databases/{oracle.yml → oracle.yml.tt} +0 -0
- data/lib/rails/generators/rails/app/templates/config/databases/{postgresql.yml → postgresql.yml.tt} +0 -0
- data/lib/rails/generators/rails/app/templates/config/databases/{sqlite3.yml → sqlite3.yml.tt} +0 -0
- data/lib/rails/generators/rails/app/templates/config/databases/{sqlserver.yml → sqlserver.yml.tt} +2 -2
- data/lib/rails/generators/rails/app/templates/config/{environment.rb → environment.rb.tt} +0 -0
- data/lib/rails/generators/rails/app/templates/config/environments/development.rb.tt +7 -1
- data/lib/rails/generators/rails/app/templates/config/environments/production.rb.tt +12 -7
- data/lib/rails/generators/rails/app/templates/config/environments/test.rb.tt +8 -2
- data/lib/rails/generators/rails/app/templates/config/initializers/{application_controller_renderer.rb → application_controller_renderer.rb.tt} +0 -0
- data/lib/rails/generators/rails/app/templates/config/initializers/{backtrace_silencers.rb → backtrace_silencers.rb.tt} +0 -0
- data/lib/rails/generators/rails/app/templates/config/initializers/content_security_policy.rb.tt +20 -0
- data/lib/rails/generators/rails/app/templates/config/initializers/{cookies_serializer.rb → cookies_serializer.rb.tt} +0 -0
- data/lib/rails/generators/rails/app/templates/config/initializers/{cors.rb → cors.rb.tt} +0 -0
- data/lib/rails/generators/rails/app/templates/config/initializers/{filter_parameter_logging.rb → filter_parameter_logging.rb.tt} +0 -0
- data/lib/rails/generators/rails/app/templates/config/initializers/{inflections.rb → inflections.rb.tt} +0 -0
- data/lib/rails/generators/rails/app/templates/config/initializers/{mime_types.rb → mime_types.rb.tt} +0 -0
- data/lib/rails/generators/rails/app/templates/config/initializers/new_framework_defaults_5_2.rb.tt +27 -0
- data/lib/rails/generators/rails/app/templates/config/{puma.rb → puma.rb.tt} +0 -0
- data/lib/rails/generators/rails/app/templates/config/{routes.rb → routes.rb.tt} +0 -0
- data/lib/rails/generators/rails/app/templates/config/{spring.rb → spring.rb.tt} +2 -2
- data/lib/rails/generators/rails/app/templates/config/storage.yml.tt +35 -0
- data/lib/rails/generators/rails/app/templates/{gitignore → gitignore.tt} +9 -1
- data/lib/rails/generators/rails/app/templates/{package.json → package.json.tt} +0 -0
- data/lib/rails/generators/rails/app/templates/ruby-version.tt +1 -0
- data/lib/rails/generators/rails/app/templates/test/{application_system_test_case.rb → application_system_test_case.rb.tt} +0 -0
- data/lib/rails/generators/rails/app/templates/test/{test_helper.rb → test_helper.rb.tt} +1 -2
- data/lib/rails/generators/rails/application_record/application_record_generator.rb +9 -0
- data/lib/rails/generators/rails/assets/assets_generator.rb +2 -0
- data/lib/rails/generators/rails/assets/templates/stylesheet.css +1 -1
- data/lib/rails/generators/rails/controller/controller_generator.rb +11 -9
- data/lib/rails/generators/rails/controller/templates/{controller.rb → controller.rb.tt} +0 -0
- data/lib/rails/generators/rails/credentials/credentials_generator.rb +48 -0
- data/lib/rails/generators/rails/encrypted_file/encrypted_file_generator.rb +38 -0
- data/lib/rails/generators/rails/encryption_key_file/encryption_key_file_generator.rb +57 -0
- data/lib/rails/generators/rails/generator/generator_generator.rb +2 -0
- data/lib/rails/generators/rails/generator/templates/%file_name%_generator.rb.tt +1 -1
- data/lib/rails/generators/rails/helper/helper_generator.rb +2 -0
- data/lib/rails/generators/rails/helper/templates/{helper.rb → helper.rb.tt} +0 -0
- data/lib/rails/generators/rails/integration_test/integration_test_generator.rb +2 -0
- data/lib/rails/generators/rails/master_key/master_key_generator.rb +51 -0
- data/lib/rails/generators/rails/migration/migration_generator.rb +2 -0
- data/lib/rails/generators/rails/model/model_generator.rb +2 -0
- data/lib/rails/generators/rails/plugin/plugin_generator.rb +18 -9
- data/lib/rails/generators/rails/plugin/templates/%name%.gemspec.tt +24 -0
- data/lib/rails/generators/rails/plugin/templates/{Gemfile → Gemfile.tt} +1 -0
- data/lib/rails/generators/rails/plugin/templates/{MIT-LICENSE → MIT-LICENSE.tt} +0 -0
- data/lib/rails/generators/rails/plugin/templates/{README.md → README.md.tt} +1 -1
- data/lib/rails/generators/rails/plugin/templates/{Rakefile → Rakefile.tt} +6 -7
- data/lib/rails/generators/rails/plugin/templates/bin/rails.tt +21 -4
- data/lib/rails/generators/rails/plugin/templates/bin/test.tt +1 -1
- data/lib/rails/generators/rails/plugin/templates/config/{routes.rb → routes.rb.tt} +0 -0
- data/lib/rails/generators/rails/plugin/templates/gitignore.tt +18 -0
- data/lib/rails/generators/rails/plugin/templates/lib/{%namespaced_name%.rb → %namespaced_name%.rb.tt} +3 -1
- data/lib/rails/generators/rails/plugin/templates/lib/%namespaced_name%/{engine.rb → engine.rb.tt} +0 -0
- data/lib/rails/generators/rails/plugin/templates/lib/%namespaced_name%/railtie.rb.tt +5 -0
- data/lib/rails/generators/rails/plugin/templates/lib/%namespaced_name%/{version.rb → version.rb.tt} +0 -0
- data/lib/rails/generators/rails/plugin/templates/lib/tasks/{%namespaced_name%_tasks.rake → %namespaced_name%_tasks.rake.tt} +0 -0
- data/lib/rails/generators/rails/plugin/templates/rails/{application.rb → application.rb.tt} +6 -3
- data/lib/rails/generators/rails/plugin/templates/rails/{boot.rb → boot.rb.tt} +0 -0
- data/lib/rails/generators/rails/plugin/templates/rails/{dummy_manifest.js → dummy_manifest.js.tt} +0 -1
- data/lib/rails/generators/rails/plugin/templates/rails/{engine_manifest.js → engine_manifest.js.tt} +0 -0
- data/lib/rails/generators/rails/plugin/templates/rails/{javascripts.js → javascripts.js.tt} +3 -0
- data/lib/rails/generators/rails/plugin/templates/rails/{routes.rb → routes.rb.tt} +0 -0
- data/lib/rails/generators/rails/plugin/templates/test/{%namespaced_name%_test.rb → %namespaced_name%_test.rb.tt} +0 -0
- data/lib/rails/generators/rails/plugin/templates/test/{application_system_test_case.rb → application_system_test_case.rb.tt} +0 -0
- data/lib/rails/generators/rails/plugin/templates/test/integration/{navigation_test.rb → navigation_test.rb.tt} +0 -1
- data/lib/rails/generators/rails/plugin/templates/test/{test_helper.rb → test_helper.rb.tt} +7 -6
- data/lib/rails/generators/rails/resource/USAGE +1 -1
- data/lib/rails/generators/rails/resource/resource_generator.rb +2 -0
- data/lib/rails/generators/rails/resource_route/resource_route_generator.rb +21 -24
- data/lib/rails/generators/rails/scaffold/scaffold_generator.rb +2 -3
- data/lib/rails/generators/rails/scaffold_controller/USAGE +1 -1
- data/lib/rails/generators/rails/scaffold_controller/scaffold_controller_generator.rb +2 -0
- data/lib/rails/generators/rails/scaffold_controller/templates/{api_controller.rb → api_controller.rb.tt} +0 -0
- data/lib/rails/generators/rails/scaffold_controller/templates/{controller.rb → controller.rb.tt} +2 -2
- data/lib/rails/generators/rails/system_test/system_test_generator.rb +2 -0
- data/lib/rails/generators/rails/task/task_generator.rb +2 -0
- data/lib/rails/generators/rails/task/templates/{task.rb → task.rb.tt} +0 -0
- data/lib/rails/generators/resource_helpers.rb +2 -0
- data/lib/rails/generators/test_case.rb +4 -2
- data/lib/rails/generators/test_unit.rb +2 -0
- data/lib/rails/generators/test_unit/controller/controller_generator.rb +2 -0
- data/lib/rails/generators/test_unit/controller/templates/{functional_test.rb → functional_test.rb.tt} +0 -0
- data/lib/rails/generators/test_unit/generator/generator_generator.rb +2 -0
- data/lib/rails/generators/test_unit/generator/templates/{generator_test.rb → generator_test.rb.tt} +0 -0
- data/lib/rails/generators/test_unit/helper/helper_generator.rb +2 -0
- data/lib/rails/generators/test_unit/integration/integration_generator.rb +2 -0
- data/lib/rails/generators/test_unit/integration/templates/{integration_test.rb → integration_test.rb.tt} +0 -0
- data/lib/rails/generators/test_unit/job/job_generator.rb +3 -1
- data/lib/rails/generators/test_unit/job/templates/{unit_test.rb.erb → unit_test.rb.tt} +0 -0
- data/lib/rails/generators/test_unit/mailer/mailer_generator.rb +2 -0
- data/lib/rails/generators/test_unit/mailer/templates/{functional_test.rb → functional_test.rb.tt} +0 -0
- data/lib/rails/generators/test_unit/mailer/templates/{preview.rb → preview.rb.tt} +0 -0
- data/lib/rails/generators/test_unit/model/model_generator.rb +2 -0
- data/lib/rails/generators/test_unit/model/templates/{fixtures.yml → fixtures.yml.tt} +0 -0
- data/lib/rails/generators/test_unit/model/templates/{unit_test.rb → unit_test.rb.tt} +0 -0
- data/lib/rails/generators/test_unit/plugin/plugin_generator.rb +2 -0
- data/lib/rails/generators/test_unit/scaffold/scaffold_generator.rb +17 -4
- data/lib/rails/generators/test_unit/scaffold/templates/{api_functional_test.rb → api_functional_test.rb.tt} +2 -2
- data/lib/rails/generators/test_unit/scaffold/templates/{functional_test.rb → functional_test.rb.tt} +2 -2
- data/lib/rails/generators/test_unit/scaffold/templates/system_test.rb.tt +49 -0
- data/lib/rails/generators/test_unit/system/system_generator.rb +3 -1
- data/lib/rails/generators/test_unit/system/templates/{application_system_test_case.rb → application_system_test_case.rb.tt} +0 -0
- data/lib/rails/generators/test_unit/system/templates/{system_test.rb → system_test.rb.tt} +0 -0
- data/lib/rails/generators/testing/assertions.rb +7 -1
- data/lib/rails/generators/testing/behaviour.rb +8 -6
- data/lib/rails/generators/testing/setup_and_teardown.rb +2 -0
- data/lib/rails/info.rb +6 -3
- data/lib/rails/info_controller.rb +2 -0
- data/lib/rails/initializable.rb +2 -0
- data/lib/rails/mailers_controller.rb +9 -1
- data/lib/rails/paths.rb +2 -0
- data/lib/rails/plugin/test.rb +4 -2
- data/lib/rails/rack.rb +2 -0
- data/lib/rails/rack/logger.rb +5 -3
- data/lib/rails/railtie.rb +9 -4
- data/lib/rails/railtie/configurable.rb +2 -0
- data/lib/rails/railtie/configuration.rb +2 -0
- data/lib/rails/ruby_version_check.rb +3 -1
- data/lib/rails/secrets.rb +2 -17
- data/lib/rails/source_annotation_extractor.rb +4 -2
- data/lib/rails/tasks.rb +2 -0
- data/lib/rails/tasks/annotations.rake +2 -0
- data/lib/rails/tasks/dev.rake +2 -0
- data/lib/rails/tasks/engine.rake +7 -2
- data/lib/rails/tasks/framework.rake +9 -24
- data/lib/rails/tasks/initializers.rake +2 -0
- data/lib/rails/tasks/log.rake +2 -0
- data/lib/rails/tasks/middleware.rake +2 -0
- data/lib/rails/tasks/misc.rake +2 -0
- data/lib/rails/tasks/restart.rake +2 -1
- data/lib/rails/tasks/routes.rake +2 -0
- data/lib/rails/tasks/statistics.rake +2 -0
- data/lib/rails/tasks/tmp.rake +11 -2
- data/lib/rails/tasks/yarn.rake +3 -1
- data/lib/rails/templates/rails/mailers/email.html.erb +3 -3
- data/lib/rails/templates/rails/welcome/index.html.erb +14 -4
- data/lib/rails/test_help.rb +2 -0
- data/lib/rails/test_unit/line_filtering.rb +2 -1
- data/lib/rails/test_unit/railtie.rb +2 -0
- data/lib/rails/test_unit/reporter.rb +5 -10
- data/lib/rails/test_unit/runner.rb +3 -3
- data/lib/rails/test_unit/testing.rake +3 -1
- data/lib/rails/version.rb +2 -0
- data/lib/rails/welcome_controller.rb +2 -0
- metadata +121 -107
- data/lib/rails/generators/rails/app/templates/bin/bundle +0 -2
- data/lib/rails/generators/rails/app/templates/config/initializers/new_framework_defaults_5_1.rb.tt +0 -16
- data/lib/rails/generators/rails/app/templates/config/secrets.yml +0 -32
- data/lib/rails/generators/rails/encrypted_secrets/encrypted_secrets_generator.rb +0 -70
- data/lib/rails/generators/rails/plugin/templates/%name%.gemspec +0 -33
- data/lib/rails/generators/rails/plugin/templates/gitignore +0 -9
@@ -1,10 +1,11 @@
|
|
1
1
|
source 'https://rubygems.org'
|
2
|
+
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
|
2
3
|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
end
|
4
|
+
ruby <%= "'#{RUBY_VERSION}'" -%>
|
5
|
+
|
6
|
+
<% unless gemfile_entries.first.comment -%>
|
7
7
|
|
8
|
+
<% end -%>
|
8
9
|
<% gemfile_entries.each do |gem| -%>
|
9
10
|
<% if gem.comment -%>
|
10
11
|
|
@@ -19,10 +20,18 @@ end
|
|
19
20
|
|
20
21
|
# Use ActiveModel has_secure_password
|
21
22
|
# gem 'bcrypt', '~> 3.1.7'
|
23
|
+
<% unless skip_active_storage? -%>
|
24
|
+
|
25
|
+
# Use ActiveStorage variant
|
26
|
+
# gem 'mini_magick', '~> 4.8'
|
27
|
+
<% end -%>
|
22
28
|
|
23
29
|
# Use Capistrano for deployment
|
24
30
|
# gem 'capistrano-rails', group: :development
|
25
31
|
|
32
|
+
# Reduces boot times through caching; required in config/boot.rb
|
33
|
+
gem 'bootsnap', '>= 1.1.0', require: false
|
34
|
+
|
26
35
|
<%- if options.api? -%>
|
27
36
|
# Use Rack CORS for handling Cross-Origin Resource Sharing (CORS), making cross-origin AJAX possible
|
28
37
|
# gem 'rack-cors'
|
@@ -34,14 +43,16 @@ group :development, :test do
|
|
34
43
|
gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]
|
35
44
|
<%- if depends_on_system_test? -%>
|
36
45
|
# Adds support for Capybara system testing and selenium driver
|
37
|
-
gem 'capybara', '
|
46
|
+
gem 'capybara', '~> 2.15'
|
38
47
|
gem 'selenium-webdriver'
|
48
|
+
# Easy installation and use of chromedriver to run system tests with Chrome
|
49
|
+
gem 'chromedriver-helper'
|
39
50
|
<%- end -%>
|
40
51
|
end
|
41
52
|
|
42
53
|
group :development do
|
43
54
|
<%- unless options.api? -%>
|
44
|
-
# Access an
|
55
|
+
# Access an interactive console on exception pages or by calling 'console' anywhere in the code.
|
45
56
|
<%- if options.dev? || options.edge? -%>
|
46
57
|
gem 'web-console', github: 'rails/web-console'
|
47
58
|
<%- else -%>
|
File without changes
|
File without changes
|
data/lib/rails/generators/rails/app/templates/app/assets/javascripts/{cable.js → cable.js.tt}
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
data/lib/rails/generators/rails/app/templates/app/jobs/{application_job.rb → application_job.rb.tt}
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -1,9 +1,8 @@
|
|
1
|
-
require 'pathname'
|
2
1
|
require 'fileutils'
|
3
2
|
include FileUtils
|
4
3
|
|
5
4
|
# path to your application root.
|
6
|
-
APP_ROOT =
|
5
|
+
APP_ROOT = File.expand_path('..', __dir__)
|
7
6
|
|
8
7
|
def system!(*args)
|
9
8
|
system(*args) || abort("\n== Command #{args} failed ==")
|
@@ -16,11 +15,12 @@ chdir APP_ROOT do
|
|
16
15
|
puts '== Installing dependencies =='
|
17
16
|
system! 'gem install bundler --conservative'
|
18
17
|
system('bundle check') || system!('bundle install')
|
19
|
-
<% unless options
|
18
|
+
<% unless options.skip_yarn? -%>
|
19
|
+
|
20
20
|
# Install JavaScript dependencies if using Yarn
|
21
21
|
# system('bin/yarn')
|
22
|
-
<% end
|
23
|
-
<% unless options.skip_active_record -%>
|
22
|
+
<% end -%>
|
23
|
+
<% unless options.skip_active_record? -%>
|
24
24
|
|
25
25
|
# puts "\n== Copying sample files =="
|
26
26
|
# unless File.exist?('config/database.yml')
|
@@ -1,9 +1,8 @@
|
|
1
|
-
require 'pathname'
|
2
1
|
require 'fileutils'
|
3
2
|
include FileUtils
|
4
3
|
|
5
4
|
# path to your application root.
|
6
|
-
APP_ROOT =
|
5
|
+
APP_ROOT = File.expand_path('..', __dir__)
|
7
6
|
|
8
7
|
def system!(*args)
|
9
8
|
system(*args) || abort("\n== Command #{args} failed ==")
|
@@ -16,7 +15,12 @@ chdir APP_ROOT do
|
|
16
15
|
puts '== Installing dependencies =='
|
17
16
|
system! 'gem install bundler --conservative'
|
18
17
|
system('bundle check') || system!('bundle install')
|
19
|
-
<% unless options.
|
18
|
+
<% unless options.skip_yarn? -%>
|
19
|
+
|
20
|
+
# Install JavaScript dependencies if using Yarn
|
21
|
+
# system('bin/yarn')
|
22
|
+
<% end -%>
|
23
|
+
<% unless options.skip_active_record? -%>
|
20
24
|
|
21
25
|
puts "\n== Updating database =="
|
22
26
|
system! 'bin/rails db:migrate'
|
@@ -1,7 +1,7 @@
|
|
1
|
-
|
2
|
-
Dir.chdir(
|
1
|
+
APP_ROOT = File.expand_path('..', __dir__)
|
2
|
+
Dir.chdir(APP_ROOT) do
|
3
3
|
begin
|
4
|
-
exec "yarnpkg #{ARGV.join(
|
4
|
+
exec "yarnpkg #{ARGV.join(' ')}"
|
5
5
|
rescue Errno::ENOENT
|
6
6
|
$stderr.puts "Yarn executable was not detected in the system."
|
7
7
|
$stderr.puts "Download Yarn at https://yarnpkg.com/en/docs/install"
|
File without changes
|
@@ -8,6 +8,7 @@ require "rails"
|
|
8
8
|
require "active_model/railtie"
|
9
9
|
require "active_job/railtie"
|
10
10
|
<%= comment_if :skip_active_record %>require "active_record/railtie"
|
11
|
+
<%= comment_if :skip_active_storage %>require "active_storage/engine"
|
11
12
|
require "action_controller/railtie"
|
12
13
|
<%= comment_if :skip_action_mailer %>require "action_mailer/railtie"
|
13
14
|
require "action_view/railtie"
|
@@ -28,7 +29,7 @@ module <%= app_const_base %>
|
|
28
29
|
# Settings in config/environments/* take precedence over those specified here.
|
29
30
|
# Application configuration should go into files in config/initializers
|
30
31
|
# -- all .rb files in that directory are automatically loaded.
|
31
|
-
<%- if options
|
32
|
+
<%- if options.api? -%>
|
32
33
|
|
33
34
|
# Only loads a smaller set of middleware suitable for API only apps.
|
34
35
|
# Middleware like session, flash, cookies can be added back manually.
|
data/lib/rails/generators/rails/app/templates/config/databases/{frontbase.yml → frontbase.yml.tt}
RENAMED
File without changes
|
File without changes
|
File without changes
|
data/lib/rails/generators/rails/app/templates/config/databases/{jdbcmysql.yml → jdbcmysql.yml.tt}
RENAMED
@@ -7,7 +7,7 @@
|
|
7
7
|
# gem 'activerecord-jdbcmysql-adapter'
|
8
8
|
#
|
9
9
|
# And be sure to use new-style password hashing:
|
10
|
-
#
|
10
|
+
# https://dev.mysql.com/doc/refman/5.7/en/password-hashing.html
|
11
11
|
#
|
12
12
|
default: &default
|
13
13
|
adapter: mysql
|
File without changes
|
File without changes
|
File without changes
|
data/lib/rails/generators/rails/app/templates/config/databases/{postgresql.yml → postgresql.yml.tt}
RENAMED
File without changes
|
data/lib/rails/generators/rails/app/templates/config/databases/{sqlite3.yml → sqlite3.yml.tt}
RENAMED
File without changes
|
data/lib/rails/generators/rails/app/templates/config/databases/{sqlserver.yml → sqlserver.yml.tt}
RENAMED
@@ -1,4 +1,4 @@
|
|
1
|
-
# SQL Server (2012 or higher
|
1
|
+
# SQL Server (2012 or higher required)
|
2
2
|
#
|
3
3
|
# Install the adapters and driver
|
4
4
|
# gem install tiny_tds
|
@@ -12,7 +12,7 @@ default: &default
|
|
12
12
|
adapter: sqlserver
|
13
13
|
encoding: utf8
|
14
14
|
username: sa
|
15
|
-
password:
|
15
|
+
password: <%%= ENV['SA_PASSWORD'] %>
|
16
16
|
host: localhost
|
17
17
|
|
18
18
|
development:
|
File without changes
|
@@ -13,18 +13,24 @@ Rails.application.configure do
|
|
13
13
|
config.consider_all_requests_local = true
|
14
14
|
|
15
15
|
# Enable/disable caching. By default caching is disabled.
|
16
|
+
# Run rails dev:cache to toggle caching.
|
16
17
|
if Rails.root.join('tmp/caching-dev.txt').exist?
|
17
18
|
config.action_controller.perform_caching = true
|
18
19
|
|
19
20
|
config.cache_store = :memory_store
|
20
21
|
config.public_file_server.headers = {
|
21
|
-
'Cache-Control' => "public, max-age=#{2.days.
|
22
|
+
'Cache-Control' => "public, max-age=#{2.days.to_i}"
|
22
23
|
}
|
23
24
|
else
|
24
25
|
config.action_controller.perform_caching = false
|
25
26
|
|
26
27
|
config.cache_store = :null_store
|
27
28
|
end
|
29
|
+
<%- unless skip_active_storage? -%>
|
30
|
+
|
31
|
+
# Store uploaded files on the local file system (see config/storage.yml for options)
|
32
|
+
config.active_storage.service = :local
|
33
|
+
<%- end -%>
|
28
34
|
<%- unless options.skip_action_mailer? -%>
|
29
35
|
|
30
36
|
# Don't care if the mailer can't send.
|
@@ -14,10 +14,9 @@ Rails.application.configure do
|
|
14
14
|
config.consider_all_requests_local = false
|
15
15
|
config.action_controller.perform_caching = true
|
16
16
|
|
17
|
-
#
|
18
|
-
#
|
19
|
-
#
|
20
|
-
config.read_encrypted_secrets = true
|
17
|
+
# Ensures that a master key has been made available in either ENV["RAILS_MASTER_KEY"]
|
18
|
+
# or in config/master.key. This key is used to decrypt credentials (and other encrypted files).
|
19
|
+
# config.require_master_key = true
|
21
20
|
|
22
21
|
# Disable serving static files from the `/public` folder by default since
|
23
22
|
# Apache or NGINX already handles this.
|
@@ -36,8 +35,8 @@ Rails.application.configure do
|
|
36
35
|
config.assets.compile = false
|
37
36
|
|
38
37
|
# `config.assets.precompile` and `config.assets.version` have moved to config/initializers/assets.rb
|
39
|
-
<%- end -%>
|
40
38
|
|
39
|
+
<%- end -%>
|
41
40
|
# Enable serving of images, stylesheets, and JavaScripts from an asset server.
|
42
41
|
# config.action_controller.asset_host = 'http://assets.example.com'
|
43
42
|
|
@@ -45,13 +44,18 @@ Rails.application.configure do
|
|
45
44
|
# config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache
|
46
45
|
# config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX
|
47
46
|
|
47
|
+
<%- unless skip_active_storage? -%>
|
48
|
+
# Store uploaded files on the local file system (see config/storage.yml for options)
|
49
|
+
config.active_storage.service = :local
|
50
|
+
|
51
|
+
<%- end -%>
|
48
52
|
<%- unless options[:skip_action_cable] -%>
|
49
53
|
# Mount Action Cable outside main process or domain
|
50
54
|
# config.action_cable.mount_path = nil
|
51
55
|
# config.action_cable.url = 'wss://example.com/cable'
|
52
56
|
# config.action_cable.allowed_request_origins = [ 'http://example.com', /http:\/\/example.*/ ]
|
53
|
-
<%- end -%>
|
54
57
|
|
58
|
+
<%- end -%>
|
55
59
|
# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
|
56
60
|
# config.force_ssl = true
|
57
61
|
|
@@ -68,14 +72,15 @@ Rails.application.configure do
|
|
68
72
|
# Use a real queuing backend for Active Job (and separate queues per environment)
|
69
73
|
# config.active_job.queue_adapter = :resque
|
70
74
|
# config.active_job.queue_name_prefix = "<%= app_name %>_#{Rails.env}"
|
75
|
+
|
71
76
|
<%- unless options.skip_action_mailer? -%>
|
72
77
|
config.action_mailer.perform_caching = false
|
73
78
|
|
74
79
|
# Ignore bad email addresses and do not raise email delivery errors.
|
75
80
|
# Set this to true and configure the email server for immediate delivery to raise delivery errors.
|
76
81
|
# config.action_mailer.raise_delivery_errors = false
|
77
|
-
<%- end -%>
|
78
82
|
|
83
|
+
<%- end -%>
|
79
84
|
# Enable locale fallbacks for I18n (makes lookups for any locale fall back to
|
80
85
|
# the I18n.default_locale when a translation cannot be found).
|
81
86
|
config.i18n.fallbacks = true
|
@@ -15,7 +15,7 @@ Rails.application.configure do
|
|
15
15
|
# Configure public file server for tests with Cache-Control for performance.
|
16
16
|
config.public_file_server.enabled = true
|
17
17
|
config.public_file_server.headers = {
|
18
|
-
'Cache-Control' => "public, max-age=#{1.hour.
|
18
|
+
'Cache-Control' => "public, max-age=#{1.hour.to_i}"
|
19
19
|
}
|
20
20
|
|
21
21
|
# Show full error reports and disable caching.
|
@@ -27,6 +27,12 @@ Rails.application.configure do
|
|
27
27
|
|
28
28
|
# Disable request forgery protection in test environment.
|
29
29
|
config.action_controller.allow_forgery_protection = false
|
30
|
+
|
31
|
+
<%- unless skip_active_storage? -%>
|
32
|
+
# Store uploaded files on the local file system in a temporary directory
|
33
|
+
config.active_storage.service = :test
|
34
|
+
|
35
|
+
<%- end -%>
|
30
36
|
<%- unless options.skip_action_mailer? -%>
|
31
37
|
config.action_mailer.perform_caching = false
|
32
38
|
|
@@ -34,8 +40,8 @@ Rails.application.configure do
|
|
34
40
|
# The :test delivery method accumulates sent emails in the
|
35
41
|
# ActionMailer::Base.deliveries array.
|
36
42
|
config.action_mailer.delivery_method = :test
|
37
|
-
<%- end -%>
|
38
43
|
|
44
|
+
<%- end -%>
|
39
45
|
# Print deprecation notices to the stderr.
|
40
46
|
config.active_support.deprecation = :stderr
|
41
47
|
|
File without changes
|
File without changes
|
data/lib/rails/generators/rails/app/templates/config/initializers/content_security_policy.rb.tt
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
# Define an application-wide content security policy
|
2
|
+
# For further information see the following documentation
|
3
|
+
# https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy
|
4
|
+
|
5
|
+
Rails.application.config.content_security_policy do |p|
|
6
|
+
p.default_src :self, :https
|
7
|
+
p.font_src :self, :https, :data
|
8
|
+
p.img_src :self, :https, :data
|
9
|
+
p.object_src :none
|
10
|
+
p.script_src :self, :https
|
11
|
+
p.style_src :self, :https, :unsafe_inline
|
12
|
+
|
13
|
+
# Specify URI for violation reports
|
14
|
+
# p.report_uri "/csp-violation-report-endpoint"
|
15
|
+
end
|
16
|
+
|
17
|
+
# Report CSP violations to a specified URI
|
18
|
+
# For further information see the following documentation:
|
19
|
+
# https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy-Report-Only
|
20
|
+
# Rails.application.config.content_security_policy_report_only = true
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
data/lib/rails/generators/rails/app/templates/config/initializers/{mime_types.rb → mime_types.rb.tt}
RENAMED
File without changes
|
data/lib/rails/generators/rails/app/templates/config/initializers/new_framework_defaults_5_2.rb.tt
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
# Be sure to restart your server when you modify this file.
|
2
|
+
#
|
3
|
+
# This file contains migration options to ease your Rails 5.2 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
|
+
# Make Active Record use stable #cache_key alongside new #cache_version method.
|
10
|
+
# This is needed for recyclable cache keys.
|
11
|
+
# Rails.application.config.active_record.cache_versioning = true
|
12
|
+
|
13
|
+
# Use AES 256 GCM authenticated encryption for encrypted cookies.
|
14
|
+
# Existing cookies will be converted on read then written with the new scheme.
|
15
|
+
# Rails.application.config.action_dispatch.use_authenticated_cookie_encryption = true
|
16
|
+
|
17
|
+
# Use AES-256-GCM authenticated encryption as default cipher for encrypting messages
|
18
|
+
# instead of AES-256-CBC, when use_authenticated_message_encryption is set to true.
|
19
|
+
# Rails.application.config.active_support.use_authenticated_message_encryption = true
|
20
|
+
|
21
|
+
# Add default protection from forgery to ActionController::Base instead of in
|
22
|
+
# ApplicationController.
|
23
|
+
# Rails.application.config.action_controller.default_protect_from_forgery = true
|
24
|
+
|
25
|
+
# Store boolean values are in sqlite3 databases as 1 and 0 instead of 't' and
|
26
|
+
# 'f' after migrating old data.
|
27
|
+
# Rails.application.config.active_record.sqlite3.represent_boolean_as_integer = true
|
File without changes
|
File without changes
|