Class: Staticz::ServerCommand

Inherits:
Object
  • Object
show all
Includes:
TTY::Option
Defined in:
lib/commands/server_command.rb

Instance Method Summary collapse

Instance Method Details

#runObject



41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# File 'lib/commands/server_command.rb', line 41

def run
  if params[:help]
    print help
    exit
  end

  if !params[:port]
    puts "A given port must be an integer"
    exit 1
  end

  if !params[:environment]
    puts "Environment must either be development or production"
    exit 1
  end

  Staticz::Settings.set_environment(params[:environment])
  Staticz::Server.new(params[:port])
end