Class: Gemkeeper::CLI::Commands::Server::Stop

Inherits:
Dry::CLI::Command
  • Object
show all
Defined in:
lib/gemkeeper/cli/commands/server/stop.rb

Instance Method Summary collapse

Instance Method Details

#call(**options) ⇒ Object



12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/gemkeeper/cli/commands/server/stop.rb', line 12

def call(**options)
  config = Configuration.load(options[:config])
  manager = ServerManager.new(config)
  manager.stop

  puts "Geminabox server stopped"
rescue ServerNotRunningError => e
  warn "Error: #{e.message}"
  exit 1
rescue ServerError => e
  warn "Error stopping server: #{e.message}"
  exit 1
end