activesupport 8.0.4 → 8.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (92) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +296 -172
  3. data/lib/active_support/backtrace_cleaner.rb +71 -0
  4. data/lib/active_support/cache/mem_cache_store.rb +13 -13
  5. data/lib/active_support/cache/redis_cache_store.rb +36 -30
  6. data/lib/active_support/cache/strategy/local_cache.rb +16 -7
  7. data/lib/active_support/cache/strategy/local_cache_middleware.rb +7 -7
  8. data/lib/active_support/cache.rb +69 -6
  9. data/lib/active_support/callbacks.rb +20 -8
  10. data/lib/active_support/concurrency/load_interlock_aware_monitor.rb +8 -62
  11. data/lib/active_support/concurrency/thread_monitor.rb +55 -0
  12. data/lib/active_support/configurable.rb +34 -0
  13. data/lib/active_support/continuous_integration.rb +145 -0
  14. data/lib/active_support/core_ext/array.rb +7 -7
  15. data/lib/active_support/core_ext/benchmark.rb +4 -12
  16. data/lib/active_support/core_ext/big_decimal.rb +1 -1
  17. data/lib/active_support/core_ext/class.rb +2 -2
  18. data/lib/active_support/core_ext/date.rb +5 -5
  19. data/lib/active_support/core_ext/date_and_time/compatibility.rb +0 -35
  20. data/lib/active_support/core_ext/date_time/compatibility.rb +3 -5
  21. data/lib/active_support/core_ext/date_time.rb +5 -5
  22. data/lib/active_support/core_ext/digest.rb +1 -1
  23. data/lib/active_support/core_ext/erb/util.rb +3 -3
  24. data/lib/active_support/core_ext/file.rb +1 -1
  25. data/lib/active_support/core_ext/hash.rb +8 -8
  26. data/lib/active_support/core_ext/integer.rb +3 -3
  27. data/lib/active_support/core_ext/kernel.rb +3 -3
  28. data/lib/active_support/core_ext/module.rb +11 -11
  29. data/lib/active_support/core_ext/numeric.rb +3 -3
  30. data/lib/active_support/core_ext/object/json.rb +8 -1
  31. data/lib/active_support/core_ext/object/to_query.rb +5 -0
  32. data/lib/active_support/core_ext/object.rb +13 -13
  33. data/lib/active_support/core_ext/pathname.rb +2 -2
  34. data/lib/active_support/core_ext/range.rb +4 -5
  35. data/lib/active_support/core_ext/string/multibyte.rb +10 -1
  36. data/lib/active_support/core_ext/string/output_safety.rb +19 -12
  37. data/lib/active_support/core_ext/string.rb +13 -13
  38. data/lib/active_support/core_ext/symbol.rb +1 -1
  39. data/lib/active_support/core_ext/time/calculations.rb +0 -7
  40. data/lib/active_support/core_ext/time/compatibility.rb +2 -27
  41. data/lib/active_support/core_ext/time.rb +5 -5
  42. data/lib/active_support/core_ext.rb +1 -1
  43. data/lib/active_support/current_attributes/test_helper.rb +2 -2
  44. data/lib/active_support/current_attributes.rb +13 -10
  45. data/lib/active_support/dependencies/interlock.rb +11 -5
  46. data/lib/active_support/dependencies.rb +6 -1
  47. data/lib/active_support/deprecation/reporting.rb +4 -2
  48. data/lib/active_support/deprecation.rb +1 -1
  49. data/lib/active_support/editor.rb +70 -0
  50. data/lib/active_support/error_reporter.rb +50 -6
  51. data/lib/active_support/event_reporter/test_helper.rb +32 -0
  52. data/lib/active_support/event_reporter.rb +592 -0
  53. data/lib/active_support/evented_file_update_checker.rb +5 -1
  54. data/lib/active_support/execution_context.rb +64 -7
  55. data/lib/active_support/file_update_checker.rb +7 -5
  56. data/lib/active_support/gem_version.rb +2 -2
  57. data/lib/active_support/gzip.rb +1 -0
  58. data/lib/active_support/hash_with_indifferent_access.rb +27 -7
  59. data/lib/active_support/i18n_railtie.rb +1 -2
  60. data/lib/active_support/inflector/inflections.rb +31 -15
  61. data/lib/active_support/inflector/transliterate.rb +6 -8
  62. data/lib/active_support/isolated_execution_state.rb +12 -15
  63. data/lib/active_support/json/decoding.rb +2 -2
  64. data/lib/active_support/json/encoding.rb +135 -17
  65. data/lib/active_support/log_subscriber.rb +2 -6
  66. data/lib/active_support/message_encryptors.rb +52 -0
  67. data/lib/active_support/message_pack/extensions.rb +5 -0
  68. data/lib/active_support/message_verifiers.rb +52 -0
  69. data/lib/active_support/messages/rotation_coordinator.rb +9 -0
  70. data/lib/active_support/messages/rotator.rb +5 -0
  71. data/lib/active_support/multibyte/chars.rb +8 -1
  72. data/lib/active_support/multibyte.rb +4 -0
  73. data/lib/active_support/notifications/fanout.rb +64 -42
  74. data/lib/active_support/railtie.rb +32 -15
  75. data/lib/active_support/structured_event_subscriber.rb +99 -0
  76. data/lib/active_support/subscriber.rb +0 -5
  77. data/lib/active_support/syntax_error_proxy.rb +3 -0
  78. data/lib/active_support/test_case.rb +61 -6
  79. data/lib/active_support/testing/assertions.rb +34 -6
  80. data/lib/active_support/testing/error_reporter_assertions.rb +18 -1
  81. data/lib/active_support/testing/event_reporter_assertions.rb +227 -0
  82. data/lib/active_support/testing/notification_assertions.rb +92 -0
  83. data/lib/active_support/testing/parallelization/worker.rb +2 -0
  84. data/lib/active_support/testing/parallelization.rb +13 -0
  85. data/lib/active_support/testing/tests_without_assertions.rb +1 -1
  86. data/lib/active_support/testing/time_helpers.rb +7 -3
  87. data/lib/active_support/time_with_zone.rb +22 -22
  88. data/lib/active_support/values/time_zone.rb +8 -1
  89. data/lib/active_support/xml_mini.rb +1 -2
  90. data/lib/active_support.rb +20 -15
  91. metadata +24 -17
  92. data/lib/active_support/core_ext/range/each.rb +0 -24
