From 27d3f30025b75702a7dc0123aee8bd7ddaa002c4 Mon Sep 17 00:00:00 2001 From: Anthony Phillips Date: Thu, 8 Aug 2024 09:06:55 -0400 Subject: [PATCH 1/5] Update shotgun gem --- Gemfile | 6 +-- Gemfile.lock | 122 +++++++++++++++++++++++++++++++-------------------- 2 files changed, 77 insertions(+), 51 deletions(-) diff --git a/Gemfile b/Gemfile index de1febd..52b6c1c 100644 --- a/Gemfile +++ b/Gemfile @@ -6,12 +6,12 @@ source "https://rubygems.org" gem 'sinatra' gem 'rake' gem 'thin' -gem 'shotgun' +gem 'shotgun', git: 'https://github.com/delonnewman/shotgun.git' gem 'pry' gem 'require_all' - + group :test do gem 'rspec' gem 'capybara' gem 'rack-test' -end \ No newline at end of file +end diff --git a/Gemfile.lock b/Gemfile.lock index 804cab2..0060f75 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,68 +1,94 @@ +GIT + remote: https://github.com/delonnewman/shotgun.git + revision: 600b3987db7f4774e2305247ff374327f1837857 + specs: + shotgun (0.9.2) + rack (>= 1.0) + GEM remote: https://rubygems.org/ specs: - addressable (2.6.0) - public_suffix (>= 2.0.2, < 4.0) - capybara (3.18.0) + addressable (2.8.7) + public_suffix (>= 2.0.2, < 7.0) + base64 (0.2.0) + capybara (3.40.0) addressable + matrix mini_mime (>= 0.1.3) - nokogiri (~> 1.8) + nokogiri (~> 1.11) rack (>= 1.6.0) rack-test (>= 0.6.3) - regexp_parser (~> 1.2) + regexp_parser (>= 1.5, < 3.0) xpath (~> 3.2) - coderay (1.1.2) - daemons (1.3.1) - diff-lcs (1.3) + coderay (1.1.3) + daemons (1.4.1) + diff-lcs (1.5.1) eventmachine (1.2.7) - method_source (0.9.2) - mini_mime (1.0.1) - mini_portile2 (2.4.0) - mustermann (1.0.3) - nokogiri (1.10.3) - mini_portile2 (~> 2.4.0) - pry (0.12.2) - coderay (~> 1.1.0) - method_source (~> 0.9.0) - public_suffix (3.0.3) - rack (2.0.7) - rack-protection (2.0.5) - rack - rack-test (1.1.0) - rack (>= 1.0, < 3) - rake (12.3.2) - regexp_parser (1.4.0) - require_all (2.0.0) - rspec (3.8.0) - rspec-core (~> 3.8.0) - rspec-expectations (~> 3.8.0) - rspec-mocks (~> 3.8.0) - rspec-core (3.8.0) - rspec-support (~> 3.8.0) - rspec-expectations (3.8.3) + matrix (0.4.2) + method_source (1.1.0) + mini_mime (1.1.5) + mustermann (3.0.1) + ruby2_keywords (~> 0.0.1) + nokogiri (1.16.7-aarch64-linux) + racc (~> 1.4) + nokogiri (1.16.7-arm-linux) + racc (~> 1.4) + nokogiri (1.16.7-arm64-darwin) + racc (~> 1.4) + nokogiri (1.16.7-x86-linux) + racc (~> 1.4) + nokogiri (1.16.7-x86_64-darwin) + racc (~> 1.4) + nokogiri (1.16.7-x86_64-linux) + racc (~> 1.4) + pry (0.14.2) + coderay (~> 1.1) + method_source (~> 1.0) + public_suffix (6.0.1) + racc (1.8.1) + rack (2.2.9) + rack-protection (3.2.0) + base64 (>= 0.1.0) + rack (~> 2.2, >= 2.2.4) + rack-test (2.1.0) + rack (>= 1.3) + rake (13.2.1) + regexp_parser (2.9.2) + require_all (3.0.0) + rspec (3.13.0) + rspec-core (~> 3.13.0) + rspec-expectations (~> 3.13.0) + rspec-mocks (~> 3.13.0) + rspec-core (3.13.0) + rspec-support (~> 3.13.0) + rspec-expectations (3.13.1) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.8.0) - rspec-mocks (3.8.0) + rspec-support (~> 3.13.0) + rspec-mocks (3.13.1) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.8.0) - rspec-support (3.8.0) - shotgun (0.9.2) - rack (>= 1.0) - sinatra (2.0.5) - mustermann (~> 1.0) - rack (~> 2.0) - rack-protection (= 2.0.5) + rspec-support (~> 3.13.0) + rspec-support (3.13.1) + ruby2_keywords (0.0.5) + sinatra (3.2.0) + mustermann (~> 3.0) + rack (~> 2.2, >= 2.2.4) + rack-protection (= 3.2.0) tilt (~> 2.0) - thin (1.7.2) + thin (1.8.2) daemons (~> 1.0, >= 1.0.9) eventmachine (~> 1.0, >= 1.0.4) rack (>= 1, < 3) - tilt (2.0.9) + tilt (2.4.0) xpath (3.2.0) nokogiri (~> 1.8) PLATFORMS - ruby + aarch64-linux + arm-linux + arm64-darwin + x86-linux + x86_64-darwin + x86_64-linux DEPENDENCIES capybara @@ -71,9 +97,9 @@ DEPENDENCIES rake require_all rspec - shotgun + shotgun! sinatra thin BUNDLED WITH - 2.0.1 + 2.5.16 From 9c0e3211edae4a6a132c91d91ad702f5ce8589f6 Mon Sep 17 00:00:00 2001 From: Anthony Phillips Date: Thu, 8 Aug 2024 09:09:06 -0400 Subject: [PATCH 2/5] hello route --- app.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app.rb b/app.rb index 254fe3f..43b4752 100644 --- a/app.rb +++ b/app.rb @@ -4,5 +4,9 @@ class App < Sinatra::Base erb :index end + get '/hello' do + erb :hello + end + end From 2eb5106cf4bf977925936c6f4e0f53303c0d3ace Mon Sep 17 00:00:00 2001 From: Anthony Phillips Date: Thu, 8 Aug 2024 09:09:58 -0400 Subject: [PATCH 3/5] Get templet --- spec/spec_helper.rb | 2 +- views/hello.erb | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 views/hello.erb diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 4666dac..19dd87e 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -8,7 +8,7 @@ config.filter_run :focus config.include Rack::Test::Methods - config.order = 'default' + # config.order = 'default' end def app diff --git a/views/hello.erb b/views/hello.erb new file mode 100644 index 0000000..f3e333e --- /dev/null +++ b/views/hello.erb @@ -0,0 +1 @@ +

