Class: Spawngebob::CLI

Inherits:
Thor
  • Object
show all
Includes:
Constants
Defined in:
lib/spawngebob/cli.rb

Constant Summary

Constants included from Constants

Spawngebob::Constants::BASE_CONFIG_PATH, Spawngebob::Constants::CONFIG_FILE, Spawngebob::Constants::NGINX_CONF, Spawngebob::Constants::NGINX_CONFD_PATH, Spawngebob::Constants::NGINX_CONF_PATH, Spawngebob::Constants::NGINX_DEFAULTS, Spawngebob::Constants::NGINX_DIRS, Spawngebob::Constants::NGINX_HTTP_LOCATION_TEMPLATE, Spawngebob::Constants::NGINX_PATH, Spawngebob::Constants::NGINX_PID, Spawngebob::Constants::NGINX_SERVER_TEMPLATE, Spawngebob::Constants::NGINX_SSL_LOCATION_TEMPLATE, Spawngebob::Constants::NGINX_SSL_SERVER_TEMPLATE, Spawngebob::Constants::NGINX_UPSTREAM_TEMPLATE, Spawngebob::Constants::SCRIPT_DIR

Instance Method Summary collapse

Instance Method Details

#checkObject



28
29
30
# File 'lib/spawngebob/cli.rb', line 28

def check
  Runner.boot(options)
end

#configureObject



33
34
35
36
37
38
39
40
41
42
43
44
45
46
# File 'lib/spawngebob/cli.rb', line 33

def configure
  # create necessary directories if not exist
  NGINX_DIRS.each do |d|
    full_path = File.join(NGINX_PATH, d)

    if !File.exists? full_path
      Utils.say_with_time "Directory #{full_path} does not exist, creating..." do
        FileUtils.mkdir_p(full_path)
      end
    end
  end

  Runner.boot(options)
end

#reloadObject



23
24
25
# File 'lib/spawngebob/cli.rb', line 23

def reload
  Runner.boot(options)
end

#restartObject



18
19
20
# File 'lib/spawngebob/cli.rb', line 18

def restart
  Runner.boot(options)
end

#startObject



8
9
10
# File 'lib/spawngebob/cli.rb', line 8

def start
  Runner.boot(options)
end

#stopObject



13
14
15
# File 'lib/spawngebob/cli.rb', line 13

def stop
  Runner.boot(options)
end