activesupport 7.0.0 → 7.2.2.1

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 (211) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +156 -255
  3. data/MIT-LICENSE +1 -1
  4. data/README.rdoc +6 -6
  5. data/lib/active_support/actionable_error.rb +3 -1
  6. data/lib/active_support/array_inquirer.rb +3 -1
  7. data/lib/active_support/backtrace_cleaner.rb +41 -9
  8. data/lib/active_support/benchmarkable.rb +1 -0
  9. data/lib/active_support/broadcast_logger.rb +251 -0
  10. data/lib/active_support/builder.rb +1 -1
  11. data/lib/active_support/cache/coder.rb +153 -0
  12. data/lib/active_support/cache/entry.rb +134 -0
  13. data/lib/active_support/cache/file_store.rb +49 -17
  14. data/lib/active_support/cache/mem_cache_store.rb +111 -129
  15. data/lib/active_support/cache/memory_store.rb +81 -26
  16. data/lib/active_support/cache/null_store.rb +6 -0
  17. data/lib/active_support/cache/redis_cache_store.rb +175 -154
  18. data/lib/active_support/cache/serializer_with_fallback.rb +152 -0
  19. data/lib/active_support/cache/strategy/local_cache.rb +31 -13
  20. data/lib/active_support/cache.rb +457 -377
  21. data/lib/active_support/callbacks.rb +123 -139
  22. data/lib/active_support/code_generator.rb +15 -10
  23. data/lib/active_support/concern.rb +4 -2
  24. data/lib/active_support/concurrency/load_interlock_aware_monitor.rb +42 -3
  25. data/lib/active_support/concurrency/null_lock.rb +13 -0
  26. data/lib/active_support/configurable.rb +12 -2
  27. data/lib/active_support/core_ext/array/conversions.rb +7 -9
  28. data/lib/active_support/core_ext/array/inquiry.rb +2 -2
  29. data/lib/active_support/core_ext/array.rb +0 -1
  30. data/lib/active_support/core_ext/class/subclasses.rb +4 -15
  31. data/lib/active_support/core_ext/date/blank.rb +4 -0
  32. data/lib/active_support/core_ext/date/calculations.rb +20 -5
  33. data/lib/active_support/core_ext/date/conversions.rb +15 -16
  34. data/lib/active_support/core_ext/date.rb +0 -1
  35. data/lib/active_support/core_ext/date_and_time/calculations.rb +14 -4
  36. data/lib/active_support/core_ext/date_and_time/compatibility.rb +29 -2
  37. data/lib/active_support/core_ext/date_time/blank.rb +4 -0
  38. data/lib/active_support/core_ext/date_time/calculations.rb +4 -0
  39. data/lib/active_support/core_ext/date_time/conversions.rb +15 -15
  40. data/lib/active_support/core_ext/date_time.rb +0 -1
  41. data/lib/active_support/core_ext/digest/uuid.rb +7 -10
  42. data/lib/active_support/core_ext/enumerable.rb +51 -101
  43. data/lib/active_support/core_ext/erb/util.rb +201 -0
  44. data/lib/active_support/core_ext/file/atomic.rb +2 -0
  45. data/lib/active_support/core_ext/hash/conversions.rb +1 -2
  46. data/lib/active_support/core_ext/hash/deep_merge.rb +22 -14
  47. data/lib/active_support/core_ext/hash/deep_transform_values.rb +3 -3
  48. data/lib/active_support/core_ext/hash/indifferent_access.rb +3 -3
  49. data/lib/active_support/core_ext/hash/keys.rb +7 -7
  50. data/lib/active_support/core_ext/integer/inflections.rb +12 -12
  51. data/lib/active_support/core_ext/kernel/singleton_class.rb +1 -1
  52. data/lib/active_support/core_ext/module/attr_internal.rb +17 -6
  53. data/lib/active_support/core_ext/module/attribute_accessors.rb +6 -0
  54. data/lib/active_support/core_ext/module/attribute_accessors_per_thread.rb +38 -20
  55. data/lib/active_support/core_ext/module/concerning.rb +6 -6
  56. data/lib/active_support/core_ext/module/delegation.rb +20 -119
  57. data/lib/active_support/core_ext/module/deprecation.rb +12 -12
  58. data/lib/active_support/core_ext/module/introspection.rb +0 -1
  59. data/lib/active_support/core_ext/numeric/bytes.rb +9 -0
  60. data/lib/active_support/core_ext/numeric/conversions.rb +77 -75
  61. data/lib/active_support/core_ext/numeric.rb +0 -1
  62. data/lib/active_support/core_ext/object/acts_like.rb +29 -5
  63. data/lib/active_support/core_ext/object/blank.rb +45 -1
  64. data/lib/active_support/core_ext/object/deep_dup.rb +16 -0
  65. data/lib/active_support/core_ext/object/duplicable.rb +25 -16
  66. data/lib/active_support/core_ext/object/inclusion.rb +13 -5
  67. data/lib/active_support/core_ext/object/instance_variables.rb +4 -2
  68. data/lib/active_support/core_ext/object/json.rb +17 -7
  69. data/lib/active_support/core_ext/object/to_query.rb +0 -2
  70. data/lib/active_support/core_ext/object/with.rb +46 -0
  71. data/lib/active_support/core_ext/object/with_options.rb +9 -9
  72. data/lib/active_support/core_ext/object.rb +1 -0
  73. data/lib/active_support/core_ext/pathname/blank.rb +20 -0
  74. data/lib/active_support/core_ext/pathname/existence.rb +2 -0
  75. data/lib/active_support/core_ext/pathname.rb +1 -0
  76. data/lib/active_support/core_ext/range/conversions.rb +32 -11
  77. data/lib/active_support/core_ext/range/overlap.rb +40 -0
  78. data/lib/active_support/core_ext/range.rb +1 -2
  79. data/lib/active_support/core_ext/securerandom.rb +2 -6
  80. data/lib/active_support/core_ext/string/conversions.rb +3 -3
  81. data/lib/active_support/core_ext/string/filters.rb +21 -15
  82. data/lib/active_support/core_ext/string/indent.rb +1 -1
  83. data/lib/active_support/core_ext/string/inflections.rb +16 -9
  84. data/lib/active_support/core_ext/string/inquiry.rb +1 -1
  85. data/lib/active_support/core_ext/string/multibyte.rb +1 -1
  86. data/lib/active_support/core_ext/string/output_safety.rb +39 -150
  87. data/lib/active_support/core_ext/thread/backtrace/location.rb +12 -0
  88. data/lib/active_support/core_ext/time/calculations.rb +42 -32
  89. data/lib/active_support/core_ext/time/compatibility.rb +16 -0
  90. data/lib/active_support/core_ext/time/conversions.rb +13 -15
  91. data/lib/active_support/core_ext/time/zones.rb +8 -9
  92. data/lib/active_support/core_ext/time.rb +0 -1
  93. data/lib/active_support/core_ext.rb +0 -1
  94. data/lib/active_support/current_attributes.rb +53 -46
  95. data/lib/active_support/deep_mergeable.rb +53 -0
  96. data/lib/active_support/delegation.rb +202 -0
  97. data/lib/active_support/dependencies/autoload.rb +9 -16
  98. data/lib/active_support/deprecation/behaviors.rb +65 -42
  99. data/lib/active_support/deprecation/constant_accessor.rb +47 -25
  100. data/lib/active_support/deprecation/deprecators.rb +104 -0
  101. data/lib/active_support/deprecation/disallowed.rb +6 -8
  102. data/lib/active_support/deprecation/method_wrappers.rb +6 -23
  103. data/lib/active_support/deprecation/proxy_wrappers.rb +34 -22
  104. data/lib/active_support/deprecation/reporting.rb +49 -27
  105. data/lib/active_support/deprecation.rb +39 -9
  106. data/lib/active_support/deprecator.rb +7 -0
  107. data/lib/active_support/descendants_tracker.rb +66 -175
  108. data/lib/active_support/duration/iso8601_parser.rb +2 -2
  109. data/lib/active_support/duration/iso8601_serializer.rb +1 -4
  110. data/lib/active_support/duration.rb +13 -7
  111. data/lib/active_support/encrypted_configuration.rb +63 -10
  112. data/lib/active_support/encrypted_file.rb +29 -13
  113. data/lib/active_support/environment_inquirer.rb +22 -2
  114. data/lib/active_support/error_reporter/test_helper.rb +15 -0
  115. data/lib/active_support/error_reporter.rb +160 -36
  116. data/lib/active_support/evented_file_update_checker.rb +19 -7
  117. data/lib/active_support/execution_wrapper.rb +23 -28
  118. data/lib/active_support/file_update_checker.rb +5 -3
  119. data/lib/active_support/fork_tracker.rb +4 -32
  120. data/lib/active_support/gem_version.rb +4 -4
  121. data/lib/active_support/gzip.rb +2 -0
  122. data/lib/active_support/hash_with_indifferent_access.rb +41 -25
  123. data/lib/active_support/html_safe_translation.rb +19 -6
  124. data/lib/active_support/i18n.rb +1 -1
  125. data/lib/active_support/i18n_railtie.rb +20 -13
  126. data/lib/active_support/inflector/inflections.rb +2 -0
  127. data/lib/active_support/inflector/methods.rb +28 -18
  128. data/lib/active_support/inflector/transliterate.rb +4 -2
  129. data/lib/active_support/isolated_execution_state.rb +39 -19
  130. data/lib/active_support/json/decoding.rb +2 -1
  131. data/lib/active_support/json/encoding.rb +25 -43
  132. data/lib/active_support/key_generator.rb +13 -5
  133. data/lib/active_support/lazy_load_hooks.rb +33 -7
  134. data/lib/active_support/locale/en.yml +2 -0
  135. data/lib/active_support/log_subscriber/test_helper.rb +2 -2
  136. data/lib/active_support/log_subscriber.rb +76 -36
  137. data/lib/active_support/logger.rb +22 -60
  138. data/lib/active_support/logger_thread_safe_level.rb +10 -32
  139. data/lib/active_support/message_encryptor.rb +200 -55
  140. data/lib/active_support/message_encryptors.rb +141 -0
  141. data/lib/active_support/message_pack/cache_serializer.rb +23 -0
  142. data/lib/active_support/message_pack/extensions.rb +305 -0
  143. data/lib/active_support/message_pack/serializer.rb +63 -0
  144. data/lib/active_support/message_pack.rb +50 -0
  145. data/lib/active_support/message_verifier.rb +220 -89
  146. data/lib/active_support/message_verifiers.rb +135 -0
  147. data/lib/active_support/messages/codec.rb +65 -0
  148. data/lib/active_support/messages/metadata.rb +111 -45
  149. data/lib/active_support/messages/rotation_coordinator.rb +93 -0
  150. data/lib/active_support/messages/rotator.rb +34 -32
  151. data/lib/active_support/messages/serializer_with_fallback.rb +158 -0
  152. data/lib/active_support/multibyte/chars.rb +4 -2
  153. data/lib/active_support/multibyte/unicode.rb +9 -37
  154. data/lib/active_support/notifications/fanout.rb +248 -87
  155. data/lib/active_support/notifications/instrumenter.rb +93 -25
  156. data/lib/active_support/notifications.rb +38 -31
  157. data/lib/active_support/number_helper/number_converter.rb +16 -7
  158. data/lib/active_support/number_helper/number_to_currency_converter.rb +6 -6
  159. data/lib/active_support/number_helper/number_to_human_size_converter.rb +3 -3
  160. data/lib/active_support/number_helper/number_to_phone_converter.rb +1 -0
  161. data/lib/active_support/number_helper.rb +379 -317
  162. data/lib/active_support/option_merger.rb +4 -4
  163. data/lib/active_support/ordered_hash.rb +3 -3
  164. data/lib/active_support/ordered_options.rb +68 -16
  165. data/lib/active_support/parameter_filter.rb +103 -84
  166. data/lib/active_support/proxy_object.rb +8 -3
  167. data/lib/active_support/railtie.rb +30 -25
  168. data/lib/active_support/reloader.rb +13 -5
  169. data/lib/active_support/rescuable.rb +12 -10
  170. data/lib/active_support/secure_compare_rotator.rb +17 -10
  171. data/lib/active_support/string_inquirer.rb +4 -2
  172. data/lib/active_support/subscriber.rb +10 -27
  173. data/lib/active_support/syntax_error_proxy.rb +60 -0
  174. data/lib/active_support/tagged_logging.rb +64 -25
  175. data/lib/active_support/test_case.rb +160 -7
  176. data/lib/active_support/testing/assertions.rb +29 -13
  177. data/lib/active_support/testing/autorun.rb +0 -2
  178. data/lib/active_support/testing/constant_stubbing.rb +54 -0
  179. data/lib/active_support/testing/deprecation.rb +20 -27
  180. data/lib/active_support/testing/error_reporter_assertions.rb +107 -0
  181. data/lib/active_support/testing/isolation.rb +46 -33
  182. data/lib/active_support/testing/method_call_assertions.rb +7 -8
  183. data/lib/active_support/testing/parallelization/server.rb +3 -0
  184. data/lib/active_support/testing/parallelize_executor.rb +8 -3
  185. data/lib/active_support/testing/setup_and_teardown.rb +2 -0
  186. data/lib/active_support/testing/stream.rb +1 -1
  187. data/lib/active_support/testing/strict_warnings.rb +43 -0
  188. data/lib/active_support/testing/tests_without_assertions.rb +19 -0
  189. data/lib/active_support/testing/time_helpers.rb +38 -16
  190. data/lib/active_support/time_with_zone.rb +28 -54
  191. data/lib/active_support/values/time_zone.rb +26 -15
  192. data/lib/active_support/version.rb +1 -1
  193. data/lib/active_support/xml_mini/jdom.rb +3 -10
  194. data/lib/active_support/xml_mini/nokogiri.rb +1 -1
  195. data/lib/active_support/xml_mini/nokogirisax.rb +1 -1
  196. data/lib/active_support/xml_mini/rexml.rb +1 -1
  197. data/lib/active_support/xml_mini.rb +13 -4
  198. data/lib/active_support.rb +15 -3
  199. metadata +142 -21
  200. data/lib/active_support/core_ext/array/deprecated_conversions.rb +0 -25
  201. data/lib/active_support/core_ext/date/deprecated_conversions.rb +0 -26
  202. data/lib/active_support/core_ext/date_time/deprecated_conversions.rb +0 -22
  203. data/lib/active_support/core_ext/numeric/deprecated_conversions.rb +0 -60
  204. data/lib/active_support/core_ext/range/deprecated_conversions.rb +0 -26
  205. data/lib/active_support/core_ext/range/include_time_with_zone.rb +0 -7
  206. data/lib/active_support/core_ext/range/overlaps.rb +0 -10
  207. data/lib/active_support/core_ext/time/deprecated_conversions.rb +0 -22
  208. data/lib/active_support/core_ext/uri.rb +0 -5
  209. data/lib/active_support/deprecation/instance_delegator.rb +0 -38
  210. data/lib/active_support/per_thread_registry.rb +0 -65
  211. data/lib/active_support/ruby_features.rb +0 -7
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: aa0345240163d6b0d98012c437fc988d7c6b957264b42be1c095cb759ed0b102
4
- data.tar.gz: 3533cafb988ce3d2ace9b21f2a78d8bb76aeb6524ecc8b0d71743ee3af64c3c4
3
+ metadata.gz: 293fd0b5b00d65684b3e0e8682c75a361d31fdb569fabc55888c4c11d7205ca0
4
+ data.tar.gz: 8b40c8ed09b9a5eaa3173eb5701dde9fe047590b80f8b4e36b732596ff1e4e43
5
5
  SHA512:
