activesupport 7.2.1.1 → 7.2.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1c7d2490f252aca0df84dcd79067dcb858f839ee95c8e90a73c8257fadacef28
4
- data.tar.gz: d12b2cfa53f8f915665c7e78d1212568e9526bb43bc2f693ad0ae424ca6f626f
3
+ metadata.gz: 9a3996eac7e9551da7dd4bfc64cd93c049f3cb044fba118c088fc7ae18098565
4
+ data.tar.gz: fc6777f0b3cc247cfb3d3bbedabec020937ef4bf226318d6f775bef99b43b162
5
5
  SHA512:
6
- metadata.gz: 3a9feae253c0cbfe426a9e295ba117fc0b6f916fb76b1108a338f44f7e9d5ced8eded68872b85756dd6cf9d70fe6168a75aa6f52dbe5b1ff6690139444983b00
7
- data.tar.gz: f909676a63b301be9fd439512cb7b9a23408b024e2694b896dffda1d8c2ca1626ee1dc3aff5477ea0e04c4c7f115f98a2143d1eddd635914a5a0d241258e0c3b
6
+ metadata.gz: 1c2e709540796368a539085facf517fd7bd02fb30438a87dd4508fff29e15fe58632b8d62351238998b95e775ec12491591efbd8ac0edb89f513c7a3dad1ff47
7
+ data.tar.gz: 1be932867f259f0ee991d3b74a8f8e186f75b7bf7a279bde9235ac6e59cc4bae7f2c61feff5a19c5582afcca0bd4bd4468f25cf55b07693d24586a5f05723f90
data/CHANGELOG.md CHANGED
@@ -1,3 +1,19 @@
1
+ ## Rails 7.2.2 (October 30, 2024) ##
2
+
3
+ * Include options when instrumenting `ActiveSupport::Cache::Store#delete` and `ActiveSupport::Cache::Store#delete_multi`.
4
+
5
+ *Adam Renberg Tamm*
6
+
7
+ * Print test names when running `rails test -v` for parallel tests.
8
+
9
+ *John Hawthorn*, *Abeid Ahmed*
10
+
11
+
12
+ ## Rails 7.2.1.2 (October 23, 2024) ##
13
+
14
+ * No changes.
15
+
16
+
1
17
  ## Rails 7.2.1.1 (October 15, 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 = "1"
12
+ TINY = 2
13
+ PRE = nil
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.1
4
+ version: 7.2.2
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-15 00:00:00.000000000 Z
11
+ date: 2024-10-31 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.1/activesupport/CHANGELOG.md
470
- documentation_uri: https://api.rubyonrails.org/v7.2.1.1/
483
+ changelog_uri: https://github.com/rails/rails/blob/v7.2.2/activesupport/CHANGELOG.md
484
+ documentation_uri: https://api.rubyonrails.org/v7.2.2/
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.1/activesupport
486
+ source_code_uri: https://github.com/rails/rails/tree/v7.2.2/activesupport
473
487
  rubygems_mfa_required: 'true'
474
488
  post_install_message:
475
489
  rdoc_options: