From bc59ead10a870b85a189a6da5f581f3f22c5b945 Mon Sep 17 00:00:00 2001 From: Anthony Phillips Date: Thu, 8 Aug 2024 10:06:39 -0400 Subject: [PATCH 1/5] update shotgun version and rspec --- Gemfile | 2 +- Gemfile.lock | 134 ++++++++++++++++++++++++++------------------ spec/spec_helper.rb | 2 +- 3 files changed, 82 insertions(+), 56 deletions(-) diff --git a/Gemfile b/Gemfile index 34ce361..923c425 100644 --- a/Gemfile +++ b/Gemfile @@ -7,7 +7,7 @@ gem 'sinatra' gem 'rack-protection', '~> 2.0', '>= 2.0.1' gem 'rake' gem 'thin' -gem 'shotgun' +gem 'shotgun', git: 'https://github.com/delonnewman/shotgun.git' gem 'pry' gem 'require_all' diff --git a/Gemfile.lock b/Gemfile.lock index 6f48c4e..1f052e1 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,74 +1,100 @@ +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.5.2) - public_suffix (>= 2.0.2, < 4.0) - capybara (2.18.0) + addressable (2.8.7) + public_suffix (>= 2.0.2, < 7.0) + capybara (3.40.0) addressable + matrix mini_mime (>= 0.1.3) - nokogiri (>= 1.3.3) - rack (>= 1.0.0) - rack-test (>= 0.5.4) - xpath (>= 2.0, < 4.0) + nokogiri (~> 1.11) + rack (>= 1.6.0) + rack-test (>= 0.6.3) + regexp_parser (>= 1.5, < 3.0) + xpath (~> 3.2) cliver (0.3.2) - coderay (1.1.2) - daemons (1.2.6) - diff-lcs (1.3) - eventmachine (1.2.5) - method_source (0.9.0) - mini_mime (1.0.0) - mini_portile2 (2.3.0) - mustermann (1.0.2) - nokogiri (1.8.2) - mini_portile2 (~> 2.3.0) - poltergeist (1.17.0) - capybara (~> 2.1) + coderay (1.1.3) + daemons (1.4.1) + diff-lcs (1.5.1) + eventmachine (1.2.7) + matrix (0.4.2) + method_source (1.1.0) + mini_mime (1.1.5) + mustermann (2.0.2) + 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) + poltergeist (1.18.1) + capybara (>= 2.1, < 4) cliver (~> 0.3.1) websocket-driver (>= 0.2.0) - pry (0.11.3) - coderay (~> 1.1.0) - method_source (~> 0.9.0) - public_suffix (3.0.2) - rack (2.0.4) - rack-protection (2.0.1) + 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 (2.2.4) rack - rack-test (0.8.3) - rack (>= 1.0, < 3) - rake (12.3.0) - require_all (2.0.0) - rspec (3.7.0) - rspec-core (~> 3.7.0) - rspec-expectations (~> 3.7.0) - rspec-mocks (~> 3.7.0) - rspec-core (3.7.1) - rspec-support (~> 3.7.0) - rspec-expectations (3.7.0) + 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.7.0) - rspec-mocks (3.7.0) + rspec-support (~> 3.13.0) + rspec-mocks (3.13.1) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.7.0) - rspec-support (3.7.1) - shotgun (0.9.2) - rack (>= 1.0) - sinatra (2.0.1) - mustermann (~> 1.0) - rack (~> 2.0) - rack-protection (= 2.0.1) + rspec-support (~> 3.13.0) + rspec-support (3.13.1) + ruby2_keywords (0.0.5) + sinatra (2.2.4) + mustermann (~> 2.0) + rack (~> 2.2) + rack-protection (= 2.2.4) 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.8) - websocket-driver (0.7.0) + tilt (2.4.0) + websocket-driver (0.7.6) websocket-extensions (>= 0.1.0) - websocket-extensions (0.1.3) - xpath (3.0.0) + websocket-extensions (0.1.5) + 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 @@ -79,9 +105,9 @@ DEPENDENCIES rake require_all rspec - shotgun + shotgun! sinatra thin BUNDLED WITH - 1.16.1 + 2.5.16 diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index b28903b..3815967 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -9,7 +9,7 @@ RSpec.configure do |config| config.include Capybara::DSL config.include Rack::Test::Methods - config.order = 'default' + # config.order = 'default' end def app From 92760660fc683220492b65aaa6221898d6adca90 Mon Sep 17 00:00:00 2001 From: Anthony Phillips Date: Thu, 8 Aug 2024 10:39:41 -0400 Subject: [PATCH 2/5] Create form --- app.rb | 4 ++++ views/newteam.erb | 25 +++++++++++++++++++++++++ 2 files changed, 29 insertions(+) diff --git a/app.rb b/app.rb index 2bd6170..8f9c13b 100644 --- a/app.rb +++ b/app.rb @@ -2,5 +2,9 @@ class App < Sinatra::Base + get '/newteam' do + erb :newteam + end + end diff --git a/views/newteam.erb b/views/newteam.erb index 2eb4207..e0f04f6 100644 --- a/views/newteam.erb +++ b/views/newteam.erb @@ -5,6 +5,31 @@ Basketball Team Signup +

