-
Notifications
You must be signed in to change notification settings - Fork 21
Panda Level: add a preview and an outcome to the page #12
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
Open
jperezish
wants to merge
7
commits into
RubyoffRails:master
Choose a base branch
from
jperezish:master
base: master
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
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
fc8126d
add a preview and an outcome to the page
jperezish ef1b1fc
extract all Page.creates to the seed file
jperezish 7fde057
update page to store 2 option ids
jperezish a724944
update to have a common page
jperezish abb45b3
update tests to remove db query and just send a message to the object
jperezish 85a8007
move and update files to be packaged as a gem
jperezish b757449
add gem spec, update readme, add license
jperezish 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
Binary file not shown.
This file contains hidden or 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 @@ | ||
| -- color --format progress |
This file contains hidden or 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,22 @@ | ||
| Copyright (c) 2014 jason perez | ||
|
|
||
| MIT License | ||
|
|
||
| Permission is hereby granted, free of charge, to any person obtaining | ||
| a copy of this software and associated documentation files (the | ||
| "Software"), to deal in the Software without restriction, including | ||
| without limitation the rights to use, copy, modify, merge, publish, | ||
| distribute, sublicense, and/or sell copies of the Software, and to | ||
| permit persons to whom the Software is furnished to do so, subject to | ||
| the following conditions: | ||
|
|
||
| The above copyright notice and this permission notice shall be | ||
| included in all copies or substantial portions of the Software. | ||
|
|
||
| THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
| EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
| MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND | ||
| NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE | ||
| LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION | ||
| OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION | ||
| WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
This file contains hidden or 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 hidden or 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,24 @@ | ||
| # coding: utf-8 | ||
| lib = File.expand_path('../lib', __FILE__) | ||
| $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) | ||
| require 'adventure_game/version' | ||
|
|
||
| Gem::Specification.new do |spec| | ||
| spec.name = "adventure_game" | ||
| spec.version = AdventureGame::VERSION | ||
| spec.authors = ["jason perez"] | ||
| spec.email = ["jperezish@gmail.com"] | ||
| spec.description = "A sample gem as one exercise from Ruby Off Rails." | ||
| spec.summary = "Sample gem for Adventure Game." | ||
| spec.homepage = "" | ||
| spec.license = "MIT" | ||
|
|
||
| spec.files = `git ls-files`.split($/) | ||
| spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) } | ||
| spec.test_files = spec.files.grep(%r{^(test|spec|features)/}) | ||
| spec.require_paths = ["lib"] | ||
|
|
||
| spec.add_development_dependency "bundler", "~> 1.3" | ||
| spec.add_development_dependency "rake" | ||
| spec.add_development_dependency "rspec" | ||
| end |
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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,6 @@ | ||
| require_relative "adventure_game/version" | ||
| require_relative "adventure_game/adventure" | ||
|
|
||
| module AdventureGame | ||
| # Your code goes here... | ||
| end |
This file contains hidden or 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 hidden or 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,6 @@ | ||
| host: 'localhost' | ||
| adapter: 'postgresql' | ||
| database: 'episode5' | ||
| username: 'jason' | ||
| encoding: 'utf8' | ||
| pool: 5 |
File renamed without changes.
This file contains hidden or 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 hidden or 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,29 @@ | ||
| # Cleaning Out | ||
| Page.delete_all | ||
| page_two = Page.create(conclusion: true, | ||
| preview: "Go into the forest", | ||
| outcome: "You were methodically consumed by ZOMBIE DEER!!!", | ||
| content: "As soon as you stepped off the road, darkness consumed you. You tripped, fell to the ground, and a hoard of zombie deer proceeded to gobble you up.") | ||
| page_three = Page.create(conclusion: true, | ||
| preview: "Walk down the road", | ||
| outcome: "You found the circle of life (can be traded at Trapper's Den for 2 gold pieces)!", | ||
| content: "Apparently, after receiving it from his father, Simba dropped the circle of life while chasing a zombie deer.") | ||
| page_six = Page.create(option_a_id: page_two.id, | ||
| option_b_id: page_three.id, | ||
| preview: "Take a moment and taste the bacon fat in your mouth", | ||
| outcome: "Your spirits are lifted and you are ready to take on the world!", | ||
| content: "Armed with the power to take on the known world, you set forth.") | ||
| page_four = Page.create(option_a_id: page_six.id, | ||
| option_b_id: page_two.id, | ||
| preview: "Admire the 30 gold pieces", | ||
| outcome: "You were ransacked and robbed by a hoard of geriatric orcs!", | ||
| content: "They came at you slow, but because you were sucked into the glow of the gold you didn't notice 3 old orcs guided by walkers(with the little tennis balls on the fronts). You eat the bacon sandwich.") | ||
| page_five = Page.create(option_a_id: page_two.id, | ||
| option_b_id: page_six.id, | ||
| preview: "Eat the bacon sandwich", | ||
| outcome: "Your belly is happy and your mind is clear.", | ||
| content: "Obviously the only choice. Now that you've chosen wiser than Indiana Jones and the Quest For the Holy Grail, you are left with only the best decisions.") | ||
| page = Page.create(starting_point: true, | ||
| option_a_id: page_four.id, | ||
| option_b_id: page_five.id, | ||
| content: "You wake up on a road. It's foggy and damp. In your bag is 30 gold pieces and a bacon sandwich. Which do you choose?") |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 @@ | ||
| module AdventureGame | ||
| VERSION = "0.0.1" | ||
| end |
This file contains hidden or 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 hidden or 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 hidden or 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,5 +1,5 @@ | ||
| require "rspec" | ||
| require 'bundler/setup' | ||
| require_relative '../db/setup' | ||
| require_relative "../models/page" | ||
| require_relative "../models/book" | ||
| require_relative '../lib/adventure_game/db/setup' | ||
| require_relative "../lib/adventure_game/models/page" | ||
| require_relative "../lib/adventure_game/models/book" |
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.
Good use of find with an array :)