Class: Gemkeeper::CLI::Commands::Setup

Inherits:
Dry::CLI::Command
  • Object
show all
Includes:
LockfileResolution
Defined in:
lib/gemkeeper/cli/commands/setup.rb

Instance Method Summary collapse

Instance Method Details

#call(source_path: nil, **options) ⇒ Object



24
25
26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/gemkeeper/cli/commands/setup.rb', line 24

def call(source_path: nil, **options)
  validate_options!(options)
  output_path = resolve_output_path(options)
  resolved = resolve_source_path(source_path)

  if lockfile?(resolved)
    setup_from_lockfile(resolved, output_path, options)
  else
    setup_from_config(resolved, output_path, options)
  end
rescue UnresolvableGemError, ManifestConflictError => error
  warn "Error: #{error.message}"
  exit 1
end