activesupport 7.2.1.2 → 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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 064f00b5fe4d6086f4e0a54cf85c424cb8a45437b4b5122943c97f6fb8ba6f24
4
- data.tar.gz: 9513765d6176e54df195a9cae99159f0b53fe24cf607188312d8dc2e870f3c63
3
+ metadata.gz: 293fd0b5b00d65684b3e0e8682c75a361d31fdb569fabc55888c4c11d7205ca0
4
+ data.tar.gz: 8b40c8ed09b9a5eaa3173eb5701dde9fe047590b80f8b4e36b732596ff1e4e43
5
5
  SHA512:
6
- metadata.gz: 7d30eb9249ff4d46f46ba10467814c918585b3d7fefa621b30fe50521160ae605fa87194cc22c8d344de6426c99ed0d8d0b28d4d101e67407f1f4b1fc34eb667
7
- data.tar.gz: '0786db0db43131282eb5331be9cf6e18efef7f4abcc9b155dad8959998e55f23dd8923e39db81c71cd6d6ae723eb62d9db0c10d69df71c09614f36afdb6b4ae6'
6
+ metadata.gz: 762f738afc162c559a65a55a9134d105ff18b413a548ff5782481dff8cd8232c4ad3bd62c5f31f67d900594b9d61f7f95d650fea11f03bc269261f69a40aa7f9
7
+ data.tar.gz: 5df006379973b96c7bb71ff559f2bef45a2c6faee3017536e49d0f5884751efb43451016657244111bfe534320448510d24f9c071aae1f22d218e0ca277ba32a
data/CHANGELOG.md CHANGED
@@ -1,3 +1,19 @@
1
+ ## Rails 7.2.2.1 (December 10, 2024) ##
2
+
3
+ * No changes.
4
+
5
+
6
+ ## Rails 7.2.2 (October 30, 2024) ##
7
+
8
+ * Include options when instrumenting `ActiveSupport::Cache::Store#delete` and `ActiveSupport::Cache::Store#delete_multi`.
9
+
10
+ *Adam Renberg Tamm*
11
+
12
+ * Print test names when running `rails test -v` for parallel tests.
13
+
14
+ *John Hawthorn*, *Abeid Ahmed*
15
+
16
+
1
17
  ## Rails 7.2.1.2 (October 23, 2024) ##
2
18
 
3
19
  * No changes.
@@ -113,33 +113,33 @@ module ActiveSupport
113
113
  dispatch { |logger| logger.<<(message) }
114
114
  end
115
115
 
116
- def add(*args, &block)
117
- dispatch { |logger| logger.add(*args, &block) }
116
+ def add(...)
117
+ dispatch { |logger| logger.add(...) }
118
118
  end
119
119
  alias_method :log, :add
120
120
 
121
- def debug(*args, &block)
122
- dispatch { |logger| logger.debug(*args, &block) }
121
+ def debug(...)
122
+ dispatch { |logger| logger.debug(...) }
123
123
  end
124
124
 
125
- def info(*args, &block)
126
- dispatch { |logger| logger.info(*args, &block) }
125
+ def info(...)
126
+ dispatch { |logger| logger.info(...) }
127
127
  end
128
128
 
129
- def warn(*args, &block)
130
- dispatch { |logger| logger.warn(*args, &block) }
129
+ def warn(...)
130
+ dispatch { |logger| logger.warn(...) }
131
131
  end
132
132
 
133
- def error(*args, &block)
134
- dispatch { |logger| logger.error(*args, &block) }
133
+ def error(...)
134
+ dispatch { |logger| logger.error(...) }
135
135
  end
136
136
 
137
- def fatal(*args, &block)
138
- dispatch { |logger| logger.fatal(*args, &block) }
137
+ def fatal(...)
138
+ dispatch { |logger| logger.fatal(...) }
139
139
  end
140
140
 
141
- def unknown(*args, &block)
142
- dispatch { |logger| logger.unknown(*args, &block) }
141
+ def unknown(...)
142
+ dispatch { |logger| logger.unknown(...) }
143
143
  end
144
144
 
145
145
  def formatter=(formatter)