@@ -39,17 +39,22 @@ module ActiveSupport
39
39
  autoload :Concern
40
40
  autoload :CodeGenerator
41
41
  autoload :ActionableError
42
+ autoload :Configurable
42
43
  autoload :ConfigurationFile
44
+ autoload :ContinuousIntegration
43
45
  autoload :CurrentAttributes
44
46
  autoload :Dependencies
45
47
  autoload :DescendantsTracker
48
+ autoload :Editor
46
49
  autoload :ExecutionWrapper
47
50
  autoload :Executor
48
51
  autoload :ErrorReporter
52
+ autoload :EventReporter
49
53
  autoload :FileUpdateChecker
50
54
  autoload :EventedFileUpdateChecker
51
55
  autoload :ForkTracker
52
56
  autoload :LogSubscriber
57
+ autoload :StructuredEventSubscriber
53
58
  autoload :IsolatedExecutionState
54
59
  autoload :Notifications
55
60
  autoload :Reloader
@@ -61,7 +66,6 @@ module ActiveSupport
61
66
  autoload :Benchmarkable
62
67
  autoload :Cache
63
68
  autoload :Callbacks
64
- autoload :Configurable
65
69
  autoload :ClassAttribute
66
70
  autoload :Deprecation
67
71
  autoload :Delegation
@@ -99,10 +103,16 @@ module ActiveSupport
99
103
 
100
104
  cattr_accessor :test_order # :nodoc:
101
105
  cattr_accessor :test_parallelization_threshold, default: 50 # :nodoc:
106
+ cattr_accessor :parallelize_test_databases, default: true # :nodoc:
102
107
 
103
108
  @error_reporter = ActiveSupport::ErrorReporter.new
104
109
  singleton_class.attr_accessor :error_reporter # :nodoc:
105
110
 
111
+ @event_reporter = ActiveSupport::EventReporter.new
112
+ singleton_class.attr_accessor :event_reporter # :nodoc:
113
+
114
+ cattr_accessor :filter_parameters, default: [] # :nodoc:
115
+
106
116
  def self.cache_format_version
107
117
  Cache.format_version
108
118
  end
@@ -112,23 +122,18 @@ module ActiveSupport
112
122
  end
113
123
 
114
124
  def self.to_time_preserves_timezone
115
- DateAndTime::Compatibility.preserve_timezone
125
+ ActiveSupport.deprecator.warn(
126
+ "`config.active_support.to_time_preserves_timezone` is deprecated and will be removed in Rails 8.2"
127
+ )
128
+ @to_time_preserves_timezone
116
129
  end
