From 079a0652570a0ac5060ccc620f90c98ebd5c9d76 Mon Sep 17 00:00:00 2001 From: Hartley McGuire Date: Mon, 21 Feb 2022 13:46:59 -0500 Subject: [PATCH] remove unused requires in ActiveSupport::Cache core_ext/array/wrap - added in b1164adda12268b38bba9b0d81c0d26b7251b8bb - usage removed in fa986ae0cac423bf1ebcb5caeccbecf00c990094 core_ext/numeric/time - added in ee51b51b60f9e6cce9babed2c8a65a14d87790c8, but usage was only in mem_cache_store so moved require there --- activesupport/lib/active_support/cache.rb | 2 -- activesupport/lib/active_support/cache/mem_cache_store.rb | 1 + activesupport/lib/active_support/cache/redis_cache_store.rb | 1 + activesupport/test/cache/behaviors/cache_store_behavior.rb | 2 ++ activesupport/test/cache/coder_test.rb | 1 + 5 files changed, 5 insertions(+), 2 deletions(-) diff --git a/activesupport/lib/active_support/cache.rb b/activesupport/lib/active_support/cache.rb index 0ec98fd901..57e27effd4 100644 --- a/activesupport/lib/active_support/cache.rb +++ b/activesupport/lib/active_support/cache.rb @@ -2,11 +2,9 @@ require "zlib" require "active_support/core_ext/array/extract_options" -require "active_support/core_ext/array/wrap" require "active_support/core_ext/enumerable" require "active_support/core_ext/module/attribute_accessors" require "active_support/core_ext/numeric/bytes" -require "active_support/core_ext/numeric/time" require "active_support/core_ext/object/to_param" require "active_support/core_ext/object/try" require "active_support/core_ext/string/inflections" diff --git a/activesupport/lib/active_support/cache/mem_cache_store.rb b/activesupport/lib/active_support/cache/mem_cache_store.rb index 3c3210c945..03da8b419c 100644 --- a/activesupport/lib/active_support/cache/mem_cache_store.rb +++ b/activesupport/lib/active_support/cache/mem_cache_store.rb @@ -10,6 +10,7 @@ end require "delegate" require "active_support/core_ext/enumerable" require "active_support/core_ext/array/extract_options" +require "active_support/core_ext/numeric/time" module ActiveSupport module Cache diff --git a/activesupport/lib/active_support/cache/redis_cache_store.rb b/activesupport/lib/active_support/cache/redis_cache_store.rb index 2d9eadadd3..213e6c7851 100644 --- a/activesupport/lib/active_support/cache/redis_cache_store.rb +++ b/activesupport/lib/active_support/cache/redis_cache_store.rb @@ -15,6 +15,7 @@ begin rescue LoadError end +require "active_support/core_ext/numeric/time" require "active_support/digest" module ActiveSupport diff --git a/activesupport/test/cache/behaviors/cache_store_behavior.rb b/activesupport/test/cache/behaviors/cache_store_behavior.rb index 6bbad002df..9495b4521f 100644 --- a/activesupport/test/cache/behaviors/cache_store_behavior.rb +++ b/activesupport/test/cache/behaviors/cache_store_behavior.rb @@ -1,5 +1,7 @@ # frozen_string_literal: true +require "active_support/core_ext/numeric/time" + # Tests the base functionality that should be identical across all cache stores. module CacheStoreBehavior def test_should_read_and_write_strings diff --git a/activesupport/test/cache/coder_test.rb b/activesupport/test/cache/coder_test.rb index a019d8ddc2..c21048f766 100644 --- a/activesupport/test/cache/coder_test.rb +++ b/activesupport/test/cache/coder_test.rb @@ -2,6 +2,7 @@ require_relative "../abstract_unit" require "active_support/cache" +require "active_support/core_ext/numeric/time" class CacheCoderTest < ActiveSupport::TestCase def test_new_coder_can_read_legacy_payloads