Class: Packs::Private::InteractiveCli::UseCases::AddDependency

Inherits:
Object
  • Object
show all
Extended by:
T::Helpers, T::Sig
Includes:
Interface
Defined in:
lib/packs/private/interactive_cli/use_cases/add_dependency.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
# File 'lib/packs/private/interactive_cli/use_cases/add_dependency.rb', line 13

def perform!(prompt)
  dependent_pack = PackSelector.single_pack_select(prompt, question_text: 'Please select the pack you are adding a dependency to.')
  dependency_pack = PackSelector.single_pack_select(prompt, question_text: "Please select the pack that #{dependent_pack.name} should depend on.")
  Packs.add_dependency!(
    pack_name: dependent_pack.name,
    dependency_name: dependency_pack.name
  )
end

#user_facing_nameObject



23
24
25
# File 'lib/packs/private/interactive_cli/use_cases/add_dependency.rb', line 23

def user_facing_name
  'Add a dependency'
end