Class: GitContext::Commands::CreateContext

Inherits:
Base
  • Object
show all
Defined in:
lib/git_context/commands/create_context.rb

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from GitContext::Commands::Base

Instance Method Details

#callObject



6
7
8
9
10
11
12
13
14
15
# File 'lib/git_context/commands/create_context.rb', line 6

def call
  profile_names = @configuration.list_profile_names
  work_dir = @interaction.prompt_work_dir(Dir.pwd)
  profile_name = @interaction.prompt_profile(profile_names)

  context = Context.new(work_dir, profile_name)

  @configuration.add_context(context)
  @interaction.info("Context created to use #{profile_name} within #{work_dir}.")
end