6
- metadata.gz: 5e84aa52f105e68d791fc59101c3f288c86d21a0e26eccd5b3ef9643b82205811f0116055675dffa23c22f9ef126e5c3e52b6113332fd9b3540d90e80afca6a0
7
- data.tar.gz: bd68dd8c4eeebf5c956bb32e6617c2821dba0abdd344aa1f0b8e4f5f3674b1a5d1c3ea19d4b29f99222388ddeef164fcb2183c440af8bc1cab8a86e39aede24a
6
+ metadata.gz: 762f738afc162c559a65a55a9134d105ff18b413a548ff5782481dff8cd8232c4ad3bd62c5f31f67d900594b9d61f7f95d650fea11f03bc269261f69a40aa7f9
7
+ data.tar.gz: 5df006379973b96c7bb71ff559f2bef45a2c6faee3017536e49d0f5884751efb43451016657244111bfe534320448510d24f9c071aae1f22d218e0ca277ba32a
data/CHANGELOG.md CHANGED
@@ -1,383 +1,284 @@
1
- ## Rails 7.0.0 (December 15, 2021) ##
2
-
3
- * Fix `ActiveSupport::Duration.build` to support negative values.
4
-
5
- The algorithm to collect the `parts` of the `ActiveSupport::Duration`
6
- ignored the sign of the `value` and accumulated incorrect part values. This
7
- impacted `ActiveSupport::Duration#sum` (which is dependent on `parts`) but
8
- not `ActiveSupport::Duration#eql?` (which is dependent on `value`).
9
-
10
- *Caleb Buxton*, *Braden Staudacher*
11
-
12
-
13
- ## Rails 7.0.0.rc3 (December 14, 2021) ##
1
+ ## Rails 7.2.2.1 (December 10, 2024) ##
14
2
 