117
130
 
118
131
  def self.to_time_preserves_timezone=(value)
119
- if !value
120
- ActiveSupport.deprecator.warn(
121
- "`to_time` will always preserve the receiver timezone rather than system local time in Rails 8.1. " \
122
- "To opt in to the new behavior, set `config.active_support.to_time_preserves_timezone = :zone`."
123
- )
124
- elsif value != :zone
125
- ActiveSupport.deprecator.warn(
126
- "`to_time` will always preserve the full timezone rather than offset of the receiver in Rails 8.1. " \
127
- "To opt in to the new behavior, set `config.active_support.to_time_preserves_timezone = :zone`."
128
- )
129
- end
130
-
131
- DateAndTime::Compatibility.preserve_timezone = value
132
+ ActiveSupport.deprecator.warn(
133
+ "`config.active_support.to_time_preserves_timezone` is deprecated and will be removed in Rails 8.2"
134
+ )
135
+
136
+ @to_time_preserves_timezone = value
132
137
  end
133
138
 
134
139
  def self.utc_to_local_returns_utc_offset_times
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activesupport
3
3
  version: !ruby/object:Gem::Version
4
- version: 8.0.4
4
+ version: 8.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Heinemeier Hansson
@@ -140,61 +140,61 @@ dependencies:
140
140
  - !ruby/object:Gem::Version
141
141
  version: '0'
142
142
  - !ruby/object:Gem::Dependency
143
- name: logger
143
+ name: json
144
144
  requirement: !ruby/object:Gem::Requirement
145
145
  requirements:
146
146
  - - ">="
147
147
  - !ruby/object:Gem::Version
148
- version: 1.4.2
148
+ version: '0'
149
149
  type: :runtime
150
150
  prerelease: false
151
151
  version_requirements: !ruby/object:Gem::Requirement
152
152
  requirements:
153
153
  - - ">="
154
154
  - !ruby/object:Gem::Version
155
- version: 1.4.2
155
+ version: '0'
156
156
  - !ruby/object:Gem::Dependency
157
- name: securerandom
157
+ name: logger
158
158
  requirement: !ruby/object:Gem::Requirement
159
159
  requirements:
160
160
  - - ">="
161
161
  - !ruby/object:Gem::Version
162
- version: '0.3'
162
+ version: 1.4.2
163
163
  type: :runtime
164
164
  prerelease: false
165
165
  version_requirements: !ruby/object:Gem::Requirement
166
166
  requirements:
167
167
  - - ">="
168
168
  - !ruby/object:Gem::Version
169
- version: '0.3'
169
+ version: 1.4.2
170
170
  - !ruby/object:Gem::Dependency
171
- name: uri
171
+ name: securerandom
172
172
  requirement: !ruby/object:Gem::Requirement
173
173
  requirements:
174
174
  - - ">="
175
175
  - !ruby/object:Gem::Version
176
- version: 0.13.1
176
+ version: '0.3'
177
177
  type: :runtime
178
178
  prerelease: false
179
179
  version_requirements: !ruby/object:Gem::Requirement
180
180
  requirements:
181
181
  - - ">="
182
182
  - !ruby/object:Gem::Version
183
- version: 0.13.1
183
+ version: '0.3'
184
184
  - !ruby/object:Gem::Dependency
185
- name: benchmark
185
+ name: uri
186
186
  requirement: !ruby/object:Gem::Requirement
187
187
  requirements:
188
188
  - - ">="
189
189
  - !ruby/object:Gem::Version
190
- version: '0.3'
190
+ version: 0.13.1
191
191
  type: :runtime
192
192
  prerelease: false
193
193
  version_requirements: !ruby/object:Gem::Requirement
194
194
  requirements:
195
195
  - - ">="
196
196
  - !ruby/object:Gem::Version
197
- version: '0.3'
197
+ version: 0.13.1
198
198
  description: A toolkit of support libraries and Ruby core extensions extracted from
199
199
  the Rails framework. Rich support for multibyte strings, internationalization, time
200
200
  zones, and testing.
@@ -233,8 +233,10 @@ files:
233
233
  - lib/active_support/concurrency/load_interlock_aware_monitor.rb
234
234
  - lib/active_support/concurrency/null_lock.rb
235
235
  - lib/active_support/concurrency/share_lock.rb
236
+ - lib/active_support/concurrency/thread_monitor.rb
236
237
  - lib/active_support/configurable.rb
