activesupport 7.2.3 → 8.0.0.beta1
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 +4 -4
- data/CHANGELOG.md +41 -385
- data/README.rdoc +1 -1
- data/lib/active_support/backtrace_cleaner.rb +2 -2
- data/lib/active_support/benchmark.rb +21 -0
- data/lib/active_support/benchmarkable.rb +3 -2
- data/lib/active_support/broadcast_logger.rb +74 -61
- data/lib/active_support/cache/file_store.rb +14 -4
- data/lib/active_support/cache/mem_cache_store.rb +15 -13
- data/lib/active_support/cache/memory_store.rb +9 -5
- data/lib/active_support/cache/null_store.rb +2 -2
- data/lib/active_support/cache/redis_cache_store.rb +6 -3
- data/lib/active_support/cache/strategy/local_cache.rb +20 -56
- data/lib/active_support/cache.rb +17 -12
- data/lib/active_support/callbacks.rb +3 -5
- data/lib/active_support/class_attribute.rb +26 -0
- data/lib/active_support/code_generator.rb +9 -0
- data/lib/active_support/concurrency/share_lock.rb +0 -1
- data/lib/active_support/configuration_file.rb +15 -6
- data/lib/active_support/core_ext/benchmark.rb +6 -10
- data/lib/active_support/core_ext/class/attribute.rb +12 -21
- data/lib/active_support/core_ext/date/conversions.rb +2 -0
- data/lib/active_support/core_ext/date_and_time/compatibility.rb +2 -2
- data/lib/active_support/core_ext/date_time/conversions.rb +2 -4
- data/lib/active_support/core_ext/enumerable.rb +13 -20
- data/lib/active_support/core_ext/erb/util.rb +2 -2
- data/lib/active_support/core_ext/hash/except.rb +0 -12
- data/lib/active_support/core_ext/module/introspection.rb +0 -3
- data/lib/active_support/core_ext/object/json.rb +18 -14
- data/lib/active_support/core_ext/object/try.rb +2 -2
- data/lib/active_support/core_ext/range.rb +0 -1
- data/lib/active_support/core_ext/securerandom.rb +8 -24
- data/lib/active_support/core_ext/string/filters.rb +3 -3
- data/lib/active_support/core_ext/string/multibyte.rb +3 -3
- data/lib/active_support/core_ext/time/calculations.rb +14 -2
- data/lib/active_support/core_ext/time/compatibility.rb +1 -9
- data/lib/active_support/core_ext/time/conversions.rb +2 -0
- data/lib/active_support/core_ext/time/zones.rb +1 -1
- data/lib/active_support/current_attributes.rb +7 -14
- data/lib/active_support/deprecation.rb +1 -1
- data/lib/active_support/encrypted_configuration.rb +20 -2
- data/lib/active_support/error_reporter.rb +27 -6
- data/lib/active_support/execution_wrapper.rb +1 -1
- data/lib/active_support/file_update_checker.rb +1 -1
- data/lib/active_support/gem_version.rb +4 -4
- data/lib/active_support/hash_with_indifferent_access.rb +31 -31
- data/lib/active_support/i18n_railtie.rb +19 -10
- data/lib/active_support/isolated_execution_state.rb +0 -1
- data/lib/active_support/json/decoding.rb +1 -1
- data/lib/active_support/json/encoding.rb +7 -25
- data/lib/active_support/lazy_load_hooks.rb +1 -1
- data/lib/active_support/message_encryptors.rb +2 -2
- data/lib/active_support/message_verifier.rb +0 -9
- data/lib/active_support/message_verifiers.rb +3 -5
- data/lib/active_support/messages/rotator.rb +0 -5
- data/lib/active_support/multibyte/chars.rb +1 -4
- data/lib/active_support/number_helper.rb +22 -0
- data/lib/active_support/railtie.rb +4 -0
- data/lib/active_support/tagged_logging.rb +5 -0
- data/lib/active_support/testing/assertions.rb +72 -21
- data/lib/active_support/testing/isolation.rb +0 -2
- data/lib/active_support/testing/parallelization/server.rb +2 -15
- data/lib/active_support/testing/parallelization/worker.rb +2 -2
- data/lib/active_support/testing/parallelization.rb +1 -12
- data/lib/active_support/testing/strict_warnings.rb +43 -0
- data/lib/active_support/testing/time_helpers.rb +2 -1
- data/lib/active_support/time_with_zone.rb +22 -13
- data/lib/active_support/values/time_zone.rb +17 -15
- data/lib/active_support/xml_mini.rb +0 -2
- data/lib/active_support.rb +10 -2
- metadata +27 -8
- data/lib/active_support/core_ext/range/sole.rb +0 -17
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
$VERBOSE = true
|
|
4
|
+
Warning[:deprecated] = true
|
|
5
|
+
|
|
6
|
+
module ActiveSupport
|
|
7
|
+
module RaiseWarnings # :nodoc:
|
|
8
|
+
class WarningError < StandardError; end
|
|
9
|
+
|
|
10
|
+
PROJECT_ROOT = File.expand_path("../../../../", __dir__)
|
|
11
|
+
ALLOWED_WARNINGS = Regexp.union(
|
|
12
|
+
/circular require considered harmful.*delayed_job/, # Bug in delayed job.
|
|
13
|
+
|
|
14
|
+
# Expected non-verbose warning emitted by Rails.
|
|
15
|
+
/Ignoring .*\.yml because it has expired/,
|
|
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/
|
|
20
|
+
)
|
|
21
|
+
|
|
22
|
+
SUPPRESSED_WARNINGS = Regexp.union(
|
|
23
|
+
# TODO: remove if https://github.com/mikel/mail/pull/1557 or similar fix
|
|
24
|
+
%r{/lib/mail/parsers/.*statement not reached},
|
|
25
|
+
%r{/lib/mail/parsers/.*assigned but unused variable - disp_type_s},
|
|
26
|
+
%r{/lib/mail/parsers/.*assigned but unused variable - testEof}
|
|
27
|
+
)
|
|
28
|
+
|
|
29
|
+
def warn(message, ...)
|
|
30
|
+
return if SUPPRESSED_WARNINGS.match?(message)
|
|
31
|
+
|
|
32
|
+
super
|
|
33
|
+
|
|
34
|
+
return unless message.include?(PROJECT_ROOT)
|
|
35
|
+
return if ALLOWED_WARNINGS.match?(message)
|
|
36
|
+
return unless ENV["RAILS_STRICT_WARNINGS"] || ENV["BUILDKITE"]
|
|
37
|
+
|
|
38
|
+
raise WarningError.new(message)
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
Warning.singleton_class.prepend(ActiveSupport::RaiseWarnings)
|
|
@@ -166,9 +166,10 @@ module ActiveSupport
|
|
|
166
166
|
else
|
|
167
167
|
now = date_or_time
|
|
168
168
|
now = now.to_time unless now.is_a?(Time)
|
|
169
|
-
now = now.change(usec: 0) unless with_usec
|
|
170
169
|
end
|
|
171
170
|
|
|
171
|
+
now = now.change(usec: 0) unless with_usec
|
|
172
|
+
|
|
172
173
|
# +now+ must be in local system timezone, because +Time.at(now)+
|
|
173
174
|
# and +now.to_date+ (see stubs below) will use +now+'s timezone too!
|
|
174
175
|
now = now.getlocal
|
|
@@ -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
|
|
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)'
|
|
@@ -138,7 +138,7 @@ module ActiveSupport
|
|
|
138
138
|
#
|
|
139
139
|
# Time.zone.now.inspect # => "Thu, 04 Dec 2014 11:00:25.624541392 EST -05:00"
|
|
140
140
|
def inspect
|
|
141
|
-
"#{time.strftime('%
|
|
141
|
+
"#{time.strftime('%F %H:%M:%S.%9N')} #{zone} #{formatted_offset}"
|
|
142
142
|
end
|
|
143
143
|
|
|
144
144
|
# Returns a string of the object's date and time in the ISO 8601 standard
|
|
@@ -157,11 +157,11 @@ module ActiveSupport
|
|
|
157
157
|
# to +false+.
|
|
158
158
|
#
|
|
159
159
|
# # With ActiveSupport::JSON::Encoding.use_standard_json_time_format = true
|
|
160
|
-
# Time.utc(2005,2,1,15,15,10).in_time_zone("Hawaii").
|
|
160
|
+
# Time.utc(2005,2,1,15,15,10).in_time_zone("Hawaii").as_json
|
|
161
161
|
# # => "2005-02-01T05:15:10.000-10:00"
|
|
162
162
|
#
|
|
163
163
|
# # With ActiveSupport::JSON::Encoding.use_standard_json_time_format = false
|
|
164
|
-
# Time.utc(2005,2,1,15,15,10).in_time_zone("Hawaii").
|
|
164
|
+
# Time.utc(2005,2,1,15,15,10).in_time_zone("Hawaii").as_json
|
|
165
165
|
# # => "2005/02/01 05:15:10 -1000"
|
|
166
166
|
def as_json(options = nil)
|
|
167
167
|
if ActiveSupport::JSON::Encoding.use_standard_json_time_format
|
|
@@ -215,8 +215,7 @@ module ActiveSupport
|
|
|
215
215
|
elsif formatter = ::Time::DATE_FORMATS[format]
|
|
216
216
|
formatter.respond_to?(:call) ? formatter.call(self).to_s : strftime(formatter)
|
|
217
217
|
else
|
|
218
|
-
|
|
219
|
-
"#{time.strftime("%Y-%m-%d %H:%M:%S")} #{formatted_offset(false, 'UTC')}"
|
|
218
|
+
to_s
|
|
220
219
|
end
|
|
221
220
|
end
|
|
222
221
|
alias_method :to_formatted_s, :to_fs
|
|
@@ -300,7 +299,16 @@ module ActiveSupport
|
|
|
300
299
|
if duration_of_variable_length?(other)
|
|
301
300
|
method_missing(:+, other)
|
|
302
301
|
else
|
|
303
|
-
|
|
302
|
+
begin
|
|
303
|
+
result = utc + other
|
|
304
|
+
rescue TypeError
|
|
305
|
+
result = utc.to_datetime.since(other)
|
|
306
|
+
ActiveSupport.deprecator.warn(
|
|
307
|
+
"Adding an instance of #{other.class} to an instance of #{self.class} is deprecated. This behavior will raise " \
|
|
308
|
+
"a `TypeError` in Rails 8.1."
|
|
309
|
+
)
|
|
310
|
+
result.in_time_zone(time_zone)
|
|
311
|
+
end
|
|
304
312
|
result.in_time_zone(time_zone)
|
|
305
313
|
end
|
|
306
314
|
end
|
|
@@ -336,7 +344,7 @@ module ActiveSupport
|
|
|
336
344
|
elsif duration_of_variable_length?(other)
|
|
337
345
|
method_missing(:-, other)
|
|
338
346
|
else
|
|
339
|
-
result = utc
|
|
347
|
+
result = utc - other
|
|
340
348
|
result.in_time_zone(time_zone)
|
|
341
349
|
end
|
|
342
350
|
end
|
|
@@ -479,11 +487,13 @@ module ActiveSupport
|
|
|
479
487
|
@to_datetime ||= utc.to_datetime.new_offset(Rational(utc_offset, 86_400))
|
|
480
488
|
end
|
|
481
489
|
|
|
482
|
-
# Returns an instance of +Time+, either with the same
|
|
483
|
-
# as +self+ or in the local system timezone
|
|
484
|
-
# of +ActiveSupport.to_time_preserves_timezone+.
|
|
490
|
+
# Returns an instance of +Time+, either with the same timezone as +self+,
|
|
491
|
+
# with the same UTC offset as +self+ or in the local system timezone
|
|
492
|
+
# depending on the setting of +ActiveSupport.to_time_preserves_timezone+.
|
|
485
493
|
def to_time
|
|
486
|
-
if preserve_timezone
|
|
494
|
+
if preserve_timezone == :zone
|
|
495
|
+
@to_time_with_timezone ||= getlocal(time_zone)
|
|
496
|
+
elsif preserve_timezone
|
|
487
497
|
@to_time_with_instance_offset ||= getlocal(utc_offset)
|
|
488
498
|
else
|
|
489
499
|
@to_time_with_system_offset ||= getlocal
|
|
@@ -535,7 +545,6 @@ module ActiveSupport
|
|
|
535
545
|
# Ensure proxy class responds to all methods that underlying time instance
|
|
536
546
|
# responds to.
|
|
537
547
|
def respond_to_missing?(sym, include_priv)
|
|
538
|
-
return false if sym.to_sym == :acts_like_date?
|
|
539
548
|
time.respond_to?(sym, include_priv)
|
|
540
549
|
end
|
|
541
550
|
|
|
@@ -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
|
|
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.
|
|
@@ -208,9 +208,7 @@ module ActiveSupport
|
|
|
208
208
|
TZInfo::Timezone.get(MAPPING[name] || name)
|
|
209
209
|
end
|
|
210
210
|
|
|
211
|
-
# :
|
|
212
|
-
alias_method :create, :new
|
|
213
|
-
# :startdoc:
|
|
211
|
+
alias_method :create, :new # :nodoc:
|
|
214
212
|
|
|
215
213
|
# Returns a TimeZone instance with the given name, or +nil+ if no
|
|
216
214
|
# such TimeZone instance exists. (This exists to support the use of
|
|
@@ -357,7 +355,7 @@ module ActiveSupport
|
|
|
357
355
|
"(GMT#{formatted_offset}) #{name}"
|
|
358
356
|
end
|
|
359
357
|
|
|
360
|
-
#
|
|
358
|
+
# Method for creating new ActiveSupport::TimeWithZone instance in time zone
|
|
361
359
|
# of +self+ from given values.
|
|
362
360
|
#
|
|
363
361
|
# Time.zone = 'Hawaii' # => "Hawaii"
|
|
@@ -367,7 +365,7 @@ module ActiveSupport
|
|
|
367
365
|
ActiveSupport::TimeWithZone.new(nil, self, time)
|
|
368
366
|
end
|
|
369
367
|
|
|
370
|
-
#
|
|
368
|
+
# Method for creating new ActiveSupport::TimeWithZone instance in time zone
|
|
371
369
|
# of +self+ from number of seconds since the Unix epoch.
|
|
372
370
|
#
|
|
373
371
|
# Time.zone = 'Hawaii' # => "Hawaii"
|
|
@@ -382,7 +380,7 @@ module ActiveSupport
|
|
|
382
380
|
Time.at(*args).utc.in_time_zone(self)
|
|
383
381
|
end
|
|
384
382
|
|
|
385
|
-
#
|
|
383
|
+
# Method for creating new ActiveSupport::TimeWithZone instance in time zone
|
|
386
384
|
# of +self+ from an ISO 8601 string.
|
|
387
385
|
#
|
|
388
386
|
# Time.zone = 'Hawaii' # => "Hawaii"
|
|
@@ -434,7 +432,7 @@ module ActiveSupport
|
|
|
434
432
|
raise ArgumentError, "invalid date"
|
|
435
433
|
end
|
|
436
434
|
|
|
437
|
-
#
|
|
435
|
+
# Method for creating new ActiveSupport::TimeWithZone instance in time zone
|
|
438
436
|
# of +self+ from parsed string.
|
|
439
437
|
#
|
|
440
438
|
# Time.zone = 'Hawaii' # => "Hawaii"
|
|
@@ -456,7 +454,7 @@ module ActiveSupport
|
|
|
456
454
|
parts_to_time(Date._parse(str, false), now)
|
|
457
455
|
end
|
|
458
456
|
|
|
459
|
-
#
|
|
457
|
+
# Method for creating new ActiveSupport::TimeWithZone instance in time zone
|
|
460
458
|
# of +self+ from an RFC 3339 string.
|
|
461
459
|
#
|
|
462
460
|
# Time.zone = 'Hawaii' # => "Hawaii"
|
|
@@ -554,15 +552,11 @@ module ActiveSupport
|
|
|
554
552
|
tzinfo.local_to_utc(time, dst)
|
|
555
553
|
end
|
|
556
554
|
|
|
557
|
-
|
|
558
|
-
# instances.
|
|
559
|
-
def period_for_utc(time)
|
|
555
|
+
def period_for_utc(time) # :nodoc:
|
|
560
556
|
tzinfo.period_for_utc(time)
|
|
561
557
|
end
|
|
562
558
|
|
|
563
|
-
|
|
564
|
-
# instances.
|
|
565
|
-
def period_for_local(time, dst = true)
|
|
559
|
+
def period_for_local(time, dst = true) # :nodoc:
|
|
566
560
|
tzinfo.period_for_local(time, dst) { |periods| periods.last }
|
|
567
561
|
end
|
|
568
562
|
|
|
@@ -570,6 +564,14 @@ module ActiveSupport
|
|
|
570
564
|
tzinfo.periods_for_local(time)
|
|
571
565
|
end
|
|
572
566
|
|
|
567
|
+
def abbr(time) # :nodoc:
|
|
568
|
+
tzinfo.abbr(time)
|
|
569
|
+
end
|
|
570
|
+
|
|
571
|
+
def dst?(time) # :nodoc:
|
|
572
|
+
tzinfo.dst?(time)
|
|
573
|
+
end
|
|
574
|
+
|
|
573
575
|
def init_with(coder) # :nodoc:
|
|
574
576
|
initialize(coder["name"])
|
|
575
577
|
end
|
data/lib/active_support.rb
CHANGED
|
@@ -58,10 +58,12 @@ module ActiveSupport
|
|
|
58
58
|
eager_autoload do
|
|
59
59
|
autoload :BacktraceCleaner
|
|
60
60
|
autoload :ProxyObject
|
|
61
|
+
autoload :Benchmark
|
|
61
62
|
autoload :Benchmarkable
|
|
62
63
|
autoload :Cache
|
|
63
64
|
autoload :Callbacks
|
|
64
65
|
autoload :Configurable
|
|
66
|
+
autoload :ClassAttribute
|
|
65
67
|
autoload :Deprecation
|
|
66
68
|
autoload :Delegation
|
|
67
69
|
autoload :Digest
|
|
@@ -115,9 +117,15 @@ module ActiveSupport
|
|
|
115
117
|
end
|
|
116
118
|
|
|
117
119
|
def self.to_time_preserves_timezone=(value)
|
|
118
|
-
|
|
120
|
+
if !value
|
|
119
121
|
ActiveSupport.deprecator.warn(
|
|
120
|
-
"
|
|
122
|
+
"`to_time` will always preserve the receiver timezone rather than system local time in Rails 8.0. " \
|
|
123
|
+
"To opt in to the new behavior, set `config.active_support.to_time_preserves_timezone = :zone`."
|
|
124
|
+
)
|
|
125
|
+
elsif value != :zone
|
|
126
|
+
ActiveSupport.deprecator.warn(
|
|
127
|
+
"`to_time` will always preserve the full timezone rather than offset of the receiver in Rails 8.0. " \
|
|
128
|
+
"To opt in to the new behavior, set `config.active_support.to_time_preserves_timezone = :zone`."
|
|
121
129
|
)
|
|
122
130
|
end
|
|
123
131
|
|
metadata
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: activesupport
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version:
|
|
4
|
+
version: 8.0.0.beta1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- David Heinemeier Hansson
|
|
8
|
+
autorequire:
|
|
8
9
|
bindir: bin
|
|
9
10
|
cert_chain: []
|
|
10
|
-
date:
|
|
11
|
+
date: 2024-09-26 00:00:00.000000000 Z
|
|
11
12
|
dependencies:
|
|
12
13
|
- !ruby/object:Gem::Dependency
|
|
13
14
|
name: i18n
|
|
@@ -167,6 +168,20 @@ dependencies:
|
|
|
167
168
|
- - ">="
|
|
168
169
|
- !ruby/object:Gem::Version
|
|
169
170
|
version: '0.3'
|
|
171
|
+
- !ruby/object:Gem::Dependency
|
|
172
|
+
name: uri
|
|
173
|
+
requirement: !ruby/object:Gem::Requirement
|
|
174
|
+
requirements:
|
|
175
|
+
- - ">="
|
|
176
|
+
- !ruby/object:Gem::Version
|
|
177
|
+
version: 0.13.1
|
|
178
|
+
type: :runtime
|
|
179
|
+
prerelease: false
|
|
180
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
181
|
+
requirements:
|
|
182
|
+
- - ">="
|
|
183
|
+
- !ruby/object:Gem::Version
|
|
184
|
+
version: 0.13.1
|
|
170
185
|
- !ruby/object:Gem::Dependency
|
|
171
186
|
name: benchmark
|
|
172
187
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -197,6 +212,7 @@ files:
|
|
|
197
212
|
- lib/active_support/all.rb
|
|
198
213
|
- lib/active_support/array_inquirer.rb
|
|
199
214
|
- lib/active_support/backtrace_cleaner.rb
|
|
215
|
+
- lib/active_support/benchmark.rb
|
|
200
216
|
- lib/active_support/benchmarkable.rb
|
|
201
217
|
- lib/active_support/broadcast_logger.rb
|
|
202
218
|
- lib/active_support/builder.rb
|
|
@@ -212,6 +228,7 @@ files:
|
|
|
212
228
|
- lib/active_support/cache/strategy/local_cache.rb
|
|
213
229
|
- lib/active_support/cache/strategy/local_cache_middleware.rb
|
|
214
230
|
- lib/active_support/callbacks.rb
|
|
231
|
+
- lib/active_support/class_attribute.rb
|
|
215
232
|
- lib/active_support/code_generator.rb
|
|
216
233
|
- lib/active_support/concern.rb
|
|
217
234
|
- lib/active_support/concurrency/load_interlock_aware_monitor.rb
|
|
@@ -313,7 +330,6 @@ files:
|
|
|
313
330
|
- lib/active_support/core_ext/range/conversions.rb
|
|
314
331
|
- lib/active_support/core_ext/range/each.rb
|
|
315
332
|
- lib/active_support/core_ext/range/overlap.rb
|
|
316
|
-
- lib/active_support/core_ext/range/sole.rb
|
|
317
333
|
- lib/active_support/core_ext/regexp.rb
|
|
318
334
|
- lib/active_support/core_ext/securerandom.rb
|
|
319
335
|
- lib/active_support/core_ext/string.rb
|
|
@@ -460,6 +476,7 @@ files:
|
|
|
460
476
|
- lib/active_support/testing/parallelize_executor.rb
|
|
461
477
|
- lib/active_support/testing/setup_and_teardown.rb
|
|
462
478
|
- lib/active_support/testing/stream.rb
|
|
479
|
+
- lib/active_support/testing/strict_warnings.rb
|
|
463
480
|
- lib/active_support/testing/tagged_logging.rb
|
|
464
481
|
- lib/active_support/testing/tests_without_assertions.rb
|
|
465
482
|
- lib/active_support/testing/time_helpers.rb
|
|
@@ -479,11 +496,12 @@ licenses:
|
|
|
479
496
|
- MIT
|
|
480
497
|
metadata:
|
|
481
498
|
bug_tracker_uri: https://github.com/rails/rails/issues
|
|
482
|
-
changelog_uri: https://github.com/rails/rails/blob/
|
|
483
|
-
documentation_uri: https://api.rubyonrails.org/
|
|
499
|
+
changelog_uri: https://github.com/rails/rails/blob/v8.0.0.beta1/activesupport/CHANGELOG.md
|
|
500
|
+
documentation_uri: https://api.rubyonrails.org/v8.0.0.beta1/
|
|
484
501
|
mailing_list_uri: https://discuss.rubyonrails.org/c/rubyonrails-talk
|
|
485
|
-
source_code_uri: https://github.com/rails/rails/tree/
|
|
502
|
+
source_code_uri: https://github.com/rails/rails/tree/v8.0.0.beta1/activesupport
|
|
486
503
|
rubygems_mfa_required: 'true'
|
|
504
|
+
post_install_message:
|
|
487
505
|
rdoc_options:
|
|
488
506
|
- "--encoding"
|
|
489
507
|
- UTF-8
|
|
@@ -493,14 +511,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
493
511
|
requirements:
|
|
494
512
|
- - ">="
|
|
495
513
|
- !ruby/object:Gem::Version
|
|
496
|
-
version: 3.
|
|
514
|
+
version: 3.2.0
|
|
497
515
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
498
516
|
requirements:
|
|
499
517
|
- - ">="
|
|
500
518
|
- !ruby/object:Gem::Version
|
|
501
519
|
version: '0'
|
|
502
520
|
requirements: []
|
|
503
|
-
rubygems_version: 3.
|
|
521
|
+
rubygems_version: 3.5.16
|
|
522
|
+
signing_key:
|
|
504
523
|
specification_version: 4
|
|
505
524
|
summary: A toolkit of support libraries and Ruby core extensions extracted from the
|
|
506
525
|
Rails framework.
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
class Range
|
|
4
|
-
# Returns the sole item in the range. If there are no items, or more
|
|
5
|
-
# than one item, raises Enumerable::SoleItemExpectedError.
|
|
6
|
-
#
|
|
7
|
-
# (1..1).sole # => 1
|
|
8
|
-
# (2..1).sole # => Enumerable::SoleItemExpectedError: no item found
|
|
9
|
-
# (..1).sole # => Enumerable::SoleItemExpectedError: infinite range cannot represent a sole item
|
|
10
|
-
def sole
|
|
11
|
-
if self.begin.nil? || self.end.nil?
|
|
12
|
-
raise ActiveSupport::EnumerableCoreExt::SoleItemExpectedError, "infinite range '#{inspect}' cannot represent a sole item"
|
|
13
|
-
end
|
|
14
|
-
|
|
15
|
-
super
|
|
16
|
-
end
|
|
17
|
-
end
|