Class: Upkeep::Targeting::Selector

Inherits:
Object
  • Object
show all
Defined in:
lib/upkeep/targeting.rb

Instance Method Summary collapse

Instance Method Details

#select(recorder, changes) ⇒ Object



12
13
14
15
16
17
18
19
20
21
# File 'lib/upkeep/targeting.rb', line 12

def select(recorder, changes)
  graph = recorder.graph

  frame_nodes =
    graph.dependency_node_ids_matching(changes)
      .flat_map { |dependency_id| graph.dependency_owner_ids(dependency_id) }
      .flat_map { |owner_id| graph.nearest_frame_nodes_from(owner_id) }

  uniq_targets(remove_contained_frames(graph, frame_nodes).filter_map { |frame| target_for_frame(frame) })
end