15
3
  * No changes.
16
4
 
17
5
 
18
- ## Rails 7.0.0.rc2 (December 14, 2021) ##
6
+ ## Rails 7.2.2 (October 30, 2024) ##
19
7
 
20
- * No changes.
8
+ * Include options when instrumenting `ActiveSupport::Cache::Store#delete` and `ActiveSupport::Cache::Store#delete_multi`.
21
9
 
22
- ## Rails 7.0.0.rc1 (December 06, 2021) ##
10
+ *Adam Renberg Tamm*
23
11
 
24
- * Deprecate passing a format to `#to_s` in favor of `#to_formatted_s` in `Array`, `Range`, `Date`, `DateTime`, `Time`,
25
- `BigDecimal`, `Float` and, `Integer`.
12
+ * Print test names when running `rails test -v` for parallel tests.
26
13
 
27
- *Rafael Mendonça França*
14
+ *John Hawthorn*, *Abeid Ahmed*
28
15
 
29
- * Document `ActiveSupport::Testing::Deprecation`.
30
16
 
31
- *Sam Bostock & Sam Jordan*
17
+ ## Rails 7.2.1.2 (October 23, 2024) ##
32
18
 
33
- * Add `Pathname#existence`.
19
+ * No changes.
34
20
 
35
- ```ruby
36
- Pathname.new("file").existence&.read
37
- ```
38
21
 
