module Bootsnap::LoadPathCache::ChangeObserver::ArrayMixin

Public Instance Methods

<<(entry) click to toggle source

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
# File lib/bootsnap/load_path_cache/change_observer.rb, line 9
def <<(entry)
  @lpc_observer.push_paths(self, entry.to_s)
  super
end
concat(entries) click to toggle source
Calls superclass method
# File lib/bootsnap/load_path_cache/change_observer.rb, line 24
def concat(entries)
  @lpc_observer.push_paths(self, *entries.map(&:to_s))
  super
end
push(*entries) click to toggle source
Calls superclass method
# File lib/bootsnap/load_path_cache/change_observer.rb, line 14
def push(*entries)
  @lpc_observer.push_paths(self, *entries.map(&:to_s))
  super
end
uniq!(*args) click to toggle source

uniq! keeps the first occurrence of each path, otherwise preserving order, preserving the effective load path

Calls superclass method
# File lib/bootsnap/load_path_cache/change_observer.rb, line 31
def uniq!(*args)
  ret = super
  @lpc_observer.reinitialize if block_given? || !args.empty?
  ret
end
unshift(*entries) click to toggle source
Calls superclass method
# File lib/bootsnap/load_path_cache/change_observer.rb, line 19
def unshift(*entries)
  @lpc_observer.unshift_paths(self, *entries.map(&:to_s))
  super
end