@@ -675,7 +675,7 @@ module ActiveSupport
675
675
  options = merged_options(options)
676
676
  key = normalize_key(name, options)
677
677
 
678
- instrument(:delete, key) do
678
+ instrument(:delete, key, options) do
679
679
  delete_entry(key, **options)
680
680
  end
681
681
  end
@@ -690,7 +690,7 @@ module ActiveSupport
690
690
  options = merged_options(options)
691
691
  names.map! { |key| normalize_key(key, options) }
692
692
 
693
- instrument_multi :delete_multi, names do
693
+ instrument_multi(:delete_multi, names, options) do
694
694
  delete_multi_entries(names, **options)
695
695
  end
696
696
  end
@@ -233,9 +233,11 @@ class Pathname # :nodoc:
233
233
  end
234
234
  end
235
235
 
236
- class IPAddr # :nodoc:
237
- def as_json(options = nil)
238
- to_s
236
+ unless IPAddr.method_defined?(:as_json, false)
237
+ class IPAddr # :nodoc:
238
+ def as_json(options = nil)
239
+ to_s
240
+ end
239
241
  end
240
242
  end
241
243
 
@@ -19,7 +19,7 @@ class String
19
19
  # >> "lj".upcase
20
20
  # => "LJ"
21
21
  #
22
- # == Method chaining
22
+ # == \Method chaining
23
23
  #
24
24
  # All the methods on the Chars proxy which normally return a string will return a Chars object. This allows
25
25
  # method chaining on the result of any of these methods.
@@ -20,7 +20,7 @@ class Time
20
20
  # This method accepts any of the following:
21
21
  #
22
22
  # * A \Rails TimeZone object.
23
- # * An identifier for a \Rails TimeZone object (e.g., "Eastern Time (US & Canada)", <tt>-5.hours</tt>).
23
+ # * An identifier for a \Rails TimeZone object (e.g., "Eastern \Time (US & Canada)", <tt>-5.hours</tt>).
24
24
  # * A +TZInfo::Timezone+ object.
25
25
  # * An identifier for a +TZInfo::Timezone+ object (e.g., "America/New_York").
26
26
  #
@@ -95,6 +95,8 @@ module ActiveSupport
95
95
 
96
96
  INVALID_ATTRIBUTE_NAMES = [:set, :reset, :resets, :instance, :before_reset, :after_reset, :reset_all, :clear_all] # :nodoc:
97
97
 
98
+ NOT_SET = Object.new.freeze # :nodoc:
99
+
98
100
  class << self
99
101
  # Returns singleton instance for this class in this thread. If none exists, one is created.
100
102
  def instance
@@ -109,7 +111,7 @@ module ActiveSupport
109
111
  # is a proc or lambda, it will be called whenever an instance is
110
112
  # constructed. Otherwise, the value will be duplicated with +#dup+.
111
113
  # Default values are re-assigned when the attributes are reset.
112
- def attribute(*names, default: nil)
114
+ def attribute(*names, default: NOT_SET)
113
115
  invalid_attribute_names = names.map(&:to_sym) & INVALID_ATTRIBUTE_NAMES
114
116
  if invalid_attribute_names.any?
115
117
  raise ArgumentError, "Restricted attribute names: #{invalid_attribute_names.join(", ")}"
@@ -221,8 +223,10 @@ module ActiveSupport
221
223
 
222
224
  private
223
225
  def resolve_defaults
224
- defaults.transform_values do |value|
225
- Proc === value ? value.call : value.dup
226
+ defaults.each_with_object({}) do |(key, value), result|
227
+ if value != NOT_SET
228
+ result[key] = Proc === value ? value.call : value.dup
229
+ end
226
230
  end
227
231
  end
228
232
  end
@@ -168,8 +168,8 @@ module ActiveSupport
168
168
  end
169
169
  end
170
170
 
171
- RAILS_GEM_ROOT = File.expand_path("../../../..", __dir__) + "/"
172
- LIB_DIR = RbConfig::CONFIG["libdir"]
171
+ RAILS_GEM_ROOT = File.expand_path("../../../..", __dir__) + "/" # :nodoc:
172
+ LIB_DIR = RbConfig::CONFIG["libdir"] # :nodoc:
173
173
 
