diff --git a/CHANGELOG.md b/CHANGELOG.md index 64649f7..ef67ad7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,7 @@ # Unreleased +* Fix `Bootsnap.unload_cache!`, it simply wouldn't work at all becaue of a merge mistake. See #421. + # 1.13.0 * Stop decorating `Kernel.load`. This used to be very useful in development because the Rails "classic" autoloader diff --git a/lib/bootsnap.rb b/lib/bootsnap.rb index d5490f3..fa7d2d0 100644 --- a/lib/bootsnap.rb +++ b/lib/bootsnap.rb @@ -76,7 +76,7 @@ def setup( ) end - def self.unload_cache! + def unload_cache! LoadPathCache.unload! end diff --git a/lib/bootsnap/load_path_cache.rb b/lib/bootsnap/load_path_cache.rb index 30ced18..0cd977b 100644 --- a/lib/bootsnap/load_path_cache.rb +++ b/lib/bootsnap/load_path_cache.rb @@ -50,7 +50,6 @@ def unload! @realpath_cache = nil @load_path_cache = nil ChangeObserver.unregister($LOAD_PATH) - ::Kernel.alias_method(:require_relative, :require_relative_without_bootsnap) end def supported? diff --git a/test/setup_test.rb b/test/setup_test.rb index a118907..312bd94 100644 --- a/test/setup_test.rb +++ b/test/setup_test.rb @@ -94,5 +94,9 @@ def test_default_setup_with_BOOTSNAP_LOG Bootsnap.default_setup end + + def test_unload_cache + Bootsnap.unload_cache! + end end end