require 'webrick' module Crys class Server def initialize(root:) @root = root end def start server = WEBrick::HTTPServer.new :Port => 8000, :DocumentRoot => root trap 'INT' do server.shutdown end server.start end private attr_reader :root end end