From 71b927a8c3918dde1735e76d8daf2d15ff31c9af Mon Sep 17 00:00:00 2001 From: Eric Johnson Date: Fri, 1 May 2020 01:57:48 +0000 Subject: [PATCH] Done. --- Gemfile | 1 + Gemfile.lock | 6 ++++++ app/application.rb | 28 ++++++++++++++++++++++++++++ 3 files changed, 35 insertions(+) diff --git a/Gemfile b/Gemfile index 65300a9b1..9152e7c47 100644 --- a/Gemfile +++ b/Gemfile @@ -3,3 +3,4 @@ source 'https://rubygems.org' gem 'rack' gem 'rack-test' gem 'rspec' +gem 'pry' diff --git a/Gemfile.lock b/Gemfile.lock index 1f52c27d9..88b7cac17 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,12 @@ GEM remote: https://rubygems.org/ specs: + coderay (1.1.2) diff-lcs (1.3) + method_source (0.9.2) + pry (0.12.2) + coderay (~> 1.1.0) + method_source (~> 0.9.0) rack (2.0.6) rack-test (1.1.0) rack (>= 1.0, < 3) @@ -23,6 +28,7 @@ PLATFORMS ruby DEPENDENCIES + pry rack rack-test rspec diff --git a/app/application.rb b/app/application.rb index e69de29bb..4132bc484 100644 --- a/app/application.rb +++ b/app/application.rb @@ -0,0 +1,28 @@ +class Application + + def call(env) + resp = Rack::Response.new + # binding.pry + x = Time.now() + time= x.to_s.split[1] + morning = time.split(":")[0] + + # binding.pry + # num_2 = Kernel.rand(12..24) + # num_3 = Kernel.rand(1..20) + # + # resp.write "#{num_1}\n" + # resp.write "#{num_2}\n" + # resp.write "#{num_3}\n" + + if morning.to_i <= 12 + resp.write "Good Morning" + else + resp.write "Afternoon" + end + + + resp.finish + end + +end