diff options
-rw-r--r-- | new/Gemfile.lock | 10 | ||||
-rwxr-xr-x | new/bin/server.rb | 49 | ||||
-rw-r--r-- | new/output/.gitkeep | 0 | ||||
-rwxr-xr-x | new/splash/bin/server.rb | 2 |
4 files changed, 49 insertions, 12 deletions
diff --git a/new/Gemfile.lock b/new/Gemfile.lock index d610cfd..dc1f034 100644 --- a/new/Gemfile.lock +++ b/new/Gemfile.lock @@ -1,10 +1,19 @@ GEM remote: https://rubygems.org/ specs: + addressable (2.8.7) + public_suffix (>= 2.0.2, < 7.0) cgi (0.4.1) + childprocess (5.1.0) + logger (~> 1.5) diff-lcs (1.5.1) erb (4.0.4) cgi (>= 0.3.3) + launchy (3.0.1) + addressable (~> 2.8) + childprocess (~> 5.0) + logger (1.6.4) + public_suffix (6.0.1) rexml (3.4.0) rspec (3.13.0) rspec-core (~> 3.13.0) @@ -29,6 +38,7 @@ PLATFORMS DEPENDENCIES erb + launchy rspec rss webrick 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 diff --git a/new/output/.gitkeep b/new/output/.gitkeep deleted file mode 100644 index e69de29..0000000 --- a/new/output/.gitkeep +++ /dev/null diff --git a/new/splash/bin/server.rb b/new/splash/bin/server.rb index d932b53..9da053a 100755 --- a/new/splash/bin/server.rb +++ b/new/splash/bin/server.rb @@ -6,5 +6,5 @@ require_relative "../../bin/server.rb" server_class = Crys::Splash::Server root = File.dirname(File.dirname(__FILE__)) + "/output" -Crys::ServerRunner.new(root: root, server_class: server_class).serve +Crys::ServerRunner.new(root: root, server_class: server_class, section: "Splash Page").serve |