237
238
  - lib/active_support/configuration_file.rb
239
+ - lib/active_support/continuous_integration.rb
238
240
  - lib/active_support/core_ext.rb
239
241
  - lib/active_support/core_ext/array.rb
240
242
  - lib/active_support/core_ext/array/access.rb
@@ -327,7 +329,6 @@ files:
327
329
  - lib/active_support/core_ext/range.rb
328
330
  - lib/active_support/core_ext/range/compare_range.rb
329
331
  - lib/active_support/core_ext/range/conversions.rb
330
- - lib/active_support/core_ext/range/each.rb
331
332
  - lib/active_support/core_ext/range/overlap.rb
332
333
  - lib/active_support/core_ext/range/sole.rb
333
334
  - lib/active_support/core_ext/regexp.rb
@@ -377,11 +378,14 @@ files:
377
378
  - lib/active_support/duration.rb
378
379
  - lib/active_support/duration/iso8601_parser.rb
379
380
  - lib/active_support/duration/iso8601_serializer.rb
381
+ - lib/active_support/editor.rb
380
382
  - lib/active_support/encrypted_configuration.rb
381
383
  - lib/active_support/encrypted_file.rb
382
384
  - lib/active_support/environment_inquirer.rb
383
385
  - lib/active_support/error_reporter.rb
384
386
  - lib/active_support/error_reporter/test_helper.rb
387
+ - lib/active_support/event_reporter.rb
388
+ - lib/active_support/event_reporter/test_helper.rb
385
389
  - lib/active_support/evented_file_update_checker.rb
386
390
  - lib/active_support/execution_context.rb
387
391
  - lib/active_support/execution_context/test_helper.rb
@@ -455,6 +459,7 @@ files:
455
459
  - lib/active_support/secure_compare_rotator.rb
456
460
  - lib/active_support/security_utils.rb
457
461
  - lib/active_support/string_inquirer.rb
462
+ - lib/active_support/structured_event_subscriber.rb
458
463
  - lib/active_support/subscriber.rb
459
464
  - lib/active_support/syntax_error_proxy.rb
460
465
  - lib/active_support/tagged_logging.rb
@@ -466,9 +471,11 @@ files:
466
471
  - lib/active_support/testing/declarative.rb
467
472
  - lib/active_support/testing/deprecation.rb
468
473
  - lib/active_support/testing/error_reporter_assertions.rb
474
+ - lib/active_support/testing/event_reporter_assertions.rb
469
475
  - lib/active_support/testing/file_fixtures.rb
470
476
  - lib/active_support/testing/isolation.rb
471
477
  - lib/active_support/testing/method_call_assertions.rb
478
+ - lib/active_support/testing/notification_assertions.rb
472
479
  - lib/active_support/testing/parallelization.rb
473
480
  - lib/active_support/testing/parallelization/server.rb
474
481
  - lib/active_support/testing/parallelization/worker.rb
@@ -494,10 +501,10 @@ licenses:
494
501
  - MIT
495
502
  metadata:
496
503
  bug_tracker_uri: https://github.com/rails/rails/issues
497
- changelog_uri: https://github.com/rails/rails/blob/v8.0.4/activesupport/CHANGELOG.md
498
- documentation_uri: https://api.rubyonrails.org/v8.0.4/
504
+ changelog_uri: https://github.com/rails/rails/blob/v8.1.0/activesupport/CHANGELOG.md
505
+ documentation_uri: https://api.rubyonrails.org/v8.1.0/
499
506
  mailing_list_uri: https://discuss.rubyonrails.org/c/rubyonrails-talk
500
- source_code_uri: https://github.com/rails/rails/tree/v8.0.4/activesupport
507
+ source_code_uri: https://github.com/rails/rails/tree/v8.1.0/activesupport
501
508
  rubygems_mfa_required: 'true'
502
509
  rdoc_options:
503
510
  - "--encoding"
@@ -1,24 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "active_support/time_with_zone"
4
-
5
- module ActiveSupport
6
- module EachTimeWithZone # :nodoc:
7
- def each(&block)
8
- ensure_iteration_allowed
9
- super
10
- end
11
-
12
- def step(n = 1, &block)
13
- ensure_iteration_allowed
14
- super
15
- end
16
-
17
- private
18
- def ensure_iteration_allowed
19
- raise TypeError, "can't iterate from #{first.class}" if first.is_a?(TimeWithZone)
20
- end
21
- end
22
- end
23
-
24
- Range.prepend(ActiveSupport::EachTimeWithZone)