Create a Basketball Team!

+
+ + +

+ + +

+ + +

+ + +

+ + +

+ + +

+ + +

+ +
From 1fa1d8308c9e64884297059bccaf4568f10de7c5 Mon Sep 17 00:00:00 2001 From: Anthony Phillips Date: Thu, 8 Aug 2024 11:06:31 -0400 Subject: [PATCH 3/5] update post route --- app.rb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app.rb b/app.rb index 8f9c13b..6be6fc8 100644 --- a/app.rb +++ b/app.rb @@ -7,4 +7,10 @@ class App < Sinatra::Base end + post '/team' do + @teamData = params + erb :team + end + + end From 81197e8c5cd498c480a6624be961a8a21d0f0fe0 Mon Sep 17 00:00:00 2001 From: Anthony Phillips Date: Thu, 8 Aug 2024 11:07:29 -0400 Subject: [PATCH 4/5] Displayed submited data --- views/newteam.erb | 4 ++-- views/team.erb | 9 ++++++++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/views/newteam.erb b/views/newteam.erb index e0f04f6..18c2e36 100644 --- a/views/newteam.erb +++ b/views/newteam.erb @@ -6,7 +6,7 @@

Create a Basketball Team!

-
+

@@ -28,7 +28,7 @@

- +
diff --git a/views/team.erb b/views/team.erb index 1402747..92aa4c6 100644 --- a/views/team.erb +++ b/views/team.erb @@ -5,7 +5,14 @@ Basketball Team - +

Team Name: <%=@teamData["name"] %>

+

Coach: <%=@teamData["coach"]%> +

Point Guard: <%=@teamData["pg"]%> +

Shooting Guard: <%=@teamData["sg"]%> +

Small Forward: <%=@teamData["sf"]%> +

Power Forward: <%=@teamData["pf"]%> +

Center: <%=@teamData["c"]%> + From e97d4e47bc8bab30a26a6ad7fb95753743741db1 Mon Sep 17 00:00:00 2001 From: Anthony Phillips Date: Fri, 9 Aug 2024 15:56:32 -0400 Subject: [PATCH 5/5] Removed white space and update variable name --- app.rb | 5 +---- views/team.erb | 19 +++++++------------ 2 files changed, 8 insertions(+), 16 deletions(-) diff --git a/app.rb b/app.rb index 6be6fc8..4c52a8c 100644 --- a/app.rb +++ b/app.rb @@ -6,11 +6,8 @@ class App < Sinatra::Base erb :newteam end - post '/team' do - @teamData = params + @team_data = params erb :team end - - end diff --git a/views/team.erb b/views/team.erb index 92aa4c6..24ea285 100644 --- a/views/team.erb +++ b/views/team.erb @@ -5,17 +5,12 @@ Basketball Team -

Team Name: <%=@teamData["name"] %>

-

Coach: <%=@teamData["coach"]%> -

Point Guard: <%=@teamData["pg"]%> -

Shooting Guard: <%=@teamData["sg"]%> -

Small Forward: <%=@teamData["sf"]%> -

Power Forward: <%=@teamData["pf"]%> -

Center: <%=@teamData["c"]%> - - - +

Team Name: <%= @team_data["name"] %>

+

Coach: <%= @team_data["coach"] %> +

Point Guard: <%= @team_data["pg"] %> +

Shooting Guard: <%= @team_data["sg"] %> +

Small Forward: <%= @team_data["sf"] %> +

Power Forward: <%= @team_data["pf"] %> +

Center: <%= @team_data["c"] %> - -