18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
# File 'lib/use_packs/private/interactive_cli/use_cases/get_info.rb', line 18
def perform!(prompt)
team_or_pack = prompt.select('Do you want info by team or by pack?', ['By team', 'By pack'])
if team_or_pack == 'By team'
teams = TeamSelector.multi_select(prompt)
selected_packs = Packs.all.select do |p|
teams.map(&:name).include?(CodeOwnership.for_package(p)&.name)
end
else
selected_packs = PackSelector.single_or_all_pack_multi_select(prompt, question_text: 'What pack(s) would you like info on?')
end
puts "You've selected #{selected_packs.count} packs. Wow! Here's all the info."
Private.get_info(packs: selected_packs)
end
|