activesupport 8.1.0.beta1 → 8.1.0.rc1
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 +91 -0
- data/lib/active_support/callbacks.rb +20 -8
- data/lib/active_support/concurrency/load_interlock_aware_monitor.rb +8 -62
- data/lib/active_support/concurrency/thread_monitor.rb +55 -0
- data/lib/active_support/core_ext/array.rb +7 -7
- data/lib/active_support/core_ext/benchmark.rb +4 -11
- data/lib/active_support/core_ext/big_decimal.rb +1 -1
- data/lib/active_support/core_ext/class/attribute.rb +8 -6
- data/lib/active_support/core_ext/class.rb +2 -2
- data/lib/active_support/core_ext/date.rb +5 -5
- data/lib/active_support/core_ext/date_and_time/compatibility.rb +0 -35
- data/lib/active_support/core_ext/date_time/compatibility.rb +3 -5
- data/lib/active_support/core_ext/date_time.rb +5 -5
- data/lib/active_support/core_ext/digest.rb +1 -1
- data/lib/active_support/core_ext/enumerable.rb +2 -2
- data/lib/active_support/core_ext/file.rb +1 -1
- data/lib/active_support/core_ext/hash.rb +8 -8
- data/lib/active_support/core_ext/integer.rb +3 -3
- data/lib/active_support/core_ext/kernel.rb +3 -3
- data/lib/active_support/core_ext/module.rb +11 -11
- data/lib/active_support/core_ext/numeric.rb +3 -3
- data/lib/active_support/core_ext/object.rb +13 -13
- data/lib/active_support/core_ext/pathname.rb +2 -2
- data/lib/active_support/core_ext/range.rb +4 -4
- data/lib/active_support/core_ext/string.rb +13 -13
- data/lib/active_support/core_ext/symbol.rb +1 -1
- data/lib/active_support/core_ext/time/calculations.rb +0 -7
- data/lib/active_support/core_ext/time/compatibility.rb +2 -27
- data/lib/active_support/core_ext/time.rb +5 -5
- data/lib/active_support/core_ext.rb +1 -1
- data/lib/active_support/dependencies/interlock.rb +11 -5
- data/lib/active_support/dependencies.rb +6 -1
- data/lib/active_support/event_reporter.rb +24 -2
- data/lib/active_support/file_update_checker.rb +1 -1
- data/lib/active_support/gem_version.rb +1 -1
- data/lib/active_support/isolated_execution_state.rb +5 -2
- data/lib/active_support/json/encoding.rb +48 -19
- data/lib/active_support/log_subscriber.rb +0 -6
- data/lib/active_support/notifications/fanout.rb +64 -42
- data/lib/active_support/notifications/instrumenter.rb +1 -1
- data/lib/active_support/railtie.rb +7 -4
- data/lib/active_support/structured_event_subscriber.rb +99 -0
- data/lib/active_support/subscriber.rb +0 -5
- data/lib/active_support/testing/event_reporter_assertions.rb +11 -1
- data/lib/active_support/testing/parallelization/server.rb +15 -2
- data/lib/active_support/testing/parallelization/worker.rb +2 -2
- data/lib/active_support/testing/parallelization.rb +12 -1
- data/lib/active_support/time_with_zone.rb +3 -17
- data/lib/active_support/xml_mini.rb +2 -0
- data/lib/active_support.rb +12 -14
- metadata +18 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ab7cfa334a0bc8625d55751ca00b48413bf59fe7a6d1149bd49681440e6abedc
|
4
|
+
data.tar.gz: 3226131e956e78cfb076ec13e955cc319166b0d160d09cc8a50c8f53ef077dc3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2ed3e83370a5e41d1206061c247e72717fefc12e022c3d77781136cdf009f2b68dce1f2ab7182d6996a0f26d6904e7279e8f66d2231f46b130850c2b681d89b5
|
7
|
+
data.tar.gz: d57d508c21d3d33c9c5e8ba68ece34c33bf5f81cc053f434ec8e31ce00612724f0e1fd3a2a680abe4d664a6ffcd8bfe8a9ff547bc6c75a38f5d8054697104146
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,94 @@
|
|
1
|
+
## Rails 8.1.0.rc1 (October 15, 2025) ##
|
2
|
+
|
3
|
+
* Remove deprecated passing a Time object to `Time#since`.
|
4
|
+
|
5
|
+
*Rafael Mendonça França*
|
6
|
+
|
7
|
+
* Remove deprecated `Benchmark.ms` method. It is now defined in the `benchmark` gem.
|
8
|
+
|
9
|
+
*Rafael Mendonça França*
|
10
|
+
|
11
|
+
* Remove deprecated addition for `Time` instances with `ActiveSupport::TimeWithZone`.
|
12
|
+
|
13
|
+
*Rafael Mendonça França*
|
14
|
+
|
15
|
+
* Remove deprecated support for `to_time` to preserve the system local time. It will now always preserve the receiver
|
16
|
+
timezone.
|
17
|
+
|
18
|
+
*Rafael Mendonça França*
|
19
|
+
|
20
|
+
* Deprecate `config.active_support.to_time_preserves_timezone`.
|
21
|
+
|
22
|
+
*Rafael Mendonça França*
|
23
|
+
|
24
|
+
* Standardize event name formatting in `assert_event_reported` error messages.
|
25
|
+
|
26
|
+
The event name in failure messages now uses `.inspect` (e.g., `name: "user.created"`)
|
27
|
+
to match `assert_events_reported` and provide type clarity between strings and symbols.
|
28
|
+
This only affects tests that assert on the failure message format itself.
|
29
|
+
|
30
|
+
*George Ma*
|
31
|
+
|
32
|
+
* Fix `Enumerable#sole` to return the full tuple instead of just the first element of the tuple.
|
33
|
+
|
34
|
+
*Olivier Bellone*
|
35
|
+
|
36
|
+
* Fix parallel tests hanging when worker processes die abruptly.
|
37
|
+
|
38
|
+
Previously, if a worker process was killed (e.g., OOM killed, `kill -9`) during parallel
|
39
|
+
test execution, the test suite would hang forever waiting for the dead worker.
|
40
|
+
|
41
|
+
*Joshua Young*
|
42
|
+
|
43
|
+
* Add `config.active_support.escape_js_separators_in_json`.
|
44
|
+
|
45
|
+
Introduce a new framework default to skip escaping LINE SEPARATOR (U+2028) and PARAGRAPH SEPARATOR (U+2029) in JSON.
|
46
|
+
|
47
|
+
Historically these characters were not valid inside JavaScript literal strings but that changed in ECMAScript 2019.
|
48
|
+
As such it's no longer a concern in modern browsers: https://caniuse.com/mdn-javascript_builtins_json_json_superset.
|
49
|
+
|
50
|
+
*Étienne Barrié*, *Jean Boussier*
|
51
|
+
|
52
|
+
* Fix `NameError` when `class_attribute` is defined on instance singleton classes.
|
53
|
+
|
54
|
+
Previously, calling `class_attribute` on an instance's singleton class would raise
|
55
|
+
a `NameError` when accessing the attribute through the instance.
|
56
|
+
|
57
|
+
```ruby
|
58
|
+
object = MyClass.new
|
59
|
+
object.singleton_class.class_attribute :foo, default: "bar"
|
60
|
+
object.foo # previously raised NameError, now returns "bar"
|
61
|
+
```
|
62
|
+
|
63
|
+
*Joshua Young*
|
64
|
+
|
65
|
+
* Introduce `ActiveSupport::Testing::EventReporterAssertions#with_debug_event_reporting`
|
66
|
+
to enable event reporter debug mode in tests.
|
67
|
+
|
68
|
+
The previous way to enable debug mode is by using `#with_debug` on the
|
69
|
+
event reporter itself, which is too verbose. This new helper will help
|
70
|
+
clear up any confusion on how to test debug events.
|
71
|
+
|
72
|
+
*Gannon McGibbon*
|
73
|
+
|
74
|
+
* Add `ActiveSupport::StructuredEventSubscriber` for consuming notifications and
|
75
|
+
emitting structured event logs. Events may be emitted with the `#emit_event`
|
76
|
+
or `#emit_debug_event` methods.
|
77
|
+
|
78
|
+
```ruby
|
79
|
+
class MyStructuredEventSubscriber < ActiveSupport::StructuredEventSubscriber
|
80
|
+
def notification(event)
|
81
|
+
emit_event("my.notification", data: 1)
|
82
|
+
end
|
83
|
+
end
|
84
|
+
```
|
85
|
+
|
86
|
+
*Adrianna Chang*
|
87
|
+
|
88
|
+
* `ActiveSupport::FileUpdateChecker` does not depend on `Time.now` to prevent unecessary reloads with time travel test helpers
|
89
|
+
|
90
|
+
*Jan Grodowski*
|
91
|
+
|
1
92
|
## Rails 8.1.0.beta1 (September 04, 2025) ##
|
2
93
|
|
3
94
|
* Add `ActiveSupport::Cache::Store#namespace=` and `#namespace`.
|
@@ -4,6 +4,7 @@ require "active_support/concern"
|
|
4
4
|
require "active_support/descendants_tracker"
|
5
5
|
require "active_support/core_ext/array/extract_options"
|
6
6
|
require "active_support/core_ext/class/attribute"
|
7
|
+
require "active_support/core_ext/module/redefine_method"
|
7
8
|
require "active_support/core_ext/string/filters"
|
8
9
|
require "active_support/core_ext/object/blank"
|
9
10
|
|
@@ -573,7 +574,7 @@ module ActiveSupport
|
|
573
574
|
@name = name
|
574
575
|
@config = {
|
575
576
|
scope: [:kind],
|
576
|
-
terminator:
|
577
|
+
terminator: DEFAULT_TERMINATOR
|
577
578
|
}.merge!(config)
|
578
579
|
@chain = []
|
579
580
|
@all_callbacks = nil
|
@@ -661,8 +662,8 @@ module ActiveSupport
|
|
661
662
|
@chain.delete_if { |c| callback.duplicates?(c) }
|
662
663
|
end
|
663
664
|
|
664
|
-
|
665
|
-
|
665
|
+
class DefaultTerminator # :nodoc:
|
666
|
+
def call(target, result_lambda)
|
666
667
|
terminate = true
|
667
668
|
catch(:abort) do
|
668
669
|
result_lambda.call
|
@@ -671,6 +672,7 @@ module ActiveSupport
|
|
671
672
|
terminate
|
672
673
|
end
|
673
674
|
end
|
675
|
+
DEFAULT_TERMINATOR = DefaultTerminator.new.freeze
|
674
676
|
end
|
675
677
|
|
676
678
|
module ClassMethods
|
@@ -904,12 +906,13 @@ module ActiveSupport
|
|
904
906
|
names.each do |name|
|
905
907
|
name = name.to_sym
|
906
908
|
|
907
|
-
([self] + self.descendants).each do |target|
|
908
|
-
target.set_callbacks name, CallbackChain.new(name, options)
|
909
|
-
end
|
910
|
-
|
911
909
|
module_eval <<-RUBY, __FILE__, __LINE__ + 1
|
912
|
-
def _run_#{name}_callbacks
|
910
|
+
def _run_#{name}_callbacks
|
911
|
+
yield if block_given?
|
912
|
+
end
|
913
|
+
silence_redefinition_of_method(:_run_#{name}_callbacks)
|
914
|
+
|
915
|
+
def _run_#{name}_callbacks!(&block)
|
913
916
|
run_callbacks #{name.inspect}, &block
|
914
917
|
end
|
915
918
|
|
@@ -925,6 +928,10 @@ module ActiveSupport
|
|
925
928
|
__callbacks[#{name.inspect}]
|
926
929
|
end
|
927
930
|
RUBY
|
931
|
+
|
932
|
+
([self] + self.descendants).each do |target|
|
933
|
+
target.set_callbacks name, CallbackChain.new(name, options)
|
934
|
+
end
|
928
935
|
end
|
929
936
|
end
|
930
937
|
|
@@ -940,6 +947,11 @@ module ActiveSupport
|
|
940
947
|
unless singleton_class.private_method_defined?(:__class_attr__callbacks, false)
|
941
948
|
self.__callbacks = __callbacks.dup
|
942
949
|
end
|
950
|
+
name = name.to_sym
|
951
|
+
callbacks_was = self.__callbacks[name.to_sym]
|
952
|
+
if (callbacks_was.nil? || callbacks_was.empty?) && !callbacks.empty?
|
953
|
+
alias_method("_run_#{name}_callbacks", "_run_#{name}_callbacks!")
|
954
|
+
end
|
943
955
|
self.__callbacks[name.to_sym] = callbacks
|
944
956
|
self.__callbacks
|
945
957
|
end
|
@@ -4,69 +4,15 @@ require "monitor"
|
|
4
4
|
|
5
5
|
module ActiveSupport
|
6
6
|
module Concurrency
|
7
|
-
module LoadInterlockAwareMonitorMixin # :nodoc:
|
8
|
-
EXCEPTION_NEVER = { Exception => :never }.freeze
|
9
|
-
EXCEPTION_IMMEDIATE = { Exception => :immediate }.freeze
|
10
|
-
private_constant :EXCEPTION_NEVER, :EXCEPTION_IMMEDIATE
|
11
|
-
|
12
|
-
# Enters an exclusive section, but allows dependency loading while blocked
|
13
|
-
def mon_enter
|
14
|
-
mon_try_enter ||
|
15
|
-
ActiveSupport::Dependencies.interlock.permit_concurrent_loads { super }
|
16
|
-
end
|
17
|
-
|
18
|
-
def synchronize(&block)
|
19
|
-
Thread.handle_interrupt(EXCEPTION_NEVER) do
|
20
|
-
mon_enter
|
21
|
-
|
22
|
-
begin
|
23
|
-
Thread.handle_interrupt(EXCEPTION_IMMEDIATE, &block)
|
24
|
-
ensure
|
25
|
-
mon_exit
|
26
|
-
end
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
30
7
|
# A monitor that will permit dependency loading while blocked waiting for
|
31
8
|
# the lock.
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
@owner = nil
|
41
|
-
@count = 0
|
42
|
-
@mutex = Mutex.new
|
43
|
-
end
|
44
|
-
|
45
|
-
private
|
46
|
-
def mon_try_enter
|
47
|
-
if @owner != Thread.current
|
48
|
-
return false unless @mutex.try_lock
|
49
|
-
@owner = Thread.current
|
50
|
-
end
|
51
|
-
@count += 1
|
52
|
-
end
|
53
|
-
|
54
|
-
def mon_enter
|
55
|
-
@mutex.lock if @owner != Thread.current
|
56
|
-
@owner = Thread.current
|
57
|
-
@count += 1
|
58
|
-
end
|
59
|
-
|
60
|
-
def mon_exit
|
61
|
-
unless @owner == Thread.current
|
62
|
-
raise ThreadError, "current thread not owner"
|
63
|
-
end
|
64
|
-
|
65
|
-
@count -= 1
|
66
|
-
return unless @count == 0
|
67
|
-
@owner = nil
|
68
|
-
@mutex.unlock
|
69
|
-
end
|
70
|
-
end
|
9
|
+
LoadInterlockAwareMonitor = ActiveSupport::Deprecation::DeprecatedConstantProxy.new(
|
10
|
+
"ActiveSupport::Concurrency::LoadInterlockAwareMonitor",
|
11
|
+
"::Monitor",
|
12
|
+
ActiveSupport.deprecator,
|
13
|
+
message: "ActiveSupport::Concurrency::LoadInterlockAwareMonitor is deprecated and will be " \
|
14
|
+
"removed in Rails 9.0. Use Monitor directly instead, as the loading interlock is " \
|
15
|
+
"no longer used."
|
16
|
+
)
|
71
17
|
end
|
72
18
|
end
|
@@ -0,0 +1,55 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module ActiveSupport
|
4
|
+
module Concurrency
|
5
|
+
class ThreadMonitor # :nodoc:
|
6
|
+
EXCEPTION_NEVER = { Exception => :never }.freeze
|
7
|
+
EXCEPTION_IMMEDIATE = { Exception => :immediate }.freeze
|
8
|
+
private_constant :EXCEPTION_NEVER, :EXCEPTION_IMMEDIATE
|
9
|
+
|
10
|
+
def initialize
|
11
|
+
@owner = nil
|
12
|
+
@count = 0
|
13
|
+
@mutex = Mutex.new
|
14
|
+
end
|
15
|
+
|
16
|
+
def synchronize(&block)
|
17
|
+
Thread.handle_interrupt(EXCEPTION_NEVER) do
|
18
|
+
mon_enter
|
19
|
+
|
20
|
+
begin
|
21
|
+
Thread.handle_interrupt(EXCEPTION_IMMEDIATE, &block)
|
22
|
+
ensure
|
23
|
+
mon_exit
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
private
|
29
|
+
def mon_try_enter
|
30
|
+
if @owner != Thread.current
|
31
|
+
return false unless @mutex.try_lock
|
32
|
+
@owner = Thread.current
|
33
|
+
end
|
34
|
+
@count += 1
|
35
|
+
end
|
36
|
+
|
37
|
+
def mon_enter
|
38
|
+
@mutex.lock if @owner != Thread.current
|
39
|
+
@owner = Thread.current
|
40
|
+
@count += 1
|
41
|
+
end
|
42
|
+
|
43
|
+
def mon_exit
|
44
|
+
unless @owner == Thread.current
|
45
|
+
raise ThreadError, "current thread not owner"
|
46
|
+
end
|
47
|
+
|
48
|
+
@count -= 1
|
49
|
+
return unless @count == 0
|
50
|
+
@owner = nil
|
51
|
+
@mutex.unlock
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
@@ -1,9 +1,9 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
3
|
+
require_relative "array/wrap"
|
4
|
+
require_relative "array/access"
|
5
|
+
require_relative "array/conversions"
|
6
|
+
require_relative "array/extract"
|
7
|
+
require_relative "array/extract_options"
|
8
|
+
require_relative "array/grouping"
|
9
|
+
require_relative "array/inquiry"
|
@@ -1,13 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
# NOTE: Please also remove the Active Support `benchmark` dependency when removing this
|
8
|
-
ActiveSupport.deprecator.warn <<~TEXT
|
9
|
-
`Benchmark.ms` is deprecated and will be removed in Rails 8.1 without replacement.
|
10
|
-
TEXT
|
11
|
-
ActiveSupport::Benchmark.realtime(:float_millisecond, &block)
|
12
|
-
end
|
13
|
-
end
|
3
|
+
# Remove this file from activesupport/lib/active_support/core_ext.rb when deleting the deprecation.
|
4
|
+
ActiveSupport.deprecator.warn <<~TEXT
|
5
|
+
active_support/core_ext/benchmark.rb is deprecated and will be removed in Rails 8.2 without replacement.
|
6
|
+
TEXT
|
@@ -96,14 +96,16 @@ class Class
|
|
96
96
|
namespaced_name = :"__class_attr_#{name}"
|
97
97
|
::ActiveSupport::ClassAttribute.redefine(self, name, namespaced_name, default)
|
98
98
|
|
99
|
-
|
100
|
-
|
101
|
-
"def #{name}=(value); self.#{namespaced_name} = value; end",
|
102
|
-
]
|
99
|
+
class_methods << "def #{name}; #{namespaced_name}; end"
|
100
|
+
class_methods << "def #{name}=(value); self.#{namespaced_name} = value; end"
|
103
101
|
|
104
|
-
class_methods.concat(delegators)
|
105
102
|
if singleton_class?
|
106
|
-
methods
|
103
|
+
methods << <<~RUBY if instance_reader
|
104
|
+
silence_redefinition_of_method(:#{name})
|
105
|
+
def #{name}
|
106
|
+
self.singleton_class.#{name}
|
107
|
+
end
|
108
|
+
RUBY
|
107
109
|
else
|
108
110
|
methods << <<~RUBY if instance_reader
|
109
111
|
silence_redefinition_of_method def #{name}
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
3
|
+
require_relative "date/acts_like"
|
4
|
+
require_relative "date/blank"
|
5
|
+
require_relative "date/calculations"
|
6
|
+
require_relative "date/conversions"
|
7
|
+
require_relative "date/zones"
|
@@ -5,41 +5,6 @@ require "active_support/core_ext/module/redefine_method"
|
|
5
5
|
|
6
6
|
module DateAndTime
|
7
7
|
module Compatibility
|
8
|
-
# If true, +to_time+ preserves the timezone offset of receiver.
|
9
|
-
#
|
10
|
-
# NOTE: With Ruby 2.4+ the default for +to_time+ changed from
|
11
|
-
# converting to the local system time, to preserving the offset
|
12
|
-
# of the receiver. For backwards compatibility we're overriding
|
13
|
-
# this behavior, but new apps will have an initializer that sets
|
14
|
-
# this to true, because the new behavior is preferred.
|
15
|
-
mattr_accessor :preserve_timezone, instance_accessor: false, default: nil
|
16
|
-
|
17
|
-
singleton_class.silence_redefinition_of_method :preserve_timezone
|
18
|
-
|
19
|
-
#--
|
20
|
-
# This re-implements the behavior of the mattr_reader, instead
|
21
|
-
# of prepending on to it, to avoid overcomplicating a module that
|
22
|
-
# is in turn included in several places. This will all go away in
|
23
|
-
# Rails 8.0 anyway.
|
24
|
-
def self.preserve_timezone # :nodoc:
|
25
|
-
if @@preserve_timezone.nil?
|
26
|
-
# Only warn once, the first time the value is used (which should
|
27
|
-
# be the first time #to_time is called).
|
28
|
-
ActiveSupport.deprecator.warn(
|
29
|
-
"`to_time` will always preserve the receiver timezone rather than system local time in Rails 8.1." \
|
30
|
-
"To opt in to the new behavior, set `config.active_support.to_time_preserves_timezone = :zone`."
|
31
|
-
)
|
32
|
-
|
33
|
-
@@preserve_timezone = false
|
34
|
-
end
|
35
|
-
|
36
|
-
@@preserve_timezone
|
37
|
-
end
|
38
|
-
|
39
|
-
def preserve_timezone # :nodoc:
|
40
|
-
Compatibility.preserve_timezone
|
41
|
-
end
|
42
|
-
|
43
8
|
# Change the output of <tt>ActiveSupport::TimeZone.utc_to_local</tt>.
|
44
9
|
#
|
45
10
|
# When +true+, it returns local times with a UTC offset, with +false+ local
|
@@ -8,11 +8,9 @@ class DateTime
|
|
8
8
|
|
9
9
|
silence_redefinition_of_method :to_time
|
10
10
|
|
11
|
-
#
|
12
|
-
# as +self
|
13
|
-
# in the local system timezone depending on the setting of
|
14
|
-
# on the setting of +ActiveSupport.to_time_preserves_timezone+.
|
11
|
+
# Return an instance of +Time+ with the same UTC offset
|
12
|
+
# as +self+.
|
15
13
|
def to_time
|
16
|
-
|
14
|
+
getlocal(utc_offset)
|
17
15
|
end
|
18
16
|
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
3
|
+
require_relative "date_time/acts_like"
|
4
|
+
require_relative "date_time/blank"
|
5
|
+
require_relative "date_time/calculations"
|
6
|
+
require_relative "date_time/compatibility"
|
7
|
+
require_relative "date_time/conversions"
|
@@ -212,12 +212,12 @@ module Enumerable
|
|
212
212
|
result = nil
|
213
213
|
found = false
|
214
214
|
|
215
|
-
each do
|
215
|
+
each do |*element|
|
216
216
|
if found
|
217
217
|
raise SoleItemExpectedError, "multiple items found"
|
218
218
|
end
|
219
219
|
|
220
|
-
result = element
|
220
|
+
result = element.size == 1 ? element[0] : element
|
221
221
|
found = true
|
222
222
|
end
|
223
223
|
|
@@ -1,10 +1,10 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
3
|
+
require_relative "hash/conversions"
|
4
|
+
require_relative "hash/deep_merge"
|
5
|
+
require_relative "hash/deep_transform_values"
|
6
|
+
require_relative "hash/except"
|
7
|
+
require_relative "hash/indifferent_access"
|
8
|
+
require_relative "hash/keys"
|
9
|
+
require_relative "hash/reverse_merge"
|
10
|
+
require_relative "hash/slice"
|
@@ -1,5 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
3
|
+
require_relative "integer/multiple"
|
4
|
+
require_relative "integer/inflections"
|
5
|
+
require_relative "integer/time"
|
@@ -1,5 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
3
|
+
require_relative "kernel/concern"
|
4
|
+
require_relative "kernel/reporting"
|
5
|
+
require_relative "kernel/singleton_class"
|
@@ -1,13 +1,13 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
3
|
+
require_relative "module/aliasing"
|
4
|
+
require_relative "module/introspection"
|
5
|
+
require_relative "module/anonymous"
|
6
|
+
require_relative "module/attribute_accessors"
|
7
|
+
require_relative "module/attribute_accessors_per_thread"
|
8
|
+
require_relative "module/attr_internal"
|
9
|
+
require_relative "module/concerning"
|
10
|
+
require_relative "module/delegation"
|
11
|
+
require_relative "module/deprecation"
|
12
|
+
require_relative "module/redefine_method"
|
13
|
+
require_relative "module/remove_method"
|
@@ -1,5 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
3
|
+
require_relative "numeric/bytes"
|
4
|
+
require_relative "numeric/time"
|
5
|
+
require_relative "numeric/conversions"
|
@@ -1,17 +1,17 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
3
|
+
require_relative "object/acts_like"
|
4
|
+
require_relative "object/blank"
|
5
|
+
require_relative "object/duplicable"
|
6
|
+
require_relative "object/deep_dup"
|
7
|
+
require_relative "object/try"
|
8
|
+
require_relative "object/inclusion"
|
9
9
|
|
10
|
-
|
11
|
-
|
10
|
+
require_relative "object/conversions"
|
11
|
+
require_relative "object/instance_variables"
|
12
12
|
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
13
|
+
require_relative "object/json"
|
14
|
+
require_relative "object/to_param"
|
15
|
+
require_relative "object/to_query"
|
16
|
+
require_relative "object/with"
|
17
|
+
require_relative "object/with_options"
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
3
|
+
require_relative "range/conversions"
|
4
|
+
require_relative "range/compare_range"
|
5
|
+
require_relative "range/overlap"
|
6
|
+
require_relative "range/sole"
|