Module: Spigoter::CLI::Start

Defined in:
lib/spigoter/cli/cli_start.rb

Overview

Module for starting the server.

Author:

Class Method Summary collapse

Class Method Details

.dependenciesObject



28
29
30
31
32
33
# File 'lib/spigoter/cli/cli_start.rb', line 28

def self.dependencies
  if Spigoter::Utils.which('java').nil?
    Log.error "You don't have java in PATH"
    exit(1)
  end
end

.main(opts) ⇒ Object



15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/spigoter/cli/cli_start.rb', line 15

def self.main(opts)
  Log.info 'Starting the server!'
  dependencies
  opts = {}
  begin
    opts = Spigoter::Utils.fill_opts_config
  rescue => e
    Log.error e.message
    exit(1)
  end
  system("java #{opts[:javaparms]} -jar spigot.jar")
end

.startObject



11
12
13
# File 'lib/spigoter/cli/cli_start.rb', line 11

def self.start
  ->(opts = {}) { main(opts) }
end