39
- *Timo Schilling*
22
+ ## Rails 7.2.1.1 (October 15, 2024) ##
40
23
 
41
- * Remove deprecate `ActiveSupport::Multibyte::Unicode.default_normalization_form`.
24
+ * No changes.
42
25
 
43
- *Rafael Mendonça França*
44
26
 
45
- * Remove deprecated support to use `Range#include?` to check the inclusion of a value in
46
- a date time range is deprecated.
27
+ ## Rails 7.2.1 (August 22, 2024) ##
47
28
 
48
- *Rafael Mendonça França*
29
+ * No changes.
49
30
 
50
- * Remove deprecated `URI.parser`.
51
31
 
52
- *Rafael Mendonça França*
32
+ ## Rails 7.2.0 (August 09, 2024) ##
53
33
 
54
- * Remove deprecated `config.active_support.use_sha1_digests`.
34
+ * Fix `delegate_missing_to allow_nil: true` when called with implict self
55
35
 
56
- *Rafael Mendonça França*
36
+ ```ruby
37
+ class Person
38
+ delegate_missing_to :address, allow_nil: true
57
39
 
58
- * Invoking `Object#with_options` without a `&block` argument returns the
59
- `ActiveSupport::OptionMerger` instance.
40
+ def address
41
+ nil
42
+ end
60
43
 
61
- *Sean Doyle*
44
+ def berliner?
45
+ city == "Berlin"
46
+ end
47
+ end
62
48
 
63
- * `Rails.application.executor` hooks can now be called around every test
49
+ Person.new.city # => nil
50
+ Person.new.berliner? # undefined local variable or method `city' for an instance of Person (NameError)
51
+ ```
64
52
 
65
- This helps to better simulate request or job local state being reset around tests and prevents state
66
- leaking from one test to another.
53
+ *Jean Boussier*
67
54
 
68
- However it requires the executor hooks executed in the test environment to be re-entrant.
55
+ * Add `logger` as a dependency since it is a bundled gem candidate for Ruby 3.5
69
56
 
70
- To enable this, set `config.active_support.executor_around_test_case = true` (this is the default in Rails 7).
57
+ *Earlopain*
71
58
 
72
- *Jean Boussier*
59
+ * Define `Digest::UUID.nil_uuid`, which returns the so-called nil UUID.
73
60
 
74
- * `ActiveSupport::DescendantsTracker` now mostly delegate to `Class#descendants` on Ruby 3.1
61
+ *Xavier Noria*
75
62
 
76
- Ruby now provides a fast `Class#descendants` making `ActiveSupport::DescendantsTracker` mostly useless.
63
+ * Support `duration` type in `ActiveSupport::XmlMini`.
77
64
 
78
- As a result the following methods are deprecated:
65
+ *heka1024*
79
66
 
80
- - `ActiveSupport::DescendantsTracker.direct_descendants`
81
- - `ActiveSupport::DescendantsTracker#direct_descendants`
67
+ * Remove deprecated `ActiveSupport::Notifications::Event#children` and `ActiveSupport::Notifications::Event#parent_of?`.
82
68
 
83
- *Jean Boussier*
69
+ *Rafael Mendonça França*
84
70
 
85
- * Fix the `Digest::UUID.uuid_from_hash` behavior for namespace IDs that are different from the ones defined on `Digest::UUID`.
71
+ * Remove deprecated support to call the following methods without passing a deprecator:
86
72
 
