require_relative "../lib/crys" module Crys class ServerRunner SPLASH = [ <<-HEREDOC ▄████▄ ██▀███ ▓██ ██▓ ██████ ██████ ██▓▄▄▄█████▓▓█████ ▒██▀ ▀█ ▓██ ▒ ██▒ ▒██ ██▒▒██ ▒ ▒██ ▒ ▓██▒▓ ██▒ ▓▒▓█ ▀ ▒▓█ ▄ ▓██ ░▄█ ▒ ▒██ ██░░ ▓██▄ ░ ▓██▄ ▒██▒▒ ▓██░ ▒░▒███ ▒▓▓▄ ▄██▒▒██▀▀█▄ ░ ▐██▓░ ▒ ██▒ ▒ ██▒░██░░ ▓██▓ ░ ▒▓█ ▄ ▒ ▓███▀ ░░██▓ ▒██▒ ░ ██▒▓░▒██████▒▒▒██████▒▒░██░ ▒██▒ ░ ░▒████▒ ░ ░▒ ▒ ░░ ▒▓ ░▒▓░ ██▒▒▒ ▒ ▒▓▒ ▒ ░▒ ▒▓▒ ▒ ░░▓ ▒ ░░ ░░ ▒░ ░ ░ ▒ ░▒ ░ ▒░ ▓██ ░▒░ ░ ░▒ ░ ░░ ░▒ ░ ░ ▒ ░ ░ ░ ░ ░ ░ ░░ ░ ▒ ▒ ░░ ░ ░ ░ ░ ░ ░ ▒ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ HEREDOC ] def initialize(server_class:, root: ) @root = File.expand_path root @server = server_class.new(root: root) end def serve puts "" puts SPLASH.sample puts "Serving from: " + root puts "" server.start end private attr_reader :root, :server end end