module Bootsnap::LoadPathCache::ChangeObserver::ArrayMixin

def <<(entry)

observer of the change.
(<<, push, unshift, concat), override that method to also notify the
For each method that adds items to one end or another of the array
def <<(entry)
  @lpc_observer.push_paths(self, entry.to_s)
  super
end

def concat(entries)

def concat(entries)
  @lpc_observer.push_paths(self, *entries.map(&:to_s))
  super
end

def push(*entries)

def push(*entries)
  @lpc_observer.push_paths(self, *entries.map(&:to_s))
  super
end

def uniq!(*args)

order, preserving the effective load path
uniq! keeps the first occurrence of each path, otherwise preserving
def uniq!(*args)
  ret = super
  @lpc_observer.reinitialize if block_given? || !args.empty?
  ret
end

def unshift(*entries)

def unshift(*entries)
  @lpc_observer.unshift_paths(self, *entries.map(&:to_s))
  super
end