87
- The new behavior will be enabled by setting the
88
- `config.active_support.use_rfc4122_namespaced_uuids` option to `true`
89
- and is the default for new apps.
73
+ - `deprecate`
74
+ - `deprecate_constant`
75
+ - `ActiveSupport::Deprecation::DeprecatedObjectProxy.new`
76
+ - `ActiveSupport::Deprecation::DeprecatedInstanceVariableProxy.new`
77
+ - `ActiveSupport::Deprecation::DeprecatedConstantProxy.new`
78
+ - `assert_deprecated`
79
+ - `assert_not_deprecated`
80
+ - `collect_deprecations`
90
81
 
91
- The old behavior is the default for upgraded apps and will output a
92
- deprecation warning every time a value that is different than one of
93
- the constants defined on the `Digest::UUID` extension is used as the
94
- namespace ID.
82
+ *Rafael Mendonça França*
95
83
 
96
- *Alex Robbin*, *Erich Soares Machado*, *Eugene Kenny*
84
+ * Remove deprecated `ActiveSupport::Deprecation` delegation to instance.
97
85
 
98
- * `ActiveSupport::Inflector::Inflections#clear(:acronyms)` is now supported,
99
- and `inflector.clear` / `inflector.clear(:all)` also clears acronyms.
86
+ *Rafael Mendonça França*
100
87
 
101
- *Alex Ghiculescu*, *Oliver Peate*
88
+ * Remove deprecated `SafeBuffer#clone_empty`.
102
89
 
90
+ *Rafael Mendonça França*
103
91
 
104
- ## Rails 7.0.0.alpha2 (September 15, 2021) ##
92
+ * Remove deprecated `#to_default_s` from `Array`, `Date`, `DateTime` and `Time`.
105
93
 
106
- * No changes.
94
+ *Rafael Mendonça França*
107
95
 
96
+ * Remove deprecated support to passing `Dalli::Client` instances to `MemCacheStore`.
108
97
 
109
- ## Rails 7.0.0.alpha1 (September 15, 2021) ##
98
+ *Rafael Mendonça França*
110
99
 
111
- * `ActiveSupport::Dependencies` no longer installs a `const_missing` hook. Before this, you could push to the autoload paths and have constants autoloaded. This feature, known as the `classic` autoloader, has been removed.
100
+ * Remove deprecated `config.active_support.use_rfc4122_namespaced_uuids`.
112
101
 
113
- *Xavier Noria*
102
+ *Rafael Mendonça França*
114
103
 
115
- * Private internal classes of `ActiveSupport::Dependencies` have been deleted, like `ActiveSupport::Dependencies::Reference`, `ActiveSupport::Dependencies::Blamable`, and others.
104
+ * Remove deprecated `config.active_support.remove_deprecated_time_with_zone_name`.
116
105
 
117
- *Xavier Noria*
106
+ *Rafael Mendonça França*
118
107
 
119
- * The private API of `ActiveSupport::Dependencies` has been deleted. That includes methods like `hook!`, `unhook!`, `depend_on`, `require_or_load`, `mechanism`, and many others.
108
+ * Remove deprecated `config.active_support.disable_to_s_conversion`.
120
109
 
121
- *Xavier Noria*
110
+ *Rafael Mendonça França*
122
111
 
123
- * Improves the performance of `ActiveSupport::NumberHelper` formatters by avoiding the use of exceptions as flow control.
112
+ * Remove deprecated support to bolding log text with positional boolean in `ActiveSupport::LogSubscriber#color`.
124
113
 
125
- *Mike Dalessio*
114
+ *Rafael Mendonça França*
126
115
 
127
- * Removed rescue block from `ActiveSupport::Cache::RedisCacheStore#handle_exception`
116
+ * Remove deprecated constants `ActiveSupport::LogSubscriber::CLEAR` and `ActiveSupport::LogSubscriber::BOLD`.
128
117
 
129
- Previously, if you provided a `error_handler` to `redis_cache_store`, any errors thrown by
130
- the error handler would be rescued and logged only. Removed the `rescue` clause from `handle_exception`
131
- to allow these to be thrown.
118
+ *Rafael Mendonça França*
132
119
 
133
- *Nicholas A. Stuart*
120
+ * Remove deprecated support for `config.active_support.cache_format_version = 6.1`.
134
121
 
135
- * Allow entirely opting out of deprecation warnings.
122
+ *Rafael Mendonça França*
136
123
 
137
- Previously if you did `app.config.active_support.deprecation = :silence`, some work would
138
- still be done on each call to `ActiveSupport::Deprecation.warn`. In very hot paths, this could
139
- cause performance issues.
124
+ * Remove deprecated `:pool_size` and `:pool_timeout` options for the cache storage.
140
125
 
141
- Now, you can make `ActiveSupport::Deprecation.warn` a no-op:
126
+ *Rafael Mendonça França*
142
127
 
143
- ```ruby
144
- config.active_support.report_deprecations = false
145
- ```
128
+ * Warn on tests without assertions.
146
129
 
147
- This is the default in production for new apps. It is the equivalent to:
130
+ `ActiveSupport::TestCase` now warns when tests do not run any assertions.
131
+ This is helpful in detecting broken tests that do not perform intended assertions.
148
132
 
149
- ```ruby
150
- config.active_support.deprecation = :silence
151
- config.active_support.disallowed_deprecation = :silence
152
- ```
133
+ *fatkodima*
153
134
 
154
- but will take a more optimised code path.
135
+ * Support `hexBinary` type in `ActiveSupport::XmlMini`.
155
136
 
156
- *Alex Ghiculescu*
137
+ *heka1024*
157
138
 
158
- * Faster tests by parallelizing only when overhead is justified by the number
159
- of them.
139
+ * Deprecate `ActiveSupport::ProxyObject` in favor of Ruby's built-in `BasicObject`.
160
140
 
