Class: UsePacks::Private::InteractiveCli::UseCases::MoveToParent

Inherits:
Object
  • Object
show all
Extended by:
T::Helpers, T::Sig
Includes:
Interface
Defined in:
lib/use_packs/private/interactive_cli/use_cases/move_to_parent.rb

Instance Method Summary collapse

Methods included from Interface

all, included

Instance Method Details

#perform!(prompt) ⇒ Object



13
14
15
16
17
18
19
20
21
# File 'lib/use_packs/private/interactive_cli/use_cases/move_to_parent.rb', line 13

def perform!(prompt)
  child_pack = PackSelector.single_pack_select(prompt, question_text: 'Please select the child pack that will be nested')
  parent_pack = PackSelector.single_pack_select(prompt, question_text: 'Please select the pack that will be the parent')
  UsePacks.move_to_parent!(
    parent_name: parent_pack.name,
    pack_name: child_pack.name,
    per_file_processors: [UsePacks::RubocopPostProcessor.new, UsePacks::CodeOwnershipPostProcessor.new]
  )
end

#user_facing_nameObject



24
25
26
# File 'lib/use_packs/private/interactive_cli/use_cases/move_to_parent.rb', line 24

def user_facing_name
  'Move a child pack to be nested under a parent pack'
end