Class: Capsium::Cli::Reactor

Inherits:
Thor
  • Object
show all
Extended by:
ThorExt::Start
Defined in:
lib/capsium/cli.rb

Instance Method Summary collapse

Methods included from ThorExt::Start

extended, start

Instance Method Details

#serve(path_to_package) ⇒ Object



77
78
79
80
81
82
83
84
85
86
87
88
89
90
# File 'lib/capsium/cli.rb', line 77

def serve(path_to_package)
  reactor = Capsium::Reactor.new(
    package: path_to_package,
    port: options[:port],
    do_not_listen: options[:do_not_listen],
  )
  reactor.serve
rescue StandardError => e
  puts e
  puts e.inspect
  puts e.backtrace
ensure
  reactor.package.cleanup
end