161
- Running tests in parallel adds overhead in terms of database
162
- setup and fixture loading. Now, Rails will only parallelize test executions when
163
- there are enough tests to make it worth it.
141
+ *Earlopain*
164
142
 
165
- This threshold is 50 by default, and is configurable via config setting in
166
- your test.rb:
143
+ * `stub_const` now accepts a `exists: false` parameter to allow stubbing missing constants.
167
144
 
168
- ```ruby
169
- config.active_support.test_parallelization_threshold = 100
170
- ```
145
+ *Jean Boussier*
171
146
 
172
- It's also configurable at the test case level:
147
+ * Make `ActiveSupport::BacktraceCleaner` copy filters and silencers on dup and clone.
173
148
 
174
- ```ruby
175
- class ActiveSupport::TestCase
176
- parallelize threshold: 100
177
- end
178
- ```
149
+ Previously the copy would still share the internal silencers and filters array,
150
+ causing state to leak.
179
151
 
180
- *Jorge Manrubia*
152
+ *Jean Boussier*
181
153
 
182
- * OpenSSL constants are now used for Digest computations.
154
+ * Updating Astana with Western Kazakhstan TZInfo identifier.
183
155
 
184
- *Dirkjan Bussink*
156
+ *Damian Nelson*
185
157
 
186
- * `TimeZone.iso8601` now accepts valid ordinal values similar to Ruby's `Date._iso8601` method.
187
- A valid ordinal value will be converted to an instance of `TimeWithZone` using the `:year`
188
- and `:yday` fragments returned from `Date._iso8601`.
158
+ * Add filename support for `ActiveSupport::Logger.logger_outputs_to?`.
189
159
 
190
160
  ```ruby
191
- twz = ActiveSupport::TimeZone["Eastern Time (US & Canada)"].iso8601("21087")
192
- twz.to_a[0, 6] == [0, 0, 0, 28, 03, 2021]
161
+ logger = Logger.new('/var/log/rails.log')
162
+ ActiveSupport::Logger.logger_outputs_to?(logger, '/var/log/rails.log')
193
163
  ```
194
164
 
