activesupport 5.1.7 → 7.0.4.1
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of activesupport might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/CHANGELOG.md +259 -585
- data/MIT-LICENSE +1 -1
- data/README.rdoc +6 -5
- data/lib/active_support/actionable_error.rb +48 -0
- data/lib/active_support/all.rb +2 -0
- data/lib/active_support/array_inquirer.rb +4 -2
- data/lib/active_support/backtrace_cleaner.rb +33 -5
- data/lib/active_support/benchmarkable.rb +5 -3
- data/lib/active_support/builder.rb +2 -0
- data/lib/active_support/cache/file_store.rb +50 -43
- data/lib/active_support/cache/mem_cache_store.rb +194 -67
- data/lib/active_support/cache/memory_store.rb +70 -34
- data/lib/active_support/cache/null_store.rb +18 -3
- data/lib/active_support/cache/redis_cache_store.rb +474 -0
- data/lib/active_support/cache/strategy/local_cache.rb +73 -50
- data/lib/active_support/cache/strategy/local_cache_middleware.rb +2 -0
- data/lib/active_support/cache.rb +556 -220
- data/lib/active_support/callbacks.rb +264 -159
- data/lib/active_support/code_generator.rb +65 -0
- data/lib/active_support/concern.rb +81 -8
- data/lib/active_support/concurrency/load_interlock_aware_monitor.rb +16 -0
- data/lib/active_support/concurrency/share_lock.rb +4 -3
- data/lib/active_support/configurable.rb +17 -16
- data/lib/active_support/configuration_file.rb +51 -0
- data/lib/active_support/core_ext/array/access.rb +18 -8
- data/lib/active_support/core_ext/array/conversions.rb +20 -17
- data/lib/active_support/core_ext/array/deprecated_conversions.rb +25 -0
- data/lib/active_support/core_ext/array/extract.rb +21 -0
- data/lib/active_support/core_ext/array/extract_options.rb +2 -0
- data/lib/active_support/core_ext/array/grouping.rb +8 -6
- data/lib/active_support/core_ext/array/inquiry.rb +4 -2
- data/lib/active_support/core_ext/array/wrap.rb +2 -0
- data/lib/active_support/core_ext/array.rb +4 -1
- data/lib/active_support/core_ext/benchmark.rb +4 -2
- data/lib/active_support/core_ext/big_decimal/conversions.rb +3 -1
- data/lib/active_support/core_ext/big_decimal.rb +2 -0
- data/lib/active_support/core_ext/class/attribute.rb +50 -47
- data/lib/active_support/core_ext/class/attribute_accessors.rb +2 -0
- data/lib/active_support/core_ext/class/subclasses.rb +10 -24
- data/lib/active_support/core_ext/class.rb +2 -0
- data/lib/active_support/core_ext/date/acts_like.rb +2 -0
- data/lib/active_support/core_ext/date/blank.rb +3 -1
- data/lib/active_support/core_ext/date/calculations.rb +17 -14
- data/lib/active_support/core_ext/date/conversions.rb +24 -22
- data/lib/active_support/core_ext/date/deprecated_conversions.rb +26 -0
- data/lib/active_support/core_ext/date/zones.rb +2 -0
- data/lib/active_support/core_ext/date.rb +3 -0
- data/lib/active_support/core_ext/date_and_time/calculations.rb +65 -41
- data/lib/active_support/core_ext/date_and_time/compatibility.rb +18 -1
- data/lib/active_support/core_ext/date_and_time/zones.rb +2 -1
- data/lib/active_support/core_ext/date_time/acts_like.rb +2 -0
- data/lib/active_support/core_ext/date_time/blank.rb +3 -1
- data/lib/active_support/core_ext/date_time/calculations.rb +3 -1
- data/lib/active_support/core_ext/date_time/compatibility.rb +7 -5
- data/lib/active_support/core_ext/date_time/conversions.rb +15 -14
- data/lib/active_support/core_ext/date_time/deprecated_conversions.rb +22 -0
- data/lib/active_support/core_ext/date_time.rb +3 -0
- data/lib/active_support/core_ext/digest/uuid.rb +42 -14
- data/lib/active_support/core_ext/digest.rb +3 -0
- data/lib/active_support/core_ext/enumerable.rb +244 -72
- data/lib/active_support/core_ext/file/atomic.rb +6 -2
- data/lib/active_support/core_ext/file.rb +2 -0
- data/lib/active_support/core_ext/hash/conversions.rb +7 -6
- data/lib/active_support/core_ext/hash/deep_merge.rb +8 -12
- data/lib/active_support/core_ext/hash/deep_transform_values.rb +46 -0
- data/lib/active_support/core_ext/hash/except.rb +4 -2
- data/lib/active_support/core_ext/hash/indifferent_access.rb +5 -3
- data/lib/active_support/core_ext/hash/keys.rb +4 -31
- data/lib/active_support/core_ext/hash/reverse_merge.rb +5 -2
- data/lib/active_support/core_ext/hash/slice.rb +8 -29
- data/lib/active_support/core_ext/hash.rb +3 -2
- data/lib/active_support/core_ext/integer/inflections.rb +2 -0
- data/lib/active_support/core_ext/integer/multiple.rb +3 -1
- data/lib/active_support/core_ext/integer/time.rb +7 -14
- data/lib/active_support/core_ext/integer.rb +2 -0
- data/lib/active_support/core_ext/kernel/concern.rb +2 -0
- data/lib/active_support/core_ext/kernel/reporting.rb +6 -4
- data/lib/active_support/core_ext/kernel/singleton_class.rb +3 -1
- data/lib/active_support/core_ext/kernel.rb +2 -1
- data/lib/active_support/core_ext/load_error.rb +3 -8
- data/lib/active_support/core_ext/module/aliasing.rb +2 -0
- data/lib/active_support/core_ext/module/anonymous.rb +2 -0
- data/lib/active_support/core_ext/module/attr_internal.rb +4 -2
- data/lib/active_support/core_ext/module/attribute_accessors.rb +46 -56
- data/lib/active_support/core_ext/module/attribute_accessors_per_thread.rb +36 -27
- data/lib/active_support/core_ext/module/concerning.rb +15 -10
- data/lib/active_support/core_ext/module/delegation.rb +97 -58
- data/lib/active_support/core_ext/module/deprecation.rb +2 -0
- data/lib/active_support/core_ext/module/introspection.rb +18 -15
- data/lib/active_support/core_ext/module/redefine_method.rb +40 -0
- data/lib/active_support/core_ext/module/remove_method.rb +5 -23
- data/lib/active_support/core_ext/module.rb +3 -1
- data/lib/active_support/core_ext/name_error.rb +30 -2
- data/lib/active_support/core_ext/numeric/bytes.rb +2 -0
- data/lib/active_support/core_ext/numeric/conversions.rb +134 -129
- data/lib/active_support/core_ext/numeric/deprecated_conversions.rb +60 -0
- data/lib/active_support/core_ext/numeric/time.rb +7 -15
- data/lib/active_support/core_ext/numeric.rb +3 -1
- data/lib/active_support/core_ext/object/acts_like.rb +41 -6
- data/lib/active_support/core_ext/object/blank.rb +15 -5
- data/lib/active_support/core_ext/object/conversions.rb +2 -0
- data/lib/active_support/core_ext/object/deep_dup.rb +3 -1
- data/lib/active_support/core_ext/object/duplicable.rb +16 -110
- data/lib/active_support/core_ext/object/inclusion.rb +2 -0
- data/lib/active_support/core_ext/object/instance_variables.rb +2 -0
- data/lib/active_support/core_ext/object/json.rb +51 -26
- data/lib/active_support/core_ext/object/to_param.rb +2 -0
- data/lib/active_support/core_ext/object/to_query.rb +4 -2
- data/lib/active_support/core_ext/object/try.rb +26 -14
- data/lib/active_support/core_ext/object/with_options.rb +24 -3
- data/lib/active_support/core_ext/object.rb +2 -0
- data/lib/active_support/core_ext/pathname/existence.rb +21 -0
- data/lib/active_support/core_ext/pathname.rb +3 -0
- data/lib/active_support/core_ext/range/compare_range.rb +57 -0
- data/lib/active_support/core_ext/range/conversions.rb +35 -25
- data/lib/active_support/core_ext/range/deprecated_conversions.rb +26 -0
- data/lib/active_support/core_ext/range/each.rb +6 -3
- data/lib/active_support/core_ext/range/include_time_with_zone.rb +7 -0
- data/lib/active_support/core_ext/range/overlaps.rb +3 -1
- data/lib/active_support/core_ext/range.rb +4 -1
- data/lib/active_support/core_ext/regexp.rb +10 -5
- data/lib/active_support/core_ext/securerandom.rb +25 -3
- data/lib/active_support/core_ext/string/access.rb +7 -16
- data/lib/active_support/core_ext/string/behavior.rb +2 -0
- data/lib/active_support/core_ext/string/conversions.rb +5 -2
- data/lib/active_support/core_ext/string/exclude.rb +2 -0
- data/lib/active_support/core_ext/string/filters.rb +44 -1
- data/lib/active_support/core_ext/string/indent.rb +2 -0
- data/lib/active_support/core_ext/string/inflections.rb +69 -16
- data/lib/active_support/core_ext/string/inquiry.rb +4 -1
- data/lib/active_support/core_ext/string/multibyte.rb +9 -4
- data/lib/active_support/core_ext/string/output_safety.rb +135 -27
- data/lib/active_support/core_ext/string/starts_ends_with.rb +4 -2
- data/lib/active_support/core_ext/string/strip.rb +5 -1
- data/lib/active_support/core_ext/string/zones.rb +2 -0
- data/lib/active_support/core_ext/string.rb +2 -0
- data/lib/active_support/core_ext/symbol/starts_ends_with.rb +6 -0
- data/lib/active_support/core_ext/symbol.rb +3 -0
- data/lib/active_support/core_ext/time/acts_like.rb +2 -0
- data/lib/active_support/core_ext/time/calculations.rb +81 -24
- data/lib/active_support/core_ext/time/compatibility.rb +4 -2
- data/lib/active_support/core_ext/time/conversions.rb +17 -12
- data/lib/active_support/core_ext/time/deprecated_conversions.rb +22 -0
- data/lib/active_support/core_ext/time/zones.rb +12 -25
- data/lib/active_support/core_ext/time.rb +3 -0
- data/lib/active_support/core_ext/uri.rb +4 -23
- data/lib/active_support/core_ext.rb +4 -1
- data/lib/active_support/current_attributes/test_helper.rb +13 -0
- data/lib/active_support/current_attributes.rb +226 -0
- data/lib/active_support/dependencies/autoload.rb +2 -0
- data/lib/active_support/dependencies/interlock.rb +12 -18
- data/lib/active_support/dependencies/require_dependency.rb +28 -0
- data/lib/active_support/dependencies.rb +59 -715
- data/lib/active_support/deprecation/behaviors.rb +48 -13
- data/lib/active_support/deprecation/constant_accessor.rb +4 -2
- data/lib/active_support/deprecation/disallowed.rb +56 -0
- data/lib/active_support/deprecation/instance_delegator.rb +2 -1
- data/lib/active_support/deprecation/method_wrappers.rb +29 -21
- data/lib/active_support/deprecation/proxy_wrappers.rb +34 -8
- data/lib/active_support/deprecation/reporting.rb +54 -9
- data/lib/active_support/deprecation.rb +10 -3
- data/lib/active_support/descendants_tracker.rb +192 -34
- data/lib/active_support/digest.rb +22 -0
- data/lib/active_support/duration/iso8601_parser.rb +9 -9
- data/lib/active_support/duration/iso8601_serializer.rb +29 -15
- data/lib/active_support/duration.rb +158 -72
- data/lib/active_support/encrypted_configuration.rb +56 -0
- data/lib/active_support/encrypted_file.rb +129 -0
- data/lib/active_support/environment_inquirer.rb +20 -0
- data/lib/active_support/error_reporter.rb +117 -0
- data/lib/active_support/evented_file_update_checker.rb +87 -122
- data/lib/active_support/execution_context/test_helper.rb +13 -0
- data/lib/active_support/execution_context.rb +53 -0
- data/lib/active_support/execution_wrapper.rb +46 -21
- data/lib/active_support/executor/test_helper.rb +7 -0
- data/lib/active_support/executor.rb +2 -0
- data/lib/active_support/file_update_checker.rb +2 -1
- data/lib/active_support/fork_tracker.rb +71 -0
- data/lib/active_support/gem_version.rb +7 -5
- data/lib/active_support/gzip.rb +2 -0
- data/lib/active_support/hash_with_indifferent_access.rb +126 -42
- data/lib/active_support/html_safe_translation.rb +43 -0
- data/lib/active_support/i18n.rb +5 -1
- data/lib/active_support/i18n_railtie.rb +19 -14
- data/lib/active_support/inflections.rb +2 -0
- data/lib/active_support/inflector/inflections.rb +41 -14
- data/lib/active_support/inflector/methods.rb +73 -87
- data/lib/active_support/inflector/transliterate.rb +56 -18
- data/lib/active_support/inflector.rb +2 -0
- data/lib/active_support/isolated_execution_state.rb +72 -0
- data/lib/active_support/json/decoding.rb +27 -26
- data/lib/active_support/json/encoding.rb +16 -6
- data/lib/active_support/json.rb +2 -0
- data/lib/active_support/key_generator.rb +25 -38
- data/lib/active_support/lazy_load_hooks.rb +35 -6
- data/lib/active_support/locale/en.rb +33 -0
- data/lib/active_support/locale/en.yml +8 -4
- data/lib/active_support/log_subscriber/test_helper.rb +4 -2
- data/lib/active_support/log_subscriber.rb +54 -13
- data/lib/active_support/logger.rb +4 -17
- data/lib/active_support/logger_silence.rb +13 -20
- data/lib/active_support/logger_thread_safe_level.rb +48 -10
- data/lib/active_support/message_encryptor.rb +111 -37
- data/lib/active_support/message_verifier.rb +124 -21
- data/lib/active_support/messages/metadata.rb +80 -0
- data/lib/active_support/messages/rotation_configuration.rb +23 -0
- data/lib/active_support/messages/rotator.rb +57 -0
- data/lib/active_support/multibyte/chars.rb +19 -76
- data/lib/active_support/multibyte/unicode.rb +9 -331
- data/lib/active_support/multibyte.rb +3 -1
- data/lib/active_support/notifications/fanout.rb +165 -37
- data/lib/active_support/notifications/instrumenter.rb +92 -11
- data/lib/active_support/notifications.rb +96 -30
- data/lib/active_support/number_helper/number_converter.rb +8 -9
- data/lib/active_support/number_helper/number_to_currency_converter.rb +14 -12
- data/lib/active_support/number_helper/number_to_delimited_converter.rb +6 -3
- data/lib/active_support/number_helper/number_to_human_converter.rb +6 -3
- data/lib/active_support/number_helper/number_to_human_size_converter.rb +7 -4
- data/lib/active_support/number_helper/number_to_percentage_converter.rb +5 -1
- data/lib/active_support/number_helper/number_to_phone_converter.rb +6 -3
- data/lib/active_support/number_helper/number_to_rounded_converter.rb +14 -27
- data/lib/active_support/number_helper/rounding_helper.rb +16 -34
- data/lib/active_support/number_helper.rb +38 -12
- data/lib/active_support/option_merger.rb +19 -6
- data/lib/active_support/ordered_hash.rb +4 -2
- data/lib/active_support/ordered_options.rb +18 -6
- data/lib/active_support/parameter_filter.rb +138 -0
- data/lib/active_support/per_thread_registry.rb +8 -1
- data/lib/active_support/proxy_object.rb +2 -0
- data/lib/active_support/rails.rb +3 -10
- data/lib/active_support/railtie.rb +112 -11
- data/lib/active_support/reloader.rb +12 -11
- data/lib/active_support/rescuable.rb +19 -18
- data/lib/active_support/ruby_features.rb +7 -0
- data/lib/active_support/secure_compare_rotator.rb +51 -0
- data/lib/active_support/security_utils.rb +26 -15
- data/lib/active_support/string_inquirer.rb +4 -3
- data/lib/active_support/subscriber.rb +81 -42
- data/lib/active_support/tagged_logging.rb +45 -9
- data/lib/active_support/test_case.rb +86 -2
- data/lib/active_support/testing/assertions.rb +89 -21
- data/lib/active_support/testing/autorun.rb +2 -0
- data/lib/active_support/testing/constant_lookup.rb +2 -0
- data/lib/active_support/testing/declarative.rb +2 -0
- data/lib/active_support/testing/deprecation.rb +54 -2
- data/lib/active_support/testing/file_fixtures.rb +4 -0
- data/lib/active_support/testing/isolation.rb +6 -4
- data/lib/active_support/testing/method_call_assertions.rb +34 -5
- data/lib/active_support/testing/parallelization/server.rb +82 -0
- data/lib/active_support/testing/parallelization/worker.rb +103 -0
- data/lib/active_support/testing/parallelization.rb +55 -0
- data/lib/active_support/testing/parallelize_executor.rb +76 -0
- data/lib/active_support/testing/setup_and_teardown.rb +12 -7
- data/lib/active_support/testing/stream.rb +6 -7
- data/lib/active_support/testing/tagged_logging.rb +3 -1
- data/lib/active_support/testing/time_helpers.rb +91 -15
- data/lib/active_support/time.rb +2 -0
- data/lib/active_support/time_with_zone.rb +168 -56
- data/lib/active_support/values/time_zone.rb +85 -37
- data/lib/active_support/version.rb +3 -1
- data/lib/active_support/xml_mini/jdom.rb +6 -5
- data/lib/active_support/xml_mini/libxml.rb +9 -7
- data/lib/active_support/xml_mini/libxmlsax.rb +7 -5
- data/lib/active_support/xml_mini/nokogiri.rb +8 -6
- data/lib/active_support/xml_mini/nokogirisax.rb +6 -4
- data/lib/active_support/xml_mini/rexml.rb +13 -4
- data/lib/active_support/xml_mini.rb +10 -15
- data/lib/active_support.rb +30 -9
- metadata +76 -35
- data/lib/active_support/core_ext/array/prepend_and_append.rb +0 -7
- data/lib/active_support/core_ext/hash/compact.rb +0 -27
- data/lib/active_support/core_ext/hash/transform_values.rb +0 -30
- data/lib/active_support/core_ext/kernel/agnostics.rb +0 -11
- data/lib/active_support/core_ext/marshal.rb +0 -22
- data/lib/active_support/core_ext/module/reachable.rb +0 -8
- data/lib/active_support/core_ext/numeric/inquiry.rb +0 -26
- data/lib/active_support/core_ext/range/include_range.rb +0 -23
- data/lib/active_support/values/unicode_tables.dat +0 -0
data/lib/active_support.rb
CHANGED
@@ -1,5 +1,7 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
#--
|
2
|
-
# Copyright (c) 2005-
|
4
|
+
# Copyright (c) 2005-2022 David Heinemeier Hansson
|
3
5
|
#
|
4
6
|
# Permission is hereby granted, free of charge, to any person obtaining
|
5
7
|
# a copy of this software and associated documentation files (the
|
@@ -32,15 +34,25 @@ module ActiveSupport
|
|
32
34
|
extend ActiveSupport::Autoload
|
33
35
|
|
34
36
|
autoload :Concern
|
37
|
+
autoload :CodeGenerator
|
38
|
+
autoload :ActionableError
|
39
|
+
autoload :ConfigurationFile
|
40
|
+
autoload :CurrentAttributes
|
35
41
|
autoload :Dependencies
|
36
42
|
autoload :DescendantsTracker
|
43
|
+
autoload :ExecutionContext
|
37
44
|
autoload :ExecutionWrapper
|
38
45
|
autoload :Executor
|
46
|
+
autoload :ErrorReporter
|
39
47
|
autoload :FileUpdateChecker
|
40
48
|
autoload :EventedFileUpdateChecker
|
49
|
+
autoload :ForkTracker
|
41
50
|
autoload :LogSubscriber
|
51
|
+
autoload :IsolatedExecutionState
|
42
52
|
autoload :Notifications
|
43
53
|
autoload :Reloader
|
54
|
+
autoload :PerThreadRegistry
|
55
|
+
autoload :SecureCompareRotator
|
44
56
|
|
45
57
|
eager_autoload do
|
46
58
|
autoload :BacktraceCleaner
|
@@ -50,6 +62,7 @@ module ActiveSupport
|
|
50
62
|
autoload :Callbacks
|
51
63
|
autoload :Configurable
|
52
64
|
autoload :Deprecation
|
65
|
+
autoload :Digest
|
53
66
|
autoload :Gzip
|
54
67
|
autoload :Inflector
|
55
68
|
autoload :JSON
|
@@ -62,6 +75,7 @@ module ActiveSupport
|
|
62
75
|
autoload :OrderedHash
|
63
76
|
autoload :OrderedOptions
|
64
77
|
autoload :StringInquirer
|
78
|
+
autoload :EnvironmentInquirer
|
65
79
|
autoload :TaggedLogging
|
66
80
|
autoload :XmlMini
|
67
81
|
autoload :ArrayInquirer
|
@@ -78,17 +92,16 @@ module ActiveSupport
|
|
78
92
|
end
|
79
93
|
|
80
94
|
cattr_accessor :test_order # :nodoc:
|
95
|
+
cattr_accessor :test_parallelization_threshold, default: 50 # :nodoc:
|
96
|
+
|
97
|
+
singleton_class.attr_accessor :error_reporter # :nodoc:
|
81
98
|
|
82
|
-
def self.
|
83
|
-
|
84
|
-
ActiveSupport.halt_callback_chains_on_return_false is deprecated and will be removed in Rails 5.2.
|
85
|
-
MSG
|
99
|
+
def self.cache_format_version
|
100
|
+
Cache.format_version
|
86
101
|
end
|
87
102
|
|
88
|
-
def self.
|
89
|
-
|
90
|
-
ActiveSupport.halt_callback_chains_on_return_false= is deprecated and will be removed in Rails 5.2.
|
91
|
-
MSG
|
103
|
+
def self.cache_format_version=(value)
|
104
|
+
Cache.format_version = value
|
92
105
|
end
|
93
106
|
|
94
107
|
def self.to_time_preserves_timezone
|
@@ -98,6 +111,14 @@ module ActiveSupport
|
|
98
111
|
def self.to_time_preserves_timezone=(value)
|
99
112
|
DateAndTime::Compatibility.preserve_timezone = value
|
100
113
|
end
|
114
|
+
|
115
|
+
def self.utc_to_local_returns_utc_offset_times
|
116
|
+
DateAndTime::Compatibility.utc_to_local_returns_utc_offset_times
|
117
|
+
end
|
118
|
+
|
119
|
+
def self.utc_to_local_returns_utc_offset_times=(value)
|
120
|
+
DateAndTime::Compatibility.utc_to_local_returns_utc_offset_times = value
|
121
|
+
end
|
101
122
|
end
|
102
123
|
|
103
124
|
autoload :I18n, "active_support/i18n"
|
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:
|
4
|
+
version: 7.0.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Heinemeier Hansson
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-01-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: i18n
|
@@ -16,7 +16,7 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '1.6'
|
20
20
|
- - "<"
|
21
21
|
- !ruby/object:Gem::Version
|
22
22
|
version: '2'
|
@@ -26,7 +26,7 @@ dependencies:
|
|
26
26
|
requirements:
|
27
27
|
- - ">="
|
28
28
|
- !ruby/object:Gem::Version
|
29
|
-
version: '
|
29
|
+
version: '1.6'
|
30
30
|
- - "<"
|
31
31
|
- !ruby/object:Gem::Version
|
32
32
|
version: '2'
|
@@ -36,48 +36,48 @@ dependencies:
|
|
36
36
|
requirements:
|
37
37
|
- - "~>"
|
38
38
|
- !ruby/object:Gem::Version
|
39
|
-
version: '
|
39
|
+
version: '2.0'
|
40
40
|
type: :runtime
|
41
41
|
prerelease: false
|
42
42
|
version_requirements: !ruby/object:Gem::Requirement
|
43
43
|
requirements:
|
44
44
|
- - "~>"
|
45
45
|
- !ruby/object:Gem::Version
|
46
|
-
version: '
|
46
|
+
version: '2.0'
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
|
-
name:
|
48
|
+
name: concurrent-ruby
|
49
49
|
requirement: !ruby/object:Gem::Requirement
|
50
50
|
requirements:
|
51
51
|
- - "~>"
|
52
52
|
- !ruby/object:Gem::Version
|
53
|
-
version: '
|
53
|
+
version: '1.0'
|
54
|
+
- - ">="
|
55
|
+
- !ruby/object:Gem::Version
|
56
|
+
version: 1.0.2
|
54
57
|
type: :runtime
|
55
58
|
prerelease: false
|
56
59
|
version_requirements: !ruby/object:Gem::Requirement
|
57
60
|
requirements:
|
58
61
|
- - "~>"
|
59
62
|
- !ruby/object:Gem::Version
|
60
|
-
version: '
|
63
|
+
version: '1.0'
|
64
|
+
- - ">="
|
65
|
+
- !ruby/object:Gem::Version
|
66
|
+
version: 1.0.2
|
61
67
|
- !ruby/object:Gem::Dependency
|
62
|
-
name:
|
68
|
+
name: minitest
|
63
69
|
requirement: !ruby/object:Gem::Requirement
|
64
70
|
requirements:
|
65
|
-
- - "~>"
|
66
|
-
- !ruby/object:Gem::Version
|
67
|
-
version: '1.0'
|
68
71
|
- - ">="
|
69
72
|
- !ruby/object:Gem::Version
|
70
|
-
version: 1
|
73
|
+
version: '5.1'
|
71
74
|
type: :runtime
|
72
75
|
prerelease: false
|
73
76
|
version_requirements: !ruby/object:Gem::Requirement
|
74
77
|
requirements:
|
75
|
-
- - "~>"
|
76
|
-
- !ruby/object:Gem::Version
|
77
|
-
version: '1.0'
|
78
78
|
- - ">="
|
79
79
|
- !ruby/object:Gem::Version
|
80
|
-
version: 1
|
80
|
+
version: '5.1'
|
81
81
|
description: A toolkit of support libraries and Ruby core extensions extracted from
|
82
82
|
the Rails framework. Rich support for multibyte strings, internationalization, time
|
83
83
|
zones, and testing.
|
@@ -90,6 +90,7 @@ files:
|
|
90
90
|
- MIT-LICENSE
|
91
91
|
- README.rdoc
|
92
92
|
- lib/active_support.rb
|
93
|
+
- lib/active_support/actionable_error.rb
|
93
94
|
- lib/active_support/all.rb
|
94
95
|
- lib/active_support/array_inquirer.rb
|
95
96
|
- lib/active_support/backtrace_cleaner.rb
|
@@ -100,21 +101,25 @@ files:
|
|
100
101
|
- lib/active_support/cache/mem_cache_store.rb
|
101
102
|
- lib/active_support/cache/memory_store.rb
|
102
103
|
- lib/active_support/cache/null_store.rb
|
104
|
+
- lib/active_support/cache/redis_cache_store.rb
|
103
105
|
- lib/active_support/cache/strategy/local_cache.rb
|
104
106
|
- lib/active_support/cache/strategy/local_cache_middleware.rb
|
105
107
|
- lib/active_support/callbacks.rb
|
108
|
+
- lib/active_support/code_generator.rb
|
106
109
|
- lib/active_support/concern.rb
|
107
110
|
- lib/active_support/concurrency/load_interlock_aware_monitor.rb
|
108
111
|
- lib/active_support/concurrency/share_lock.rb
|
109
112
|
- lib/active_support/configurable.rb
|
113
|
+
- lib/active_support/configuration_file.rb
|
110
114
|
- lib/active_support/core_ext.rb
|
111
115
|
- lib/active_support/core_ext/array.rb
|
112
116
|
- lib/active_support/core_ext/array/access.rb
|
113
117
|
- lib/active_support/core_ext/array/conversions.rb
|
118
|
+
- lib/active_support/core_ext/array/deprecated_conversions.rb
|
119
|
+
- lib/active_support/core_ext/array/extract.rb
|
114
120
|
- lib/active_support/core_ext/array/extract_options.rb
|
115
121
|
- lib/active_support/core_ext/array/grouping.rb
|
116
122
|
- lib/active_support/core_ext/array/inquiry.rb
|
117
|
-
- lib/active_support/core_ext/array/prepend_and_append.rb
|
118
123
|
- lib/active_support/core_ext/array/wrap.rb
|
119
124
|
- lib/active_support/core_ext/benchmark.rb
|
120
125
|
- lib/active_support/core_ext/big_decimal.rb
|
@@ -128,6 +133,7 @@ files:
|
|
128
133
|
- lib/active_support/core_ext/date/blank.rb
|
129
134
|
- lib/active_support/core_ext/date/calculations.rb
|
130
135
|
- lib/active_support/core_ext/date/conversions.rb
|
136
|
+
- lib/active_support/core_ext/date/deprecated_conversions.rb
|
131
137
|
- lib/active_support/core_ext/date/zones.rb
|
132
138
|
- lib/active_support/core_ext/date_and_time/calculations.rb
|
133
139
|
- lib/active_support/core_ext/date_and_time/compatibility.rb
|
@@ -138,31 +144,30 @@ files:
|
|
138
144
|
- lib/active_support/core_ext/date_time/calculations.rb
|
139
145
|
- lib/active_support/core_ext/date_time/compatibility.rb
|
140
146
|
- lib/active_support/core_ext/date_time/conversions.rb
|
147
|
+
- lib/active_support/core_ext/date_time/deprecated_conversions.rb
|
148
|
+
- lib/active_support/core_ext/digest.rb
|
141
149
|
- lib/active_support/core_ext/digest/uuid.rb
|
142
150
|
- lib/active_support/core_ext/enumerable.rb
|
143
151
|
- lib/active_support/core_ext/file.rb
|
144
152
|
- lib/active_support/core_ext/file/atomic.rb
|
145
153
|
- lib/active_support/core_ext/hash.rb
|
146
|
-
- lib/active_support/core_ext/hash/compact.rb
|
147
154
|
- lib/active_support/core_ext/hash/conversions.rb
|
148
155
|
- lib/active_support/core_ext/hash/deep_merge.rb
|
156
|
+
- lib/active_support/core_ext/hash/deep_transform_values.rb
|
149
157
|
- lib/active_support/core_ext/hash/except.rb
|
150
158
|
- lib/active_support/core_ext/hash/indifferent_access.rb
|
151
159
|
- lib/active_support/core_ext/hash/keys.rb
|
152
160
|
- lib/active_support/core_ext/hash/reverse_merge.rb
|
153
161
|
- lib/active_support/core_ext/hash/slice.rb
|
154
|
-
- lib/active_support/core_ext/hash/transform_values.rb
|
155
162
|
- lib/active_support/core_ext/integer.rb
|
156
163
|
- lib/active_support/core_ext/integer/inflections.rb
|
157
164
|
- lib/active_support/core_ext/integer/multiple.rb
|
158
165
|
- lib/active_support/core_ext/integer/time.rb
|
159
166
|
- lib/active_support/core_ext/kernel.rb
|
160
|
-
- lib/active_support/core_ext/kernel/agnostics.rb
|
161
167
|
- lib/active_support/core_ext/kernel/concern.rb
|
162
168
|
- lib/active_support/core_ext/kernel/reporting.rb
|
163
169
|
- lib/active_support/core_ext/kernel/singleton_class.rb
|
164
170
|
- lib/active_support/core_ext/load_error.rb
|
165
|
-
- lib/active_support/core_ext/marshal.rb
|
166
171
|
- lib/active_support/core_ext/module.rb
|
167
172
|
- lib/active_support/core_ext/module/aliasing.rb
|
168
173
|
- lib/active_support/core_ext/module/anonymous.rb
|
@@ -173,13 +178,13 @@ files:
|
|
173
178
|
- lib/active_support/core_ext/module/delegation.rb
|
174
179
|
- lib/active_support/core_ext/module/deprecation.rb
|
175
180
|
- lib/active_support/core_ext/module/introspection.rb
|
176
|
-
- lib/active_support/core_ext/module/
|
181
|
+
- lib/active_support/core_ext/module/redefine_method.rb
|
177
182
|
- lib/active_support/core_ext/module/remove_method.rb
|
178
183
|
- lib/active_support/core_ext/name_error.rb
|
179
184
|
- lib/active_support/core_ext/numeric.rb
|
180
185
|
- lib/active_support/core_ext/numeric/bytes.rb
|
181
186
|
- lib/active_support/core_ext/numeric/conversions.rb
|
182
|
-
- lib/active_support/core_ext/numeric/
|
187
|
+
- lib/active_support/core_ext/numeric/deprecated_conversions.rb
|
183
188
|
- lib/active_support/core_ext/numeric/time.rb
|
184
189
|
- lib/active_support/core_ext/object.rb
|
185
190
|
- lib/active_support/core_ext/object/acts_like.rb
|
@@ -194,10 +199,14 @@ files:
|
|
194
199
|
- lib/active_support/core_ext/object/to_query.rb
|
195
200
|
- lib/active_support/core_ext/object/try.rb
|
196
201
|
- lib/active_support/core_ext/object/with_options.rb
|
202
|
+
- lib/active_support/core_ext/pathname.rb
|
203
|
+
- lib/active_support/core_ext/pathname/existence.rb
|
197
204
|
- lib/active_support/core_ext/range.rb
|
205
|
+
- lib/active_support/core_ext/range/compare_range.rb
|
198
206
|
- lib/active_support/core_ext/range/conversions.rb
|
207
|
+
- lib/active_support/core_ext/range/deprecated_conversions.rb
|
199
208
|
- lib/active_support/core_ext/range/each.rb
|
200
|
-
- lib/active_support/core_ext/range/
|
209
|
+
- lib/active_support/core_ext/range/include_time_with_zone.rb
|
201
210
|
- lib/active_support/core_ext/range/overlaps.rb
|
202
211
|
- lib/active_support/core_ext/regexp.rb
|
203
212
|
- lib/active_support/core_ext/securerandom.rb
|
@@ -215,34 +224,51 @@ files:
|
|
215
224
|
- lib/active_support/core_ext/string/starts_ends_with.rb
|
216
225
|
- lib/active_support/core_ext/string/strip.rb
|
217
226
|
- lib/active_support/core_ext/string/zones.rb
|
227
|
+
- lib/active_support/core_ext/symbol.rb
|
228
|
+
- lib/active_support/core_ext/symbol/starts_ends_with.rb
|
218
229
|
- lib/active_support/core_ext/time.rb
|
219
230
|
- lib/active_support/core_ext/time/acts_like.rb
|
220
231
|
- lib/active_support/core_ext/time/calculations.rb
|
221
232
|
- lib/active_support/core_ext/time/compatibility.rb
|
222
233
|
- lib/active_support/core_ext/time/conversions.rb
|
234
|
+
- lib/active_support/core_ext/time/deprecated_conversions.rb
|
223
235
|
- lib/active_support/core_ext/time/zones.rb
|
224
236
|
- lib/active_support/core_ext/uri.rb
|
237
|
+
- lib/active_support/current_attributes.rb
|
238
|
+
- lib/active_support/current_attributes/test_helper.rb
|
225
239
|
- lib/active_support/dependencies.rb
|
226
240
|
- lib/active_support/dependencies/autoload.rb
|
227
241
|
- lib/active_support/dependencies/interlock.rb
|
242
|
+
- lib/active_support/dependencies/require_dependency.rb
|
228
243
|
- lib/active_support/deprecation.rb
|
229
244
|
- lib/active_support/deprecation/behaviors.rb
|
230
245
|
- lib/active_support/deprecation/constant_accessor.rb
|
246
|
+
- lib/active_support/deprecation/disallowed.rb
|
231
247
|
- lib/active_support/deprecation/instance_delegator.rb
|
232
248
|
- lib/active_support/deprecation/method_wrappers.rb
|
233
249
|
- lib/active_support/deprecation/proxy_wrappers.rb
|
234
250
|
- lib/active_support/deprecation/reporting.rb
|
235
251
|
- lib/active_support/descendants_tracker.rb
|
252
|
+
- lib/active_support/digest.rb
|
236
253
|
- lib/active_support/duration.rb
|
237
254
|
- lib/active_support/duration/iso8601_parser.rb
|
238
255
|
- lib/active_support/duration/iso8601_serializer.rb
|
256
|
+
- lib/active_support/encrypted_configuration.rb
|
257
|
+
- lib/active_support/encrypted_file.rb
|
258
|
+
- lib/active_support/environment_inquirer.rb
|
259
|
+
- lib/active_support/error_reporter.rb
|
239
260
|
- lib/active_support/evented_file_update_checker.rb
|
261
|
+
- lib/active_support/execution_context.rb
|
262
|
+
- lib/active_support/execution_context/test_helper.rb
|
240
263
|
- lib/active_support/execution_wrapper.rb
|
241
264
|
- lib/active_support/executor.rb
|
265
|
+
- lib/active_support/executor/test_helper.rb
|
242
266
|
- lib/active_support/file_update_checker.rb
|
267
|
+
- lib/active_support/fork_tracker.rb
|
243
268
|
- lib/active_support/gem_version.rb
|
244
269
|
- lib/active_support/gzip.rb
|
245
270
|
- lib/active_support/hash_with_indifferent_access.rb
|
271
|
+
- lib/active_support/html_safe_translation.rb
|
246
272
|
- lib/active_support/i18n.rb
|
247
273
|
- lib/active_support/i18n_railtie.rb
|
248
274
|
- lib/active_support/inflections.rb
|
@@ -250,11 +276,13 @@ files:
|
|
250
276
|
- lib/active_support/inflector/inflections.rb
|
251
277
|
- lib/active_support/inflector/methods.rb
|
252
278
|
- lib/active_support/inflector/transliterate.rb
|
279
|
+
- lib/active_support/isolated_execution_state.rb
|
253
280
|
- lib/active_support/json.rb
|
254
281
|
- lib/active_support/json/decoding.rb
|
255
282
|
- lib/active_support/json/encoding.rb
|
256
283
|
- lib/active_support/key_generator.rb
|
257
284
|
- lib/active_support/lazy_load_hooks.rb
|
285
|
+
- lib/active_support/locale/en.rb
|
258
286
|
- lib/active_support/locale/en.yml
|
259
287
|
- lib/active_support/log_subscriber.rb
|
260
288
|
- lib/active_support/log_subscriber/test_helper.rb
|
@@ -263,6 +291,9 @@ files:
|
|
263
291
|
- lib/active_support/logger_thread_safe_level.rb
|
264
292
|
- lib/active_support/message_encryptor.rb
|
265
293
|
- lib/active_support/message_verifier.rb
|
294
|
+
- lib/active_support/messages/metadata.rb
|
295
|
+
- lib/active_support/messages/rotation_configuration.rb
|
296
|
+
- lib/active_support/messages/rotator.rb
|
266
297
|
- lib/active_support/multibyte.rb
|
267
298
|
- lib/active_support/multibyte/chars.rb
|
268
299
|
- lib/active_support/multibyte/unicode.rb
|
@@ -282,12 +313,15 @@ files:
|
|
282
313
|
- lib/active_support/option_merger.rb
|
283
314
|
- lib/active_support/ordered_hash.rb
|
284
315
|
- lib/active_support/ordered_options.rb
|
316
|
+
- lib/active_support/parameter_filter.rb
|
285
317
|
- lib/active_support/per_thread_registry.rb
|
286
318
|
- lib/active_support/proxy_object.rb
|
287
319
|
- lib/active_support/rails.rb
|
288
320
|
- lib/active_support/railtie.rb
|
289
321
|
- lib/active_support/reloader.rb
|
290
322
|
- lib/active_support/rescuable.rb
|
323
|
+
- lib/active_support/ruby_features.rb
|
324
|
+
- lib/active_support/secure_compare_rotator.rb
|
291
325
|
- lib/active_support/security_utils.rb
|
292
326
|
- lib/active_support/string_inquirer.rb
|
293
327
|
- lib/active_support/subscriber.rb
|
@@ -301,6 +335,10 @@ files:
|
|
301
335
|
- lib/active_support/testing/file_fixtures.rb
|
302
336
|
- lib/active_support/testing/isolation.rb
|
303
337
|
- lib/active_support/testing/method_call_assertions.rb
|
338
|
+
- lib/active_support/testing/parallelization.rb
|
339
|
+
- lib/active_support/testing/parallelization/server.rb
|
340
|
+
- lib/active_support/testing/parallelization/worker.rb
|
341
|
+
- lib/active_support/testing/parallelize_executor.rb
|
304
342
|
- lib/active_support/testing/setup_and_teardown.rb
|
305
343
|
- lib/active_support/testing/stream.rb
|
306
344
|
- lib/active_support/testing/tagged_logging.rb
|
@@ -308,7 +346,6 @@ files:
|
|
308
346
|
- lib/active_support/time.rb
|
309
347
|
- lib/active_support/time_with_zone.rb
|
310
348
|
- lib/active_support/values/time_zone.rb
|
311
|
-
- lib/active_support/values/unicode_tables.dat
|
312
349
|
- lib/active_support/version.rb
|
313
350
|
- lib/active_support/xml_mini.rb
|
314
351
|
- lib/active_support/xml_mini/jdom.rb
|
@@ -317,13 +354,17 @@ files:
|
|
317
354
|
- lib/active_support/xml_mini/nokogiri.rb
|
318
355
|
- lib/active_support/xml_mini/nokogirisax.rb
|
319
356
|
- lib/active_support/xml_mini/rexml.rb
|
320
|
-
homepage:
|
357
|
+
homepage: https://rubyonrails.org
|
321
358
|
licenses:
|
322
359
|
- MIT
|
323
360
|
metadata:
|
324
|
-
|
325
|
-
changelog_uri: https://github.com/rails/rails/blob/
|
326
|
-
|
361
|
+
bug_tracker_uri: https://github.com/rails/rails/issues
|
362
|
+
changelog_uri: https://github.com/rails/rails/blob/v7.0.4.1/activesupport/CHANGELOG.md
|
363
|
+
documentation_uri: https://api.rubyonrails.org/v7.0.4.1/
|
364
|
+
mailing_list_uri: https://discuss.rubyonrails.org/c/rubyonrails-talk
|
365
|
+
source_code_uri: https://github.com/rails/rails/tree/v7.0.4.1/activesupport
|
366
|
+
rubygems_mfa_required: 'true'
|
367
|
+
post_install_message:
|
327
368
|
rdoc_options:
|
328
369
|
- "--encoding"
|
329
370
|
- UTF-8
|
@@ -333,15 +374,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
333
374
|
requirements:
|
334
375
|
- - ">="
|
335
376
|
- !ruby/object:Gem::Version
|
336
|
-
version: 2.
|
377
|
+
version: 2.7.0
|
337
378
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
338
379
|
requirements:
|
339
380
|
- - ">="
|
340
381
|
- !ruby/object:Gem::Version
|
341
382
|
version: '0'
|
342
383
|
requirements: []
|
343
|
-
rubygems_version: 3.
|
344
|
-
signing_key:
|
384
|
+
rubygems_version: 3.4.3
|
385
|
+
signing_key:
|
345
386
|
specification_version: 4
|
346
387
|
summary: A toolkit of support libraries and Ruby core extensions extracted from the
|
347
388
|
Rails framework.
|
@@ -1,27 +0,0 @@
|
|
1
|
-
class Hash
|
2
|
-
unless Hash.instance_methods(false).include?(:compact)
|
3
|
-
# Returns a hash with non +nil+ values.
|
4
|
-
#
|
5
|
-
# hash = { a: true, b: false, c: nil }
|
6
|
-
# hash.compact # => { a: true, b: false }
|
7
|
-
# hash # => { a: true, b: false, c: nil }
|
8
|
-
# { c: nil }.compact # => {}
|
9
|
-
# { c: true }.compact # => { c: true }
|
10
|
-
def compact
|
11
|
-
select { |_, value| !value.nil? }
|
12
|
-
end
|
13
|
-
end
|
14
|
-
|
15
|
-
unless Hash.instance_methods(false).include?(:compact!)
|
16
|
-
# Replaces current hash with non +nil+ values.
|
17
|
-
# Returns +nil+ if no changes were made, otherwise returns the hash.
|
18
|
-
#
|
19
|
-
# hash = { a: true, b: false, c: nil }
|
20
|
-
# hash.compact! # => { a: true, b: false }
|
21
|
-
# hash # => { a: true, b: false }
|
22
|
-
# { c: true }.compact! # => nil
|
23
|
-
def compact!
|
24
|
-
reject! { |_, value| value.nil? }
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|
@@ -1,30 +0,0 @@
|
|
1
|
-
class Hash
|
2
|
-
# Returns a new hash with the results of running +block+ once for every value.
|
3
|
-
# The keys are unchanged.
|
4
|
-
#
|
5
|
-
# { a: 1, b: 2, c: 3 }.transform_values { |x| x * 2 } # => { a: 2, b: 4, c: 6 }
|
6
|
-
#
|
7
|
-
# If you do not provide a +block+, it will return an Enumerator
|
8
|
-
# for chaining with other methods:
|
9
|
-
#
|
10
|
-
# { a: 1, b: 2 }.transform_values.with_index { |v, i| [v, i].join.to_i } # => { a: 10, b: 21 }
|
11
|
-
def transform_values
|
12
|
-
return enum_for(:transform_values) { size } unless block_given?
|
13
|
-
return {} if empty?
|
14
|
-
result = self.class.new
|
15
|
-
each do |key, value|
|
16
|
-
result[key] = yield(value)
|
17
|
-
end
|
18
|
-
result
|
19
|
-
end unless method_defined? :transform_values
|
20
|
-
|
21
|
-
# Destructively converts all values using the +block+ operations.
|
22
|
-
# Same as +transform_values+ but modifies +self+.
|
23
|
-
def transform_values!
|
24
|
-
return enum_for(:transform_values!) { size } unless block_given?
|
25
|
-
each do |key, value|
|
26
|
-
self[key] = yield(value)
|
27
|
-
end
|
28
|
-
end unless method_defined? :transform_values!
|
29
|
-
# TODO: Remove this file when supporting only Ruby 2.4+.
|
30
|
-
end
|
@@ -1,11 +0,0 @@
|
|
1
|
-
class Object
|
2
|
-
# Makes backticks behave (somewhat more) similarly on all platforms.
|
3
|
-
# On win32 `nonexistent_command` raises Errno::ENOENT; on Unix, the
|
4
|
-
# spawned shell prints a message to stderr and sets $?. We emulate
|
5
|
-
# Unix on the former but not the latter.
|
6
|
-
def `(command) #:nodoc:
|
7
|
-
super
|
8
|
-
rescue Errno::ENOENT => e
|
9
|
-
STDERR.puts "#$0: #{e}"
|
10
|
-
end
|
11
|
-
end
|
@@ -1,22 +0,0 @@
|
|
1
|
-
module ActiveSupport
|
2
|
-
module MarshalWithAutoloading # :nodoc:
|
3
|
-
def load(source, proc = nil)
|
4
|
-
super(source, proc)
|
5
|
-
rescue ArgumentError, NameError => exc
|
6
|
-
if exc.message.match(%r|undefined class/module (.+?)(?:::)?\z|)
|
7
|
-
# try loading the class/module
|
8
|
-
loaded = $1.constantize
|
9
|
-
|
10
|
-
raise unless $1 == loaded.name
|
11
|
-
|
12
|
-
# if it is an IO we need to go back to read the object
|
13
|
-
source.rewind if source.respond_to?(:rewind)
|
14
|
-
retry
|
15
|
-
else
|
16
|
-
raise exc
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|
20
|
-
end
|
21
|
-
|
22
|
-
Marshal.singleton_class.prepend(ActiveSupport::MarshalWithAutoloading)
|
@@ -1,26 +0,0 @@
|
|
1
|
-
unless 1.respond_to?(:positive?) # TODO: Remove this file when we drop support to ruby < 2.3
|
2
|
-
class Numeric
|
3
|
-
# Returns true if the number is positive.
|
4
|
-
#
|
5
|
-
# 1.positive? # => true
|
6
|
-
# 0.positive? # => false
|
7
|
-
# -1.positive? # => false
|
8
|
-
def positive?
|
9
|
-
self > 0
|
10
|
-
end
|
11
|
-
|
12
|
-
# Returns true if the number is negative.
|
13
|
-
#
|
14
|
-
# -1.negative? # => true
|
15
|
-
# 0.negative? # => false
|
16
|
-
# 1.negative? # => false
|
17
|
-
def negative?
|
18
|
-
self < 0
|
19
|
-
end
|
20
|
-
end
|
21
|
-
|
22
|
-
class Complex
|
23
|
-
undef :positive?
|
24
|
-
undef :negative?
|
25
|
-
end
|
26
|
-
end
|
@@ -1,23 +0,0 @@
|
|
1
|
-
module ActiveSupport
|
2
|
-
module IncludeWithRange #:nodoc:
|
3
|
-
# Extends the default Range#include? to support range comparisons.
|
4
|
-
# (1..5).include?(1..5) # => true
|
5
|
-
# (1..5).include?(2..3) # => true
|
6
|
-
# (1..5).include?(2..6) # => false
|
7
|
-
#
|
8
|
-
# The native Range#include? behavior is untouched.
|
9
|
-
# ('a'..'f').include?('c') # => true
|
10
|
-
# (5..9).include?(11) # => false
|
11
|
-
def include?(value)
|
12
|
-
if value.is_a?(::Range)
|
13
|
-
# 1...10 includes 1..9 but it does not include 1..10.
|
14
|
-
operator = exclude_end? && !value.exclude_end? ? :< : :<=
|
15
|
-
super(value.first) && value.last.send(operator, last)
|
16
|
-
else
|
17
|
-
super
|
18
|
-
end
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|
22
|
-
|
23
|
-
Range.prepend(ActiveSupport::IncludeWithRange)
|
Binary file
|