Class: UsePackwerk::Private::InteractiveCli::PackSelector

Inherits:
Object
  • Object
show all
Extended by:
T::Sig
Defined in:
lib/use_packwerk/private/interactive_cli/pack_selector.rb

Class Method Summary collapse

Class Method Details

.single_or_all_pack_multi_select(prompt, question_text: 'Please select one or more packs') ⇒ Object



22
23
24
25
26
27
28
29
30
# File 'lib/use_packwerk/private/interactive_cli/pack_selector.rb', line 22

def self.single_or_all_pack_multi_select(prompt, question_text: 'Please select one or more packs')
  prompt.multi_select(
    question_text,
    ParsePackwerk.all.to_h { |t| [t.name, t] },
    filter: true,
    per_page: 10,
    show_help: :always
  )
end

.single_pack_select(prompt, question_text: 'Please select a pack') ⇒ Object



10
11
12
13
14
15
16
17
18
19
# File 'lib/use_packwerk/private/interactive_cli/pack_selector.rb', line 10

def self.single_pack_select(prompt, question_text: 'Please select a pack')
  packs = ParsePackwerk.all.to_h { |t| [t.name, t] }
  prompt.select(
    question_text,
    packs,
    filter: true,
    per_page: 10,
    show_help: :always
  )
end