Skip to content

Commit

Permalink
Fix Bootsnap.unload_cache!
Browse files Browse the repository at this point in the history
Fix: #421

It was broken because of some stupid rebase mistakes...
  • Loading branch information
byroot committed Aug 11, 2022
1 parent 27735a5 commit fbb7146
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/bootsnap.rb
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def setup(
)
end

def self.unload_cache!
def unload_cache!
LoadPathCache.unload!
end

Expand Down
1 change: 0 additions & 1 deletion lib/bootsnap/load_path_cache.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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?
Expand Down
4 changes: 4 additions & 0 deletions test/setup_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit fbb7146

Please # to comment.