Class: Hatetepe::CLI

Inherits:
Thor
  • Object
show all
Defined in:
lib/hatetepe/cli.rb

Instance Method Summary collapse

Instance Method Details

#startObject



27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# File 'lib/hatetepe/cli.rb', line 27

def start
  require "hatetepe/server"
  require "rack"

  config          = config_for(options)
  ENV["RACK_ENV"] = config[:env]

  $stderr << "We're in #{config[:env]}\n"
  $stderr << "Booting from #{config[:rackup]}\n"

  EM.epoll
  EM.synchrony do
    $stderr << "Binding to #{config[:host]}:#{config[:port]}\n"

    trap("INT") { EM.stop }
    trap("TERM") { EM.stop }
    Server.start(config)
  end
end

#versionObject



11
12
13
14
# File 'lib/hatetepe/cli.rb', line 11

def version
  require "hatetepe/version"
  say Hatetepe::VERSION
end