summaryrefslogtreecommitdiff
path: root/new/bin/server.rb
diff options
context:
space:
mode:
Diffstat (limited to 'new/bin/server.rb')
-rwxr-xr-xnew/bin/server.rb43
1 files changed, 5 insertions, 38 deletions
diff --git a/new/bin/server.rb b/new/bin/server.rb
index c46253d..8133623 100755
--- a/new/bin/server.rb
+++ b/new/bin/server.rb
@@ -1,47 +1,14 @@
require "launchy"
require_relative "../lib/crys"
+require_relative "mixins/splash.rb"
+
module Crys
class ServerRunner
- SPLASH_1 = <<-HEREDOC
- ▄████▄ ██▀███ ▓██ ██▓ ██████ ██████ ██▓▄▄▄█████▓▓█████
-▒██▀ ▀█ ▓██ ▒ ██▒ ▒██ ██▒▒██ ▒ ▒██ ▒ ▓██▒▓ ██▒ ▓▒▓█ ▀
-▒▓█ ▄ ▓██ ░▄█ ▒ ▒██ ██░░ ▓██▄ ░ ▓██▄ ▒██▒▒ ▓██░ ▒░▒███
-▒▓▓▄ ▄██▒▒██▀▀█▄ ░ ▐██▓░ ▒ ██▒ ▒ ██▒░██░░ ▓██▓ ░ ▒▓█ ▄
-▒ ▓███▀ ░░██▓ ▒██▒ ░ ██▒▓░▒██████▒▒▒██████▒▒░██░ ▒██▒ ░ ░▒████▒
-░ ░▒ ▒ ░░ ▒▓ ░▒▓░ ██▒▒▒ ▒ ▒▓▒ ▒ ░▒ ▒▓▒ ▒ ░░▓ ▒ ░░ ░░ ▒░ ░
- ░ ▒ ░▒ ░ ▒░ ▓██ ░▒░ ░ ░▒ ░ ░░ ░▒ ░ ░ ▒ ░ ░ ░ ░ ░
-░ ░░ ░ ▒ ▒ ░░ ░ ░ ░ ░ ░ ░ ▒ ░ ░ ░
-░ ░ ░ ░ ░ ░ ░ ░ ░ ░
-░ ░ ░
-HEREDOC
-
- SPLASH_2 = <<-HEREDOC
- _/_/_/ _/_/_/ _/ _/
- _/ _/ _/_/ _/ _/ _/_/_/ _/ _/_/_/_/ _/_/
- _/ _/_/ _/ _/ _/_/ _/_/ _/ _/ _/_/_/_/
-_/ _/ _/ _/ _/_/ _/ _/ _/ _/
- _/_/_/ _/ _/_/_/ _/_/_/ _/_/_/ _/ _/_/ _/_/_/
- _/
- _/_/
-HEREDOC
-
- SPLASH_3 = <<-HEREDOC
-@@@@@@@ @@@@@@@ @@@ @@@ @@@@@@ @@@@@@ @@@ @@@@@@@ @@@@@@@@
-@@@@@@@@ @@@@@@@@ @@@ @@@ @@@@@@@ @@@@@@@ @@@ @@@@@@@ @@@@@@@@
-!@@ @@! @@@ @@! !@@ !@@ !@@ @@! @@! @@!
-!@! !@! @!@ !@! @!! !@! !@! !@! !@! !@!
-!@! @!@!!@! !@!@! !!@@!! !!@@!! !!@ @!! @!!!:!
-!!! !!@!@! @!!! !!@!!! !!@!!! !!! !!! !!!!!:
-:!! !!: :!! !!: !:! !:! !!: !!: !!:
-:!: :!: !:! :!: !:! !:! :!: :!: :!:
-::: ::: :: ::: :: :::: :: :::: :: :: :: :: ::::
-:: :: : : : : : :: : : :: : : : : : :: ::
-HEREDOC
-
- SPLASH = [SPLASH_1, SPLASH_2, SPLASH_3]
+ include Splash
+
def initialize(server_class:, root:, section:)
@root = File.expand_path root
@server = server_class.new(root: root)
@@ -50,7 +17,7 @@ HEREDOC
def serve
puts ""
- puts SPLASH.sample
+ print_splash
puts "Hello mms to \e[1m" + section + "\e[22m"
puts "Serving from: " + root
puts ""