-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Stevie Spiegl RPS #2115
Open
S-Spiegl
wants to merge
62
commits into
makersacademy:main
Choose a base branch
from
S-Spiegl:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Stevie Spiegl RPS #2115
Changes from all commits
Commits
Show all changes
62 commits
Select commit
Hold shift + click to select a range
4359d10
first commit
S-Spiegl 1a24ee3
added app.rb and testing_infrastructure_spec
S-Spiegl cea74c9
commit check
S-Spiegl 43edfb8
added play.erb
S-Spiegl e071a99
added Player model, '/play' route, and redirected '/name'
S-Spiegl 392b36c
added play_game_spec and tests
S-Spiegl b136975
the model and controller are on speaking terms
S-Spiegl 3be0405
game works. needs more tests
S-Spiegl 0736433
some refactoring, several tests still need writing
S-Spiegl 8bfb302
replaced buttons with images and updated tests accordingly
S-Spiegl 23d4805
added capybara tests for various outcomes
S-Spiegl c1a4456
added background image for results screen
S-Spiegl 0a48d3e
getting new errors
S-Spiegl af14b6c
come back here for comments/questions
S-Spiegl 7fc16b4
refactored controller, took out comments
S-Spiegl f0c7b17
committing before changing computers
6ced6bc
Update README.md
S-Spiegl 598460d
Update README.md
S-Spiegl d7f237f
Update README.md
S-Spiegl b331630
moved styling to stylesheet
S-Spiegl 0162508
Merge branch 'main' of https://github.com/S-Spiegl/rps-challenge
S-Spiegl 737ec52
set images as row, moved more logic to css
S-Spiegl e8cacd9
tidied up css for all views
S-Spiegl 82d354a
finished tidying up css
S-Spiegl 06a966c
Update README.md
S-Spiegl 633c77b
added movies
S-Spiegl ddb2463
Merge branch 'main' of https://github.com/S-Spiegl/rps-challenge
S-Spiegl 5dcf235
set up databases
S-Spiegl c5a6c4f
database accepting booleans for each go to represent wins, draws and …
S-Spiegl bb949f7
incrementing won, drew, lost columns in postgres
S-Spiegl 9d44f07
renamed game to round;
S-Spiegl 88bf62a
keeps track of score and prints to screen
S-Spiegl 1353f7a
about to branch off for deployment
S-Spiegl dae923e
still undeployed
S-Spiegl 6f8e164
Update README.md
S-Spiegl 177486c
switched to improving tests branch
S-Spiegl 1c2215f
mocking for round_spec passing
S-Spiegl 06e98e2
tidied up round_spec
S-Spiegl f3b1de1
tests working
S-Spiegl 1cb42bb
Merge pull request #1 from S-Spiegl/improving-tests
S-Spiegl d143894
merged
S-Spiegl da77118
set up test database
S-Spiegl db0dba3
added procfile
S-Spiegl 2eab430
updated gemfile
S-Spiegl 63b1b62
updated gemfile again
S-Spiegl 2d23f71
testing if PG is the issue
S-Spiegl 508234a
testing if PG is the issue
S-Spiegl a74ace6
fixing PG
S-Spiegl 66baab1
fixing PG still
S-Spiegl 64d1602
fixing PG still
S-Spiegl a34292f
fixing PG still
S-Spiegl 10ba08e
fixing PG still
S-Spiegl b7773b9
fixing PG still
S-Spiegl 1a95f63
fixing PG still
S-Spiegl 72c4d4f
fixing PG still
S-Spiegl 63bb33e
fixing PG still
S-Spiegl cebb680
still trying to establish connection
S-Spiegl 852c43f
still trying to establish connection
S-Spiegl c252626
got PG working by transferring some of the logic into the round.rb, b…
S-Spiegl 0401afd
successfully deployed. Now need to edit table functionality
S-Spiegl e0db0da
Update README.md
S-Spiegl 2d98a80
Update README.md
S-Spiegl File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,20 @@ | ||
Tech Test Submission Requirements/Guidelines | ||
====== | ||
# Tech Test Submission Requirements/Guidelines | ||
|
||
Before submitting your test, please review the requirements/guidelines belows. Note that the requirements are mandatory and if you do not satisfy them we won't review your code (we don't mean to be harsh but this is based on the minimum expectations that our hiring partners require when you submit code for tech tests). | ||
|
||
Requirements | ||
------ | ||
## Requirements | ||
|
||
* We use [Hound CI](https://houndci.com/) to check for violations to our style guide. When you submit your Pull Request, please then check over and correct everything that Hound has sniffed out that is wrong with your code (unless you feel you really can't do anything to fix it). Once you've fixed Hound errors, push your code again and the Pull Request should update automatically. | ||
* Make sure you have written your own README that briefly explains your approach to solving the challenge. | ||
* If your code isn't finished it's not ideal but acceptable as long as you explain in your README where you got to and how you would plan to finish the challenge. | ||
* All code must be written test-first - we're looking for 100% test coverage or as near as possible to that figure. | ||
* Ensure all your tests are passing. | ||
- We use [Hound CI](https://houndci.com/) to check for violations to our style guide. When you submit your Pull Request, please then check over and correct everything that Hound has sniffed out that is wrong with your code (unless you feel you really can't do anything to fix it). Once you've fixed Hound errors, push your code again and the Pull Request should update automatically. | ||
- Make sure you have written your own README that briefly explains your approach to solving the challenge. | ||
- If your code isn't finished it's not ideal but acceptable as long as you explain in your README where you got to and how you would plan to finish the challenge. | ||
- All code must be written test-first - we're looking for 100% test coverage or as near as possible to that figure. | ||
- Ensure all your tests are passing. | ||
|
||
Desirable | ||
------- | ||
## Desirable | ||
|
||
* Set up [Travis CI](https://travis-ci.org/) on your own repo and add a [status badge](http://docs.travis-ci.com/user/status-images/) to your README showing that all tests are passing - and make sure it passes our own CI when you submit your PR. | ||
- Set up [Travis CI](https://travis-ci.org/) on your own repo and add a [status badge](http://docs.travis-ci.com/user/status-images/) to your README showing that all tests are passing - and make sure it passes our own CI when you submit your PR. | ||
|
||
Guidelines | ||
------- | ||
## Guidelines | ||
|
||
* Ensure you've understood the specification and built the code according to the challenge guidelines. | ||
* Read through [Code Reviews :pill:](https://github.com/makersacademy/course/blob/main/pills/code_reviews.md) to understand what we're looking for in your code. | ||
- Ensure you've understood the specification and built the code according to the challenge guidelines. | ||
- Read through [Code Reviews :pill:](https://github.com/makersacademy/course/blob/main/pills/code_reviews.md) to understand what we're looking for in your code. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
web: bundle exec rackup config.ru -p $PORT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
require 'sinatra/base' | ||
require 'sinatra/reloader' | ||
require './lib/player' | ||
require './lib/round' | ||
require './lib/game' | ||
# require './database_connection_setup' | ||
|
||
class RockPaperScissors < Sinatra::Base | ||
configure :development do | ||
register Sinatra::Reloader | ||
end | ||
|
||
enable :sessions | ||
|
||
get '/' do | ||
$game = Game.new | ||
erb :form | ||
end | ||
|
||
post '/play' do | ||
session[:player] = params[:player] | ||
$player = Player.new(params[:player]) | ||
@player_name = $player.name | ||
@game = $game | ||
erb :play | ||
end | ||
|
||
post '/play_again' do | ||
# session[:player] = params[:player] | ||
# $player = Player.new(params[:player]) | ||
# @player_name = $player.name | ||
@game = $game | ||
erb :play_again | ||
|
||
end | ||
|
||
post '/battle' do | ||
@player = $player | ||
@player_weapon = @player.select_weapon(params[:player_choice]) | ||
round = Round.new(@player_weapon, $game) | ||
@message = round.engine | ||
@computer_weapon = round.computer_weapon | ||
erb :battle | ||
end | ||
|
||
# Start the server if this file is executed directly (don't change the line below) | ||
run! if app_file == $0 | ||
end | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
require_relative 'app' | ||
run RockPaperScissors |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
require './lib/database_connection' | ||
|
||
if ENV['RACK_ENV'] == 'test' | ||
DatabaseConnection.setup('rps_test') | ||
else | ||
DatabaseConnection.setup('rps') | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
CREATE DATABASE rps; | ||
|
||
CREATE DATABASE rps_test; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
CREATE TABLE scores (id SERIAL PRIMARY KEY, won INT, drew INT, lost INT); | ||
INSERT INTO scores (won, drew, lost) VALUES(0, 0, 0); | ||
|
||
|
||
-- CREATE TABLE users (id SERIAL PRIMARY KEY, username VARCHAR(30)); | ||
|
||
-- CREATE TABLE spaces (id SERIAL PRIMARY KEY, name_of_space VARCHAR(100), available BOOLEAN, user_id INT, description VARCHAR(240), price_per_night INT); |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great file, concise, good use of class names and instance and global variables