summaryrefslogtreecommitdiff
path: root/new/bin/server.rb
diff options
context:
space:
mode:
Diffstat (limited to 'new/bin/server.rb')
-rwxr-xr-xnew/bin/server.rb49
1 files changed, 38 insertions, 11 deletions
diff --git a/new/bin/server.rb b/new/bin/server.rb
index 61f7c22..c46253d 100755
--- a/new/bin/server.rb
+++ b/new/bin/server.rb
@@ -1,9 +1,10 @@
+require "launchy"
+
require_relative "../lib/crys"
module Crys
class ServerRunner
- SPLASH = [
- <<-HEREDOC
+ SPLASH_1 = <<-HEREDOC
▄████▄ ██▀███ ▓██ ██▓ ██████ ██████ ██▓▄▄▄█████▓▓█████
▒██▀ ▀█ ▓██ ▒ ██▒ ▒██ ██▒▒██ ▒ ▒██ ▒ ▓██▒▓ ██▒ ▓▒▓█ ▀
▒▓█ ▄ ▓██ ░▄█ ▒ ▒██ ██░░ ▓██▄ ░ ▓██▄ ▒██▒▒ ▓██░ ▒░▒███
@@ -15,23 +16,49 @@ module Crys
░ ░ ░ ░ ░ ░ ░ ░ ░ ░
░ ░ ░
HEREDOC
- ]
- def initialize(server_class:, root: )
+ SPLASH_2 = <<-HEREDOC
+ _/_/_/ _/_/_/ _/ _/
+ _/ _/ _/_/ _/ _/ _/_/_/ _/ _/_/_/_/ _/_/
+ _/ _/_/ _/ _/ _/_/ _/_/ _/ _/ _/_/_/_/
+_/ _/ _/ _/ _/_/ _/ _/ _/ _/
+ _/_/_/ _/ _/_/_/ _/_/_/ _/_/_/ _/ _/_/ _/_/_/
+ _/
+ _/_/
+HEREDOC
+
+ SPLASH_3 = <<-HEREDOC
+@@@@@@@ @@@@@@@ @@@ @@@ @@@@@@ @@@@@@ @@@ @@@@@@@ @@@@@@@@
+@@@@@@@@ @@@@@@@@ @@@ @@@ @@@@@@@ @@@@@@@ @@@ @@@@@@@ @@@@@@@@
+!@@ @@! @@@ @@! !@@ !@@ !@@ @@! @@! @@!
+!@! !@! @!@ !@! @!! !@! !@! !@! !@! !@!
+!@! @!@!!@! !@!@! !!@@!! !!@@!! !!@ @!! @!!!:!
+!!! !!@!@! @!!! !!@!!! !!@!!! !!! !!! !!!!!:
+:!! !!: :!! !!: !:! !:! !!: !!: !!:
+:!: :!: !:! :!: !:! !:! :!: :!: :!:
+::: ::: :: ::: :: :::: :: :::: :: :: :: :: ::::
+:: :: : : : : : :: : : :: : : : : : :: ::
+HEREDOC
+
+ SPLASH = [SPLASH_1, SPLASH_2, SPLASH_3]
+
+ def initialize(server_class:, root:, section:)
@root = File.expand_path root
@server = server_class.new(root: root)
+ @section = section
end
- def serve
- puts ""
- puts SPLASH.sample
- puts "Serving from: " + root
- puts ""
- server.start
+ def serve
+ puts ""
+ puts SPLASH.sample
+ puts "Hello mms to \e[1m" + section + "\e[22m"
+ puts "Serving from: " + root
+ puts ""
+ server.start
end
private
- attr_reader :root, :server
+ attr_reader :root, :server, :section
end
end