Class: UsePackwerk::Private::InteractiveCli::TeamSelector
- Inherits:
-
Object
- Object
- UsePackwerk::Private::InteractiveCli::TeamSelector
- Extended by:
- T::Sig
- Defined in:
- lib/use_packwerk/private/interactive_cli/team_selector.rb
Class Method Summary collapse
- .multi_select(prompt, question_text: 'Please select team owners') ⇒ Object
- .single_select(prompt, question_text: 'Please select a team owner') ⇒ Object
Class Method Details
.multi_select(prompt, question_text: 'Please select team owners') ⇒ Object
22 23 24 25 26 27 28 29 30 31 |
# File 'lib/use_packwerk/private/interactive_cli/team_selector.rb', line 22 def self.multi_select(prompt, question_text: 'Please select team owners') teams = CodeTeams.all.to_h { |t| [t.name, t] } prompt.multi_select( question_text, teams, filter: true, per_page: 10, show_help: :always ) end |
.single_select(prompt, question_text: 'Please select a team owner') ⇒ Object
10 11 12 13 14 15 16 17 18 19 |
# File 'lib/use_packwerk/private/interactive_cli/team_selector.rb', line 10 def self.single_select(prompt, question_text: 'Please select a team owner') teams = CodeTeams.all.sort_by(&:name).to_h { |t| [t.name, t] } prompt.select( question_text, teams, filter: true, per_page: 10, show_help: :always ) end |