174
174
  def ignored_callstack?(path)
175
175
  path.start_with?(RAILS_GEM_ROOT, LIB_DIR) || path.include?("<internal:")
@@ -69,7 +69,7 @@ module ActiveSupport
69
69
  # decrypted or verified.
70
70
  def read
71
71
  if !key.nil? && content_path.exist?
72
- decrypt content_path.binread
72
+ decrypt content_path.binread.strip
73
73
  else
74
74
  raise MissingContentError, content_path
75
75
  end
@@ -9,8 +9,8 @@ module ActiveSupport
9
9
  module VERSION
10
10
  MAJOR = 7
11
11
  MINOR = 2
12
- TINY = 1
13
- PRE = "2"
12
+ TINY = 2
13
+ PRE = "1"
14
14
 
15
15
  STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
16
16
  end
@@ -1,5 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require "active_support/testing/parallelize_executor"
4
+
3
5
  module ActiveSupport
4
6
  module Testing
5
7
  module Isolation
@@ -6,6 +6,8 @@ require "drb/unix" unless Gem.win_platform?
6
6
  module ActiveSupport
7
7
  module Testing
8
8
  class Parallelization # :nodoc:
9
+ PrerecordResultClass = Struct.new(:name)
10
+
9
11
  class Server
10
12
  include DRb::DRbUndumped
11
13
 
@@ -21,6 +23,7 @@ module ActiveSupport
21
23
  @in_flight.delete([result.klass, result.name])
22
24
 
23
25
  reporter.synchronize do
26
+ reporter.prerecord(PrerecordResultClass.new(result.klass), result.name)
24
27
  reporter.record(result)
25
28
  end
26
29
  end
@@ -14,6 +14,9 @@ module ActiveSupport
14
14
  # Expected non-verbose warning emitted by Rails.
15
15
  /Ignoring .*\.yml because it has expired/,
16
16
  /Failed to validate the schema cache because/,
17
+
18
+ # TODO: We need to decide what to do with this.
19
+ /Status code :unprocessable_entity is deprecated/
17
20
  )
18
21
 
