module Bootsnap::LoadPathCache::ChangeObserver::ArrayMixin
Public Instance Methods
Source
# File lib/bootsnap/load_path_cache/change_observer.rb, line 10 def <<(entry) @lpc_observer.push_paths(self, entry.to_s) super end
For each method that adds items to one end or another of the array (<<, push, unshift, concat), override that method to also notify the observer of the change.
Calls superclass method
Source
# File lib/bootsnap/load_path_cache/change_observer.rb, line 27 def concat(entries) @lpc_observer.push_paths(self, *entries.map(&:to_s)) super end
Calls superclass method
Source
# File lib/bootsnap/load_path_cache/change_observer.rb, line 15 def push(*entries) @lpc_observer.push_paths(self, *entries.map(&:to_s)) super end
Calls superclass method
Also aliased as: append
Source
# File lib/bootsnap/load_path_cache/change_observer.rb, line 34 def uniq!(*args) ret = super @lpc_observer.reinitialize if block_given? || !args.empty? ret end
uniq! keeps the first occurrence of each path, otherwise preserving order, preserving the effective load path
Calls superclass method
Source
# File lib/bootsnap/load_path_cache/change_observer.rb, line 21 def unshift(*entries) @lpc_observer.unshift_paths(self, *entries.map(&:to_s)) super end
Calls superclass method
Also aliased as: prepend