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,8 +1,8 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require "ipaddr"
|
4
|
+
require "active_support/core_ext/array/wrap"
|
4
5
|
require "active_support/core_ext/kernel/reporting"
|
5
|
-
require "active_support/core_ext/symbol/starts_ends_with"
|
6
6
|
require "active_support/file_update_checker"
|
7
7
|
require "active_support/configuration_file"
|
8
8
|
require "rails/engine/configuration"
|
@@ -11,20 +11,21 @@ require "rails/source_annotation_extractor"
|
|
11
11
|
module Rails
|
12
12
|
class Application
|
13
13
|
class Configuration < ::Rails::Engine::Configuration
|
14
|
-
attr_accessor :allow_concurrency, :asset_host, :autoflush_log,
|
14
|
+
attr_accessor :allow_concurrency, :asset_host, :assume_ssl, :autoflush_log,
|
15
15
|
:cache_classes, :cache_store, :consider_all_requests_local, :console,
|
16
|
-
:eager_load, :exceptions_app, :file_watcher, :filter_parameters,
|
16
|
+
:eager_load, :exceptions_app, :file_watcher, :filter_parameters, :precompile_filter_parameters,
|
17
17
|
:force_ssl, :helpers_paths, :hosts, :host_authorization, :logger, :log_formatter,
|
18
18
|
:log_tags, :railties_order, :relative_url_root, :secret_key_base,
|
19
19
|
:ssl_options, :public_file_server,
|
20
20
|
:session_options, :time_zone, :reload_classes_only_on_change,
|
21
|
-
:beginning_of_week, :filter_redirect, :x,
|
21
|
+
:beginning_of_week, :filter_redirect, :x,
|
22
22
|
:read_encrypted_secrets, :log_level, :content_security_policy_report_only,
|
23
23
|
:content_security_policy_nonce_generator, :content_security_policy_nonce_directives,
|
24
|
-
:require_master_key, :credentials, :disable_sandbox, :
|
25
|
-
:rake_eager_load
|
24
|
+
:require_master_key, :credentials, :disable_sandbox, :sandbox_by_default,
|
25
|
+
:add_autoload_paths_to_load_path, :rake_eager_load, :server_timing, :log_file_size,
|
26
|
+
:dom_testing_default_html_version
|
26
27
|
|
27
|
-
attr_reader :encoding, :api_only, :loaded_config_version
|
28
|
+
attr_reader :encoding, :api_only, :loaded_config_version
|
28
29
|
|
29
30
|
def initialize(*)
|
30
31
|
super
|
@@ -35,7 +36,8 @@ module Rails
|
|
35
36
|
@filter_redirect = []
|
36
37
|
@helpers_paths = []
|
37
38
|
if Rails.env.development?
|
38
|
-
@hosts = ActionDispatch::HostAuthorization::ALLOWED_HOSTS_IN_DEVELOPMENT
|
39
|
+
@hosts = ActionDispatch::HostAuthorization::ALLOWED_HOSTS_IN_DEVELOPMENT +
|
40
|
+
ENV["RAILS_DEVELOPMENT_HOSTS"].to_s.split(",").map(&:strip)
|
39
41
|
else
|
40
42
|
@hosts = []
|
41
43
|
end
|
@@ -43,12 +45,14 @@ module Rails
|
|
43
45
|
@public_file_server = ActiveSupport::OrderedOptions.new
|
44
46
|
@public_file_server.enabled = true
|
45
47
|
@public_file_server.index_name = "index"
|
48
|
+
@assume_ssl = false
|
46
49
|
@force_ssl = false
|
47
50
|
@ssl_options = {}
|
48
51
|
@session_store = nil
|
49
52
|
@time_zone = "UTC"
|
50
53
|
@beginning_of_week = :monday
|
51
54
|
@log_level = :debug
|
55
|
+
@log_file_size = nil
|
52
56
|
@generators = app_generators
|
53
57
|
@cache_store = [ :file_store, "#{root}/tmp/cache/" ]
|
54
58
|
@railties_order = [:all]
|
@@ -71,18 +75,39 @@ module Rails
|
|
71
75
|
@content_security_policy_nonce_directives = nil
|
72
76
|
@require_master_key = false
|
73
77
|
@loaded_config_version = nil
|
74
|
-
@credentials = ActiveSupport::
|
75
|
-
@credentials.content_path = default_credentials_content_path
|
76
|
-
@credentials.key_path = default_credentials_key_path
|
77
|
-
@autoloader = :classic
|
78
|
+
@credentials = ActiveSupport::InheritableOptions.new(credentials_defaults)
|
78
79
|
@disable_sandbox = false
|
80
|
+
@sandbox_by_default = false
|
79
81
|
@add_autoload_paths_to_load_path = true
|
80
82
|
@permissions_policy = nil
|
81
83
|
@rake_eager_load = false
|
84
|
+
@server_timing = false
|
85
|
+
@dom_testing_default_html_version = :html4
|
82
86
|
end
|
83
87
|
|
84
|
-
# Loads default
|
88
|
+
# Loads default configuration values for a target version. This includes
|
89
|
+
# defaults for versions prior to the target version. See the
|
90
|
+
# {configuration guide}[https://guides.rubyonrails.org/configuring.html#versioned-default-values]
|
91
|
+
# for the default values associated with a particular version.
|
85
92
|
def load_defaults(target_version)
|
93
|
+
# To introduce a change in behavior, follow these steps:
|
94
|
+
# 1. Add an accessor on the target object (e.g. the ActiveJob class for
|
95
|
+
# global Active Job config).
|
96
|
+
# 2. Set a default value there preserving existing behavior for existing
|
97
|
+
# applications.
|
98
|
+
# 3. Implement the behavior change based on the config value.
|
99
|
+
# 4. In the section below corresponding to the next release of Rails,
|
100
|
+
# configure the default value.
|
101
|
+
# 5. Add a commented out section in the `new_framework_defaults` to
|
102
|
+
# configure the default value again.
|
103
|
+
# 6. Update the guide in `configuring.md`.
|
104
|
+
|
105
|
+
# To remove configurable deprecated behavior, follow these steps:
|
106
|
+
# 1. Update or remove the entry in the guides.
|
107
|
+
# 2. Remove the references below.
|
108
|
+
# 3. Remove the legacy code paths and config check.
|
109
|
+
# 4. Remove the config accessor.
|
110
|
+
|
86
111
|
case target_version.to_s
|
87
112
|
when "5.0"
|
88
113
|
if respond_to?(:action_controller)
|
@@ -120,7 +145,7 @@ module Rails
|
|
120
145
|
|
121
146
|
if respond_to?(:active_support)
|
122
147
|
active_support.use_authenticated_message_encryption = true
|
123
|
-
active_support.hash_digest_class = ::Digest::SHA1
|
148
|
+
active_support.hash_digest_class = OpenSSL::Digest::SHA1
|
124
149
|
end
|
125
150
|
|
126
151
|
if respond_to?(:action_controller)
|
@@ -133,8 +158,6 @@ module Rails
|
|
133
158
|
when "6.0"
|
134
159
|
load_defaults "5.2"
|
135
160
|
|
136
|
-
self.autoloader = :zeitwerk if RUBY_ENGINE == "ruby"
|
137
|
-
|
138
161
|
if respond_to?(:action_view)
|
139
162
|
action_view.default_enforce_utf8 = false
|
140
163
|
end
|
@@ -150,8 +173,6 @@ module Rails
|
|
150
173
|
if respond_to?(:active_storage)
|
151
174
|
active_storage.queues.analysis = :active_storage_analysis
|
152
175
|
active_storage.queues.purge = :active_storage_purge
|
153
|
-
|
154
|
-
active_storage.replace_on_assign_to_many = true
|
155
176
|
end
|
156
177
|
|
157
178
|
if respond_to?(:active_record)
|
@@ -160,20 +181,12 @@ module Rails
|
|
160
181
|
when "6.1"
|
161
182
|
load_defaults "6.0"
|
162
183
|
|
163
|
-
self.autoloader = :zeitwerk if %w[ruby truffleruby].include?(RUBY_ENGINE)
|
164
|
-
|
165
184
|
if respond_to?(:active_record)
|
166
185
|
active_record.has_many_inversing = true
|
167
|
-
active_record.legacy_connection_handling = false
|
168
|
-
end
|
169
|
-
|
170
|
-
if respond_to?(:active_storage)
|
171
|
-
active_storage.track_variants = true
|
172
186
|
end
|
173
187
|
|
174
188
|
if respond_to?(:active_job)
|
175
189
|
active_job.retry_jitter = 0.15
|
176
|
-
active_job.skip_after_callbacks_if_terminated = true
|
177
190
|
end
|
178
191
|
|
179
192
|
if respond_to?(:action_dispatch)
|
@@ -181,16 +194,14 @@ module Rails
|
|
181
194
|
action_dispatch.ssl_default_redirect_status = 308
|
182
195
|
end
|
183
196
|
|
184
|
-
if respond_to?(:action_controller)
|
185
|
-
action_controller.urlsafe_csrf_tokens = true
|
186
|
-
end
|
187
|
-
|
188
197
|
if respond_to?(:action_view)
|
189
198
|
action_view.form_with_generates_remote_forms = false
|
190
199
|
action_view.preload_links_header = true
|
191
200
|
end
|
192
201
|
|
193
202
|
if respond_to?(:active_storage)
|
203
|
+
active_storage.track_variants = true
|
204
|
+
|
194
205
|
active_storage.queues.analysis = nil
|
195
206
|
active_storage.queues.purge = nil
|
196
207
|
end
|
@@ -205,6 +216,119 @@ module Rails
|
|
205
216
|
end
|
206
217
|
|
207
218
|
ActiveSupport.utc_to_local_returns_utc_offset_times = true
|
219
|
+
when "7.0"
|
220
|
+
load_defaults "6.1"
|
221
|
+
|
222
|
+
if respond_to?(:action_dispatch)
|
223
|
+
action_dispatch.default_headers = {
|
224
|
+
"X-Frame-Options" => "SAMEORIGIN",
|
225
|
+
"X-XSS-Protection" => "0",
|
226
|
+
"X-Content-Type-Options" => "nosniff",
|
227
|
+
"X-Download-Options" => "noopen",
|
228
|
+
"X-Permitted-Cross-Domain-Policies" => "none",
|
229
|
+
"Referrer-Policy" => "strict-origin-when-cross-origin"
|
230
|
+
}
|
231
|
+
action_dispatch.cookies_serializer = :json
|
232
|
+
end
|
233
|
+
|
234
|
+
if respond_to?(:action_view)
|
235
|
+
action_view.button_to_generates_button_tag = true
|
236
|
+
action_view.apply_stylesheet_media_default = false
|
237
|
+
end
|
238
|
+
|
239
|
+
if respond_to?(:active_support)
|
240
|
+
active_support.hash_digest_class = OpenSSL::Digest::SHA256
|
241
|
+
active_support.key_generator_hash_digest_class = OpenSSL::Digest::SHA256
|
242
|
+
active_support.cache_format_version = 7.0
|
243
|
+
active_support.executor_around_test_case = true
|
244
|
+
end
|
245
|
+
|
246
|
+
if respond_to?(:action_mailer)
|
247
|
+
action_mailer.smtp_timeout = 5
|
248
|
+
end
|
249
|
+
|
250
|
+
if respond_to?(:active_storage)
|
251
|
+
active_storage.video_preview_arguments =
|
252
|
+
"-vf 'select=eq(n\\,0)+eq(key\\,1)+gt(scene\\,0.015),loop=loop=-1:size=2,trim=start_frame=1'" \
|
253
|
+
" -frames:v 1 -f image2"
|
254
|
+
|
255
|
+
active_storage.variant_processor = :vips
|
256
|
+
active_storage.multiple_file_field_include_hidden = true
|
257
|
+
end
|
258
|
+
|
259
|
+
if respond_to?(:active_record)
|
260
|
+
active_record.verify_foreign_keys_for_fixtures = true
|
261
|
+
active_record.partial_inserts = false
|
262
|
+
active_record.automatic_scope_inversing = true
|
263
|
+
end
|
264
|
+
|
265
|
+
if respond_to?(:action_controller)
|
266
|
+
action_controller.raise_on_open_redirects = true
|
267
|
+
action_controller.wrap_parameters_by_default = true
|
268
|
+
end
|
269
|
+
when "7.1"
|
270
|
+
load_defaults "7.0"
|
271
|
+
|
272
|
+
self.add_autoload_paths_to_load_path = false
|
273
|
+
self.precompile_filter_parameters = true
|
274
|
+
self.dom_testing_default_html_version = defined?(Nokogiri::HTML5) ? :html5 : :html4
|
275
|
+
|
276
|
+
if Rails.env.local?
|
277
|
+
self.log_file_size = 100 * 1024 * 1024
|
278
|
+
end
|
279
|
+
|
280
|
+
if respond_to?(:active_record)
|
281
|
+
active_record.run_commit_callbacks_on_first_saved_instances_in_transaction = false
|
282
|
+
active_record.commit_transaction_on_non_local_return = true
|
283
|
+
active_record.allow_deprecated_singular_associations_name = false
|
284
|
+
active_record.sqlite3_adapter_strict_strings_by_default = true
|
285
|
+
active_record.query_log_tags_format = :sqlcommenter
|
286
|
+
active_record.raise_on_assign_to_attr_readonly = true
|
287
|
+
active_record.belongs_to_required_validates_foreign_key = false
|
288
|
+
active_record.before_committed_on_all_records = true
|
289
|
+
active_record.default_column_serializer = nil
|
290
|
+
active_record.encryption.hash_digest_class = OpenSSL::Digest::SHA256
|
291
|
+
active_record.encryption.support_sha1_for_non_deterministic_encryption = false
|
292
|
+
active_record.marshalling_format_version = 7.1
|
293
|
+
active_record.run_after_transaction_callbacks_in_order_defined = true
|
294
|
+
active_record.generate_secure_token_on = :initialize
|
295
|
+
end
|
296
|
+
|
297
|
+
if respond_to?(:action_dispatch)
|
298
|
+
action_dispatch.default_headers = {
|
299
|
+
"X-Frame-Options" => "SAMEORIGIN",
|
300
|
+
"X-XSS-Protection" => "0",
|
301
|
+
"X-Content-Type-Options" => "nosniff",
|
302
|
+
"X-Permitted-Cross-Domain-Policies" => "none",
|
303
|
+
"Referrer-Policy" => "strict-origin-when-cross-origin"
|
304
|
+
}
|
305
|
+
action_dispatch.debug_exception_log_level = :error
|
306
|
+
end
|
307
|
+
|
308
|
+
if respond_to?(:active_job)
|
309
|
+
active_job.use_big_decimal_serializer = true
|
310
|
+
end
|
311
|
+
|
312
|
+
if respond_to?(:active_support)
|
313
|
+
active_support.cache_format_version = 7.1
|
314
|
+
active_support.message_serializer = :json_allow_marshal
|
315
|
+
active_support.use_message_serializer_for_metadata = true
|
316
|
+
active_support.raise_on_invalid_cache_expiration_time = true
|
317
|
+
end
|
318
|
+
|
319
|
+
if respond_to?(:action_controller)
|
320
|
+
action_controller.allow_deprecated_parameters_hash_equality = false
|
321
|
+
end
|
322
|
+
|
323
|
+
if defined?(Rails::HTML::Sanitizer) # nested ifs to avoid linter errors
|
324
|
+
if respond_to?(:action_view)
|
325
|
+
action_view.sanitizer_vendor = Rails::HTML::Sanitizer.best_supported_vendor
|
326
|
+
end
|
327
|
+
|
328
|
+
if respond_to?(:action_text)
|
329
|
+
action_text.sanitizer_vendor = Rails::HTML::Sanitizer.best_supported_vendor
|
330
|
+
end
|
331
|
+
end
|
208
332
|
else
|
209
333
|
raise "Unknown version #{target_version.to_s.inspect}"
|
210
334
|
end
|
@@ -212,6 +336,34 @@ module Rails
|
|
212
336
|
@loaded_config_version = target_version
|
213
337
|
end
|
214
338
|
|
339
|
+
def reloading_enabled?
|
340
|
+
enable_reloading
|
341
|
+
end
|
342
|
+
|
343
|
+
def enable_reloading
|
344
|
+
!cache_classes
|
345
|
+
end
|
346
|
+
|
347
|
+
def enable_reloading=(value)
|
348
|
+
self.cache_classes = !value
|
349
|
+
end
|
350
|
+
|
351
|
+
ENABLE_DEPENDENCY_LOADING_WARNING = <<~MSG
|
352
|
+
This flag addressed a limitation of the `classic` autoloader and has no effect nowadays.
|
353
|
+
To fix this deprecation, please just delete the reference.
|
354
|
+
MSG
|
355
|
+
private_constant :ENABLE_DEPENDENCY_LOADING_WARNING
|
356
|
+
|
357
|
+
def enable_dependency_loading
|
358
|
+
Rails.deprecator.warn(ENABLE_DEPENDENCY_LOADING_WARNING)
|
359
|
+
@enable_dependency_loading
|
360
|
+
end
|
361
|
+
|
362
|
+
def enable_dependency_loading=(value)
|
363
|
+
Rails.deprecator.warn(ENABLE_DEPENDENCY_LOADING_WARNING)
|
364
|
+
@enable_dependency_loading = value
|
365
|
+
end
|
366
|
+
|
215
367
|
def encoding=(value)
|
216
368
|
@encoding = value
|
217
369
|
silence_warnings do
|
@@ -249,23 +401,21 @@ module Rails
|
|
249
401
|
end
|
250
402
|
end
|
251
403
|
|
252
|
-
# Load the database
|
253
|
-
#
|
254
|
-
# configuration values
|
255
|
-
# method.
|
404
|
+
# Load the <tt>config/database.yml</tt> to create the Rake tasks for
|
405
|
+
# multiple databases without loading the environment and filling in the
|
406
|
+
# environment specific configuration values.
|
256
407
|
#
|
257
|
-
#
|
258
|
-
# tags and load the database.yml for the rake tasks.
|
408
|
+
# Do not use this method, use #database_configuration instead.
|
259
409
|
def load_database_yaml # :nodoc:
|
260
410
|
if path = paths["config/database"].existent.first
|
261
|
-
require "rails/application/
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
411
|
+
require "rails/application/dummy_config"
|
412
|
+
original_rails_config = Rails.application.config
|
413
|
+
|
414
|
+
begin
|
415
|
+
Rails.application.config = DummyConfig.new(original_rails_config)
|
416
|
+
ActiveSupport::ConfigurationFile.parse(Pathname.new(path))
|
417
|
+
ensure
|
418
|
+
Rails.application.config = original_rails_config
|
269
419
|
end
|
270
420
|
else
|
271
421
|
{}
|
@@ -281,8 +431,20 @@ module Rails
|
|
281
431
|
config = if yaml&.exist?
|
282
432
|
loaded_yaml = ActiveSupport::ConfigurationFile.parse(yaml)
|
283
433
|
if (shared = loaded_yaml.delete("shared"))
|
284
|
-
loaded_yaml.each do |
|
285
|
-
values.
|
434
|
+
loaded_yaml.each do |env, config|
|
435
|
+
if config.is_a?(Hash) && config.values.all?(Hash)
|
436
|
+
if shared.is_a?(Hash) && shared.values.all?(Hash)
|
437
|
+
config.map do |name, sub_config|
|
438
|
+
sub_config.reverse_merge!(shared[name])
|
439
|
+
end
|
440
|
+
else
|
441
|
+
config.map do |name, sub_config|
|
442
|
+
sub_config.reverse_merge!(shared)
|
443
|
+
end
|
444
|
+
end
|
445
|
+
else
|
446
|
+
config.reverse_merge!(shared)
|
447
|
+
end
|
286
448
|
end
|
287
449
|
end
|
288
450
|
Hash.new(shared).merge(loaded_yaml)
|
@@ -299,6 +461,30 @@ module Rails
|
|
299
461
|
raise e, "Cannot load database configuration:\n#{e.message}", e.backtrace
|
300
462
|
end
|
301
463
|
|
464
|
+
def autoload_lib(ignore:)
|
465
|
+
lib = root.join("lib")
|
466
|
+
|
467
|
+
# Set as a string to have the same type as default autoload paths, for
|
468
|
+
# consistency.
|
469
|
+
autoload_paths << lib.to_s
|
470
|
+
eager_load_paths << lib.to_s
|
471
|
+
|
472
|
+
ignored_abspaths = Array.wrap(ignore).map { lib.join(_1) }
|
473
|
+
Rails.autoloaders.main.ignore(ignored_abspaths)
|
474
|
+
end
|
475
|
+
|
476
|
+
def autoload_lib_once(ignore:)
|
477
|
+
lib = root.join("lib")
|
478
|
+
|
479
|
+
# Set as a string to have the same type as default autoload paths, for
|
480
|
+
# consistency.
|
481
|
+
autoload_once_paths << lib.to_s
|
482
|
+
eager_load_paths << lib.to_s
|
483
|
+
|
484
|
+
ignored_abspaths = Array.wrap(ignore).map { lib.join(_1) }
|
485
|
+
Rails.autoloaders.once.ignore(ignored_abspaths)
|
486
|
+
end
|
487
|
+
|
302
488
|
def colorize_logging
|
303
489
|
ActiveSupport::LogSubscriber.colorize_logging
|
304
490
|
end
|
@@ -308,34 +494,38 @@ module Rails
|
|
308
494
|
generators.colorize_logging = val
|
309
495
|
end
|
310
496
|
|
497
|
+
# Specifies what class to use to store the session. Possible values
|
498
|
+
# are +:cache_store+, +:cookie_store+, +:mem_cache_store+, a custom
|
499
|
+
# store, or +:disabled+. +:disabled+ tells \Rails not to deal with
|
500
|
+
# sessions.
|
501
|
+
#
|
502
|
+
# Additional options will be set as +session_options+:
|
503
|
+
#
|
504
|
+
# config.session_store :cookie_store, key: "_your_app_session"
|
505
|
+
# config.session_options # => {key: "_your_app_session"}
|
506
|
+
#
|
507
|
+
# If a custom store is specified as a symbol, it will be resolved to
|
508
|
+
# the +ActionDispatch::Session+ namespace:
|
509
|
+
#
|
510
|
+
# # use ActionDispatch::Session::MyCustomStore as the session store
|
511
|
+
# config.session_store :my_custom_store
|
311
512
|
def session_store(new_session_store = nil, **options)
|
312
513
|
if new_session_store
|
313
|
-
if new_session_store == :active_record_store
|
314
|
-
begin
|
315
|
-
ActionDispatch::Session::ActiveRecordStore
|
316
|
-
rescue NameError
|
317
|
-
raise "`ActiveRecord::SessionStore` is extracted out of Rails into a gem. " \
|
318
|
-
"Please add `activerecord-session_store` to your Gemfile to use it."
|
319
|
-
end
|
320
|
-
end
|
321
|
-
|
322
514
|
@session_store = new_session_store
|
323
515
|
@session_options = options || {}
|
324
516
|
else
|
325
517
|
case @session_store
|
326
518
|
when :disabled
|
327
519
|
nil
|
328
|
-
when :active_record_store
|
329
|
-
ActionDispatch::Session::ActiveRecordStore
|
330
520
|
when Symbol
|
331
|
-
ActionDispatch::Session.
|
521
|
+
ActionDispatch::Session.resolve_store(@session_store)
|
332
522
|
else
|
333
523
|
@session_store
|
334
524
|
end
|
335
525
|
end
|
336
526
|
end
|
337
527
|
|
338
|
-
def session_store?
|
528
|
+
def session_store? # :nodoc:
|
339
529
|
@session_store
|
340
530
|
end
|
341
531
|
|
@@ -343,6 +533,7 @@ module Rails
|
|
343
533
|
Rails::SourceAnnotationExtractor::Annotation
|
344
534
|
end
|
345
535
|
|
536
|
+
# Configures the ActionDispatch::ContentSecurityPolicy.
|
346
537
|
def content_security_policy(&block)
|
347
538
|
if block_given?
|
348
539
|
@content_security_policy = ActionDispatch::ContentSecurityPolicy.new(&block)
|
@@ -351,6 +542,7 @@ module Rails
|
|
351
542
|
end
|
352
543
|
end
|
353
544
|
|
545
|
+
# Configures the ActionDispatch::PermissionsPolicy.
|
354
546
|
def permissions_policy(&block)
|
355
547
|
if block_given?
|
356
548
|
@permissions_policy = ActionDispatch::PermissionsPolicy.new(&block)
|
@@ -359,18 +551,6 @@ module Rails
|
|
359
551
|
end
|
360
552
|
end
|
361
553
|
|
362
|
-
def autoloader=(autoloader)
|
363
|
-
case autoloader
|
364
|
-
when :classic
|
365
|
-
@autoloader = autoloader
|
366
|
-
when :zeitwerk
|
367
|
-
require "zeitwerk"
|
368
|
-
@autoloader = autoloader
|
369
|
-
else
|
370
|
-
raise ArgumentError, "config.autoloader may be :classic or :zeitwerk, got #{autoloader.inspect} instead"
|
371
|
-
end
|
372
|
-
end
|
373
|
-
|
374
554
|
def default_log_file
|
375
555
|
path = paths["log"].first
|
376
556
|
unless File.exist? File.dirname path
|
@@ -383,7 +563,11 @@ module Rails
|
|
383
563
|
f
|
384
564
|
end
|
385
565
|
|
386
|
-
|
566
|
+
def inspect # :nodoc:
|
567
|
+
"#<#{self.class.name}:#{'%#016x' % (object_id << 1)}>"
|
568
|
+
end
|
569
|
+
|
570
|
+
class Custom # :nodoc:
|
387
571
|
def initialize
|
388
572
|
@configurations = Hash.new
|
389
573
|
end
|
@@ -404,24 +588,14 @@ module Rails
|
|
404
588
|
end
|
405
589
|
|
406
590
|
private
|
407
|
-
def
|
408
|
-
|
409
|
-
|
410
|
-
else
|
411
|
-
root.join("config", "credentials.yml.enc")
|
412
|
-
end
|
413
|
-
end
|
591
|
+
def credentials_defaults
|
592
|
+
content_path = root.join("config/credentials/#{Rails.env}.yml.enc")
|
593
|
+
content_path = root.join("config/credentials.yml.enc") if !content_path.exist?
|
414
594
|
|
415
|
-
|
416
|
-
if
|
417
|
-
root.join("config", "credentials", "#{Rails.env}.key")
|
418
|
-
else
|
419
|
-
root.join("config", "master.key")
|
420
|
-
end
|
421
|
-
end
|
595
|
+
key_path = root.join("config/credentials/#{Rails.env}.key")
|
596
|
+
key_path = root.join("config/master.key") if !key_path.exist?
|
422
597
|
|
423
|
-
|
424
|
-
File.exist?(root.join("config", "credentials", "#{Rails.env}.yml.enc"))
|
598
|
+
{ content_path: content_path, key_path: key_path }
|
425
599
|
end
|
426
600
|
end
|
427
601
|
end
|
@@ -13,7 +13,13 @@ module Rails
|
|
13
13
|
|
14
14
|
def build_stack
|
15
15
|
ActionDispatch::MiddlewareStack.new do |middleware|
|
16
|
-
|
16
|
+
unless Array(config.hosts).empty?
|
17
|
+
middleware.use ::ActionDispatch::HostAuthorization, config.hosts, **config.host_authorization
|
18
|
+
end
|
19
|
+
|
20
|
+
if config.assume_ssl
|
21
|
+
middleware.use ::ActionDispatch::AssumeSSL
|
22
|
+
end
|
17
23
|
|
18
24
|
if config.force_ssl
|
19
25
|
middleware.use ::ActionDispatch::SSL, **config.ssl_options,
|
@@ -42,6 +48,7 @@ module Rails
|
|
42
48
|
|
43
49
|
middleware.use ::ActionDispatch::Executor, app.executor
|
44
50
|
|
51
|
+
middleware.use ::ActionDispatch::ServerTiming if config.server_timing
|
45
52
|
middleware.use ::Rack::Runtime
|
46
53
|
middleware.use ::Rack::MethodOverride unless config.api_only
|
47
54
|
middleware.use ::ActionDispatch::RequestId, header: config.action_dispatch.request_id_header
|
@@ -50,9 +57,12 @@ module Rails
|
|
50
57
|
middleware.use ::Rails::Rack::Logger, config.log_tags
|
51
58
|
middleware.use ::ActionDispatch::ShowExceptions, show_exceptions_app
|
52
59
|
middleware.use ::ActionDispatch::DebugExceptions, app, config.debug_exception_response_format
|
53
|
-
middleware.use ::ActionDispatch::ActionableExceptions
|
54
60
|
|
55
|
-
|
61
|
+
if config.consider_all_requests_local
|
62
|
+
middleware.use ::ActionDispatch::ActionableExceptions
|
63
|
+
end
|
64
|
+
|
65
|
+
if config.reloading_enabled?
|
56
66
|
middleware.use ::ActionDispatch::Reloader, app.reloader
|
57
67
|
end
|
58
68
|
|
@@ -64,10 +74,10 @@ module Rails
|
|
64
74
|
config.session_options[:secure] = true
|
65
75
|
end
|
66
76
|
middleware.use config.session_store, config.session_options
|
67
|
-
middleware.use ::ActionDispatch::Flash
|
68
77
|
end
|
69
78
|
|
70
79
|
unless config.api_only
|
80
|
+
middleware.use ::ActionDispatch::Flash
|
71
81
|
middleware.use ::ActionDispatch::ContentSecurityPolicy::Middleware
|
72
82
|
middleware.use ::ActionDispatch::PermissionsPolicy::Middleware
|
73
83
|
end
|
@@ -77,6 +87,21 @@ module Rails
|
|
77
87
|
middleware.use ::Rack::ETag, "no-cache"
|
78
88
|
|
79
89
|
middleware.use ::Rack::TempfileReaper unless config.api_only
|
90
|
+
|
91
|
+
if config.respond_to?(:active_record)
|
92
|
+
if selector_options = config.active_record.database_selector
|
93
|
+
resolver = config.active_record.database_resolver
|
94
|
+
context = config.active_record.database_resolver_context
|
95
|
+
|
96
|
+
middleware.use ::ActiveRecord::Middleware::DatabaseSelector, resolver, context, selector_options
|
97
|
+
end
|
98
|
+
|
99
|
+
if shard_resolver = config.active_record.shard_resolver
|
100
|
+
options = config.active_record.shard_selector || {}
|
101
|
+
|
102
|
+
middleware.use ::ActiveRecord::Middleware::ShardSelector, shard_resolver, options
|
103
|
+
end
|
104
|
+
end
|
80
105
|
end
|
81
106
|
end
|
82
107
|
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
class DummyConfig # :nodoc:
|
4
|
+
def initialize(config)
|
5
|
+
@config = config
|
6
|
+
end
|
7
|
+
|
8
|
+
def to_s
|
9
|
+
"DummyConfig"
|
10
|
+
end
|
11
|
+
|
12
|
+
def method_missing(selector, *args, &blk)
|
13
|
+
if @config.respond_to?(selector)
|
14
|
+
@config.send(selector, *args, &blk)
|
15
|
+
else
|
16
|
+
self
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|