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 10
def <<(entry)
  @lpc_observer.push_paths(self, entry.to_s)
  super
end
append(*entries)
Alias for: push
concat(entries) click to toggle source
Calls superclass method
# 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
prepend(*entries)
Alias for: unshift
push(*entries) click to toggle source
Calls superclass method
# 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
Also aliased as: append
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 34
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 21
def unshift(*entries)
  @lpc_observer.unshift_paths(self, *entries.map(&:to_s))
  super
end
Also aliased as: prepend