19
22
  SUPPRESSED_WARNINGS = Regexp.union(
@@ -85,7 +85,7 @@ module ActiveSupport
85
85
  end
86
86
  alias_method :getlocal, :localtime
87
87
 
88
- # Returns true if the current time is within Daylight Savings Time for the
88
+ # Returns true if the current time is within Daylight Savings \Time for the
89
89
  # specified time zone.
90
90
  #
91
91
  # Time.zone = 'Eastern Time (US & Canada)' # => 'Eastern Time (US & Canada)'
@@ -12,7 +12,7 @@ module ActiveSupport
12
12
  # * Limit the set of zones provided by TZInfo to a meaningful subset of 134
13
13
  # zones.
14
14
  # * Retrieve and display zones with a friendlier name
15
- # (e.g., "Eastern Time (US & Canada)" instead of "America/New_York").
15
+ # (e.g., "Eastern \Time (US & Canada)" instead of "America/New_York").
16
16
  # * Lazily load +TZInfo::Timezone+ instances only when they're needed.
17
17
  # * Create ActiveSupport::TimeWithZone instances via TimeZone's +local+,
18
18
  # +parse+, +at+, and +now+ methods.
@@ -357,7 +357,7 @@ module ActiveSupport
357
357
  "(GMT#{formatted_offset}) #{name}"
358
358
  end
359
359
 
360
- # Method for creating new ActiveSupport::TimeWithZone instance in time zone
360
+ # \Method for creating new ActiveSupport::TimeWithZone instance in time zone
361
361
  # of +self+ from given values.
362
362
  #
363
363
  # Time.zone = 'Hawaii' # => "Hawaii"
@@ -367,7 +367,7 @@ module ActiveSupport
367
367
  ActiveSupport::TimeWithZone.new(nil, self, time)
368
368
  end
369
369
 
370
- # Method for creating new ActiveSupport::TimeWithZone instance in time zone
370
+ # \Method for creating new ActiveSupport::TimeWithZone instance in time zone
371
371
  # of +self+ from number of seconds since the Unix epoch.
372
372
  #
373
373
  # Time.zone = 'Hawaii' # => "Hawaii"
@@ -382,7 +382,7 @@ module ActiveSupport
382
382
  Time.at(*args).utc.in_time_zone(self)
383
383
  end
384
384
 
385
- # Method for creating new ActiveSupport::TimeWithZone instance in time zone
385
+ # \Method for creating new ActiveSupport::TimeWithZone instance in time zone
386
386
  # of +self+ from an ISO 8601 string.
387
387
  #
388
388
  # Time.zone = 'Hawaii' # => "Hawaii"
@@ -434,7 +434,7 @@ module ActiveSupport
434
434
  raise ArgumentError, "invalid date"
435
435
  end
436
436
 
437
- # Method for creating new ActiveSupport::TimeWithZone instance in time zone
437
+ # \Method for creating new ActiveSupport::TimeWithZone instance in time zone
438
438
  # of +self+ from parsed string.
439
439
  #
440
440
  # Time.zone = 'Hawaii' # => "Hawaii"
@@ -456,7 +456,7 @@ module ActiveSupport
456
456
  parts_to_time(Date._parse(str, false), now)
457
457
  end
458
458
 
459
- # Method for creating new ActiveSupport::TimeWithZone instance in time zone
459
+ # \Method for creating new ActiveSupport::TimeWithZone instance in time zone
460
460
  # of +self+ from an RFC 3339 string.
461
461
  #
462
462
  # Time.zone = 'Hawaii' # => "Hawaii"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activesupport
3
3
  version: !ruby/object:Gem::Version
4
- version: 7.2.1.2
4
+ version: 7.2.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Heinemeier Hansson
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-10-23 00:00:00.000000000 Z
11
+ date: 2024-12-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: i18n
@@ -168,6 +168,20 @@ dependencies:
168
168
  - - ">="
169
169
  - !ruby/object:Gem::Version
170
170
  version: '0.3'
171
+ - !ruby/object:Gem::Dependency
172
+ name: benchmark
173
+ requirement: !ruby/object:Gem::Requirement
174
+ requirements:
175
+ - - ">="
176
+ - !ruby/object:Gem::Version
177
+ version: '0.3'
178
+ type: :runtime
179
+ prerelease: false
180
+ version_requirements: !ruby/object:Gem::Requirement
181
+ requirements:
182
+ - - ">="
183
+ - !ruby/object:Gem::Version
184
+ version: '0.3'
171
185
  description: A toolkit of support libraries and Ruby core extensions extracted from
172
186
  the Rails framework. Rich support for multibyte strings, internationalization, time
173
187
  zones, and testing.
@@ -466,10 +480,10 @@ licenses:
466
480
  - MIT
467
481
  metadata:
468
482
  bug_tracker_uri: https://github.com/rails/rails/issues
469
- changelog_uri: https://github.com/rails/rails/blob/v7.2.1.2/activesupport/CHANGELOG.md
470
- documentation_uri: https://api.rubyonrails.org/v7.2.1.2/
483
+ changelog_uri: https://github.com/rails/rails/blob/v7.2.2.1/activesupport/CHANGELOG.md
484
+ documentation_uri: https://api.rubyonrails.org/v7.2.2.1/
471
485
  mailing_list_uri: https://discuss.rubyonrails.org/c/rubyonrails-talk
472
- source_code_uri: https://github.com/rails/rails/tree/v7.2.1.2/activesupport
486
+ source_code_uri: https://github.com/rails/rails/tree/v7.2.2.1/activesupport
473
487
  rubygems_mfa_required: 'true'
474
488
  post_install_message:
475
489
  rdoc_options:
@@ -488,7 +502,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
488
502
  - !ruby/object:Gem::Version
489
503
  version: '0'
490
504
  requirements: []
491
- rubygems_version: 3.5.16
505
+ rubygems_version: 3.5.22
492
506
  signing_key:
493
507
  specification_version: 4
494
508
  summary: A toolkit of support libraries and Ruby core extensions extracted from the