Hello World

From aa179ccb64cd1ca6f5d42d7a7f71967eae626b96 Mon Sep 17 00:00:00 2001 From: Anthony Phillips Date: Thu, 8 Aug 2024 09:29:07 -0400 Subject: [PATCH 4/5] goodbye route --- app.rb | 4 ++++ views/goodbye.erb | 3 +++ 2 files changed, 7 insertions(+) create mode 100644 views/goodbye.erb diff --git a/app.rb b/app.rb index 43b4752..bdc2d3c 100644 --- a/app.rb +++ b/app.rb @@ -8,5 +8,9 @@ class App < Sinatra::Base erb :hello end + get '/goodbye' do + erb :goodbye + end + end diff --git a/views/goodbye.erb b/views/goodbye.erb new file mode 100644 index 0000000..045851c --- /dev/null +++ b/views/goodbye.erb @@ -0,0 +1,3 @@ +<% name = "Joe" %> + +

Goodbye <%= name %>

From 33286f1d2afbd988dc0638d69496112cf38ea347 Mon Sep 17 00:00:00 2001 From: Anthony Phillips Date: Thu, 8 Aug 2024 09:54:18 -0400 Subject: [PATCH 5/5] date route --- app.rb | 4 ++++ views/date.erb | 3 +++ 2 files changed, 7 insertions(+) create mode 100644 views/date.erb diff --git a/app.rb b/app.rb index bdc2d3c..b30ded4 100644 --- a/app.rb +++ b/app.rb @@ -12,5 +12,9 @@ class App < Sinatra::Base erb :goodbye end + get '/date' do + erb :date + end + end diff --git a/views/date.erb b/views/date.erb new file mode 100644 index 0000000..8d423cb --- /dev/null +++ b/views/date.erb @@ -0,0 +1,3 @@ +

The date is <%=Date.today.strftime("%A, %B %d, %Y") %>

+ +