195
- *Steve Laing*
196
-
197
- * `Time#change` and methods that call it (e.g. `Time#advance`) will now
198
- return a `Time` with the timezone argument provided, if the caller was
199
- initialized with a timezone argument.
200
-
201
- Fixes [#42467](https://github.com/rails/rails/issues/42467).
165
+ *Christian Schmidt*
202
166
 
203
- *Alex Ghiculescu*
167
+ * Include `IPAddr#prefix` when serializing an `IPAddr` using the
168
+ `ActiveSupport::MessagePack` serializer.
204
169
 
205
- * Allow serializing any module or class to JSON by name.
170
+ This change is backward and forward compatible old payloads can
171
+ still be read, and new payloads will be readable by older versions of Rails.
206
172
 
207
- *Tyler Rick*, *Zachary Scott*
173
+ *Taiki Komaba*
208
174
 
209
- * Raise `ActiveSupport::EncryptedFile::MissingKeyError` when the
210
- `RAILS_MASTER_KEY` environment variable is blank (e.g. `""`).
211
-
212
- *Sunny Ripert*
213
-
214
- * The `from:` option is added to `ActiveSupport::TestCase#assert_no_changes`.
215
-
216
- It permits asserting on the initial value that is expected not to change.
175
+ * Add `default:` support for `ActiveSupport::CurrentAttributes.attribute`.
217
176
 
218
177
  ```ruby
219
- assert_no_changes -> { Status.all_good? }, from: true do
220
- post :create, params: { status: { ok: true } }
178
+ class Current < ActiveSupport::CurrentAttributes
179
+ attribute :counter, default: 0
221
180
  end
222
181
  ```
223
182
 
224
- *George Claghorn*
225
-
226
- * Deprecate `ActiveSupport::SafeBuffer`'s incorrect implicit conversion of objects into string.
227
-
228
- Except for a few methods like `String#%`, objects must implement `#to_str`
229
- to be implicitly converted to a String in string operations. In some
230
- circumstances `ActiveSupport::SafeBuffer` was incorrectly calling the
231
- explicit conversion method (`#to_s`) on them. This behavior is now
232
- deprecated.
233
-
234
- *Jean Boussier*
235
-
236
- * Allow nested access to keys on `Rails.application.credentials`.
237
-
238
- Previously only top level keys in `credentials.yml.enc` could be accessed with method calls. Now any key can.
183
+ *Sean Doyle*
239
184
 
240
- For example, given these secrets:
185
+ * Yield instance to `Object#with` block.
241
186
 
242
- ```yml
243
- aws:
244
- access_key_id: 123
245
- secret_access_key: 345
187
+ ```ruby
188
+ client.with(timeout: 5_000) do |c|
189
+ c.get("/commits")
190
+ end
246
191
  ```
247
192
 
248
- `Rails.application.credentials.aws.access_key_id` will now return the same thing as
249
- `Rails.application.credentials.aws[:access_key_id]`.
250
-
251
- *Alex Ghiculescu*
252
-
253
- * Added a faster and more compact `ActiveSupport::Cache` serialization format.
254
-
255
- It can be enabled with `config.active_support.cache_format_version = 7.0` or
256
- `config.load_defaults 7.0`. Regardless of the configuration Active Support
257
- 7.0 can read cache entries serialized by Active Support 6.1 which allows to
258
- upgrade without invalidating the cache. However Rails 6.1 can't read the
259
- new format, so all readers must be upgraded before the new format is enabled.
260
-
261
- *Jean Boussier*
262
-
263
- * Add `Enumerable#sole`, per `ActiveRecord::FinderMethods#sole`. Returns the
264
- sole item of the enumerable, raising if no items are found, or if more than
265
- one is.
266
-
267
- *Asherah Connor*
268
-
269
- * Freeze `ActiveSupport::Duration#parts` and remove writer methods.
270
-
271
- Durations are meant to be value objects and should not be mutated.
272
-
273
- *Andrew White*
274
-
275
- * Fix `ActiveSupport::TimeZone#utc_to_local` with fractional seconds.
276
-
277
- When `utc_to_local_returns_utc_offset_times` is false and the time
278
- instance had fractional seconds the new UTC time instance was out by
279
- a factor of 1,000,000 as the `Time.utc` constructor takes a usec
280
- value and not a fractional second value.
281
-
282
- *Andrew White*
193
+ *Sean Doyle*
283
194
 
284
- * Add `expires_at` argument to `ActiveSupport::Cache` `write` and `fetch` to set a cache entry TTL as an absolute time.
195
+ * Use logical core count instead of physical core count to determine the
196
+ default number of workers when parallelizing tests.
285
197
 
286
- ```ruby
287
- Rails.cache.write(key, value, expires_at: Time.now.at_end_of_hour)
288
- ```
198
+ *Jonathan Hefner*
289
199
 
290
- *Jean Boussier*
200
+ * Fix `Time.now/DateTime.now/Date.today` to return results in a system timezone after `#travel_to`.
291
201
 
292
- * Deprecate `ActiveSupport::TimeWithZone.name` so that from Rails 7.1 it will use the default implementation.
202
+ There is a bug in the current implementation of #travel_to:
203
+ it remembers a timezone of its argument, and all stubbed methods start
204
+ returning results in that remembered timezone. However, the expected
205
+ behavior is to return results in a system timezone.
293
206
 
294
- *Andrew White*
207
+ *Aleksei Chernenkov*
295
208
 
296
- * Deprecates Rails custom `Enumerable#sum` and `Array#sum` in favor of Ruby's native implementation which
297
- is considerably faster.
209
+ * Add `ErrorReported#unexpected` to report precondition violations.
298
210
 
299
- Ruby requires an initializer for non-numeric type as per examples below:
211
+ For example:
300
212
 
301
213
  ```ruby
302
- %w[foo bar].sum('')
303
- # instead of %w[foo bar].sum
304
-
305
- [[1, 2], [3, 4, 5]].sum([])
306
- # instead of [[1, 2], [3, 4, 5]].sum
214
+ def edit
215
+ if published?
216
+ Rails.error.unexpected("[BUG] Attempting to edit a published article, that shouldn't be possible")
217
+ return false
218
+ end
219
+ # ...
220
+ end
307
221
  ```
308
222
 
309
- *Alberto Mota*
310
-
311
- * Tests parallelization is now disabled when running individual files to prevent the setup overhead.
312
-
313
- It can still be enforced if the environment variable `PARALLEL_WORKERS` is present and set to a value greater than 1.
314
-
315
- *Ricardo Díaz*
316
-
317
- * Fix proxying keyword arguments in `ActiveSupport::CurrentAttributes`.
318
-
319
- *Marcin Kołodziej*
223
+ The above will raise an error in development and test, but only report the error in production.
320
224
 
321
- * Add `Enumerable#maximum` and `Enumerable#minimum` to easily calculate the maximum or minimum from extracted
322
- elements of an enumerable.
323
-
324
- ```ruby
325
- payments = [Payment.new(5), Payment.new(15), Payment.new(10)]
225
+ *Jean Boussier*
326
226
 
327
- payments.minimum(:price) # => 5
328
- payments.maximum(:price) # => 15
329
- ```
227
+ * Make the order of read_multi and write_multi notifications for `Cache::Store#fetch_multi` operations match the order they are executed in.
330
228
 
331
- This also allows passing enumerables to `fresh_when` and `stale?` in Action Controller.
332
- See PR [#41404](https://github.com/rails/rails/pull/41404) for an example.
229
+ *Adam Renberg Tamm*
333
230
 
334
- *Ayrton De Craene*
231
+ * Make return values of `Cache::Store#write` consistent.
335
232
 
336
- * `ActiveSupport::Cache::MemCacheStore` now accepts an explicit `nil` for its `addresses` argument.
233
+ The return value was not specified before. Now it returns `true` on a successful write,
234
+ `nil` if there was an error talking to the cache backend, and `false` if the write failed
235
+ for another reason (e.g. the key already exists and `unless_exist: true` was passed).
337
236
 
338
- ```ruby
339
- config.cache_store = :mem_cache_store, nil
237
+ *Sander Verdonschot*
340
238
 
341
- # is now equivalent to
239
+ * Fix logged cache keys not always matching actual key used by cache action.
342
240
 
343
- config.cache_store = :mem_cache_store
241
+ *Hartley McGuire*
344
242
 
345
- # and is also equivalent to
243
+ * Improve error messages of `assert_changes` and `assert_no_changes`.
346
244
 
347
- config.cache_store = :mem_cache_store, ENV["MEMCACHE_SERVERS"] || "localhost:11211"
245
+ `assert_changes` error messages now display objects with `.inspect` to make it easier
246
+ to differentiate nil from empty strings, strings from symbols, etc.
247
+ `assert_no_changes` error messages now surface the actual value.
348
248
 
349
- # which is the fallback behavior of Dalli
350
- ```
249
+ *pcreux*
351
250
 
352
- This helps those migrating from `:dalli_store`, where an explicit `nil` was permitted.
251
+ * Fix `#to_fs(:human_size)` to correctly work with negative numbers.
353
252
 
354
- *Michael Overmeyer*
253
+ *Earlopain*
355
254
 
356
- * Add `Enumerable#in_order_of` to put an Enumerable in a certain order by a key.
255
+ * Fix `BroadcastLogger#dup` so that it duplicates the logger's `broadcasts`.
357
256
 
358
- *DHH*
257
+ *Andrew Novoselac*
359
258
 
360
- * `ActiveSupport::Inflector.camelize` behaves expected when provided a symbol `:upper` or `:lower` argument. Matches
361
- `String#camelize` behavior.
259
+ * Fix issue where `bootstrap.rb` overwrites the `level` of a `BroadcastLogger`'s `broadcasts`.
362
260
 
363
- *Alex Ghiculescu*
261
+ *Andrew Novoselac*
364
262
 
365
- * Raises an `ArgumentError` when the first argument of `ActiveSupport::Notification.subscribe` is
366
- invalid.
263
+ * Fix compatibility with the `semantic_logger` gem.
367
264
 
368
- *Vipul A M*
265
+ The `semantic_logger` gem doesn't behave exactly like stdlib logger in that
266
+ `SemanticLogger#level` returns a Symbol while stdlib `Logger#level` returns an Integer.
369
267
 
370
- * `HashWithIndifferentAccess#deep_transform_keys` now returns a `HashWithIndifferentAccess` instead of a `Hash`.
268
+ This caused the various `LogSubscriber` classes in Rails to break when assigned a
269
+ `SemanticLogger` instance.
371
270
 
372
- *Nathaniel Woodthorpe*
271
+ *Jean Boussier*, *ojab*
373
272
 
374
- * Consume dalli’s `cache_nils` configuration as `ActiveSupport::Cache`'s `skip_nil` when using `MemCacheStore`.
273
+ * Fix MemoryStore to prevent race conditions when incrementing or decrementing.
375
274
 
376
- *Ritikesh G*
275
+ *Pierre Jambet*
377
276
 
378
- * Add `RedisCacheStore#stats` method similar to `MemCacheStore#stats`. Calls `redis#info` internally.
277
+ * Implement `HashWithIndifferentAccess#to_proc`.
379
278
 
380
- *Ritikesh G*
279
+ Previously, calling `#to_proc` on `HashWithIndifferentAccess` object used inherited `#to_proc`
280
+ method from the `Hash` class, which was not able to access values using indifferent keys.
381
281
 
282
+ *fatkodima*
382
283
 
383
- Please check [6-1-stable](https://github.com/rails/rails/blob/6-1-stable/activesupport/CHANGELOG.md) for previous changes.
284
+ Please check [7-1-stable](https://github.com/rails/rails/blob/7-1-stable/activesupport/CHANGELOG.md) for previous changes.
data/MIT-LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2005-2021 David Heinemeier Hansson
1
+ Copyright (c) David Heinemeier Hansson
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the
data/README.rdoc CHANGED
@@ -1,11 +1,11 @@
1
- = Active Support -- Utility classes and Ruby extensions from Rails
1
+ = Active Support -- Utility classes and Ruby extensions from \Rails
2
2
 
3
3
  Active Support is a collection of utility classes and standard library
4
- extensions that were found useful for the Rails framework. These additions
4
+ extensions that were found useful for the \Rails framework. These additions
5
5
  reside in this package so they can be loaded as needed in Ruby projects
6
- outside of Rails.
6
+ outside of \Rails.
7
7
 
8
- You can read more about the extensions in the {Active Support Core Extensions}[https://edgeguides.rubyonrails.org/active_support_core_extensions.html] guide.
8
+ You can read more about the extensions in the {Active Support Core Extensions}[https://guides.rubyonrails.org/active_support_core_extensions.html] guide.
9
9
 
10
10
  == Download and installation
11
11
 
@@ -13,7 +13,7 @@ The latest version of Active Support can be installed with RubyGems:
13
13
 
14
14
  $ gem install activesupport
15
15
 
16
- Source code can be downloaded as part of the Rails project on GitHub:
16
+ Source code can be downloaded as part of the \Rails project on GitHub:
17
17
 
18
18
  * https://github.com/rails/rails/tree/main/activesupport
19
19
 
@@ -31,7 +31,7 @@ API documentation is at:
31
31
 
32
32
  * https://api.rubyonrails.org
33
33
 
34
- Bug reports for the Ruby on Rails project can be filed here:
34
+ Bug reports for the Ruby on \Rails project can be filed here:
35
35
 
36
36
  * https://github.com/rails/rails/issues
37
37
 
@@ -1,9 +1,11 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ActiveSupport
4
+ # = Actionable Errors
5
+ #
4
6
  # Actionable errors lets you define actions to resolve an error.
5
7
  #
6
- # To make an error actionable, include the <tt>ActiveSupport::ActionableError</tt>
8
+ # To make an error actionable, include the +ActiveSupport::ActionableError+
7
9
  # module and invoke the +action+ class macro to define the action. An action
8
10
  # needs a name and a block to execute.
9
11
  module ActionableError
@@ -1,6 +1,8 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ActiveSupport
4
+ # = \Array Inquirer
5
+ #
4
6
  # Wrapping an array in an +ArrayInquirer+ gives a friendlier way to check
5
7
  # its string-like contents:
6
8
  #
@@ -37,7 +39,7 @@ module ActiveSupport
37
39
  name.end_with?("?") || super
38
40
  end
39
41
 
40
- def method_missing(name, *args)
42
+ def method_missing(name, ...)
41
43
  if name.end_with?("?")
42
44
  any?(name[0..-2])
43
45
  else