Skip to content
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

feedback commit #118

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .hound.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ruby:
config_file: .rubocop.yml
2 changes: 2 additions & 0 deletions .rspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
--color
--require spec_helper
26 changes: 26 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
Documentation:
Enabled: false
Style/FrozenStringLiteralComment:
Enabled: false
Style/StringLiterals:
Enabled: false
Style/VariableNumber:
EnforcedStyle: snake_case
Style/EmptyLinesAroundClassBody:
Enabled: false
Style/EmptyLinesAroundModuleBody:
Enabled: false
Style/SpaceInsideHashLiteralBraces:
Enabled: false
Style/BracesAroundHashParameters:
Enabled: false

Metrics/LineLength:
Exclude:
- 'spec/**/*'


AllCops:
Exclude:
- 'db/**/*'
- 'config/**/*'
14 changes: 14 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
language: ruby
rvm:
- 2.3.0
services:
- postgresql
env:
- TEST_DIRECTORY=spec/models
- TEST_DIRECTORY=spec/features
before_script:
- psql -c 'create database travis_ci_test;' -U postgres
script:
- xvfb-run bundle exec rspec $TEST_DIRECTORY
cache: bundler
sudo: false
21 changes: 18 additions & 3 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ git_source(:github) do |repo_name|
"https://github.com/#{repo_name}.git"
end


# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 5.0.1'
# Use postgresql as the database for Active Record
Expand All @@ -14,6 +13,8 @@ gem 'pg', '~> 0.18'
gem 'puma', '~> 3.0'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 5.0'
gem 'bootstrap-sass', '~> 3.3.6'
gem 'bootstrap_form'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# Use CoffeeScript for .coffee assets and views
Expand All @@ -28,14 +29,23 @@ gem 'jbuilder', '~> 2.5'
# Use Redis adapter to run Action Cable in production
# gem 'redis', '~> 3.0'
# Use ActiveModel has_secure_password
# gem 'bcrypt', '~> 3.1.7'

gem 'bcrypt', '~> 3.1.7'
# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development
gem 'friendly_id', '~> 5.1.0'
gem 'faker'
gem 'factory_girl_rails'

group :development, :test do
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
gem 'byebug', platform: :mri
gem 'rspec-rails'
gem 'capybara'
gem 'launchy'
gem 'database_cleaner'
gem 'shoulda-matchers'
gem 'rack_session_access'
gem 'rack'
end

group :development do
Expand All @@ -44,5 +54,10 @@ group :development do
gem 'listen', '~> 3.0.5'
end

group :production do
gem 'rails_12factor'
end

# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
gem 'stripe', '~> 1.55'
90 changes: 89 additions & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,25 @@ GEM
i18n (~> 0.7)
minitest (~> 5.1)
tzinfo (~> 1.1)
addressable (2.5.0)
public_suffix (~> 2.0, >= 2.0.2)
arel (7.1.4)
autoprefixer-rails (6.6.1)
execjs
bcrypt (3.1.11)
bootstrap-sass (3.3.7)
autoprefixer-rails (>= 5.2.1)
sass (>= 3.3.4)
bootstrap_form (2.5.2)
builder (3.2.2)
byebug (9.0.6)
capybara (2.11.0)
addressable
mime-types (>= 1.16)
nokogiri (>= 1.3.3)
rack (>= 1.0.0)
rack-test (>= 0.5.4)
xpath (~> 2.0)
coffee-rails (4.2.1)
coffee-script (>= 2.2.0)
railties (>= 4.0.0, < 5.2.x)
Expand All @@ -49,12 +65,27 @@ GEM
execjs
coffee-script-source (1.12.2)
concurrent-ruby (1.0.4)
database_cleaner (1.5.3)
debug_inspector (0.0.2)
diff-lcs (1.2.5)
domain_name (0.5.20161129)
unf (>= 0.0.5, < 1.0.0)
erubis (2.7.0)
execjs (2.7.0)
factory_girl (4.7.0)
activesupport (>= 3.0.0)
factory_girl_rails (4.7.0)
factory_girl (~> 4.7.0)
railties (>= 3.0.0)
faker (1.7.2)
i18n (~> 0.5)
ffi (1.9.14)
friendly_id (5.1.0)
activerecord (>= 4.0.0)
globalid (0.3.7)
activesupport (>= 4.1.0)
http-cookie (1.0.3)
domain_name (~> 0.5)
i18n (0.7.0)
jbuilder (2.6.1)
activesupport (>= 3.0.0, < 5.1)
Expand All @@ -63,6 +94,8 @@ GEM
rails-dom-testing (>= 1, < 3)
railties (>= 4.2.0)
thor (>= 0.14, < 2.0)
launchy (2.4.3)
addressable (~> 2.3)
listen (3.0.8)
rb-fsevent (~> 0.9, >= 0.9.4)
rb-inotify (~> 0.9, >= 0.9.7)
Expand All @@ -77,14 +110,19 @@ GEM
mini_portile2 (2.1.0)
minitest (5.10.1)
multi_json (1.12.1)
netrc (0.11.0)
nio4r (1.2.1)
nokogiri (1.7.0)
mini_portile2 (~> 2.1.0)
pg (0.19.0)
public_suffix (2.0.4)
puma (3.6.2)
rack (2.0.1)
rack-test (0.6.3)
rack (>= 1.0)
rack_session_access (0.1.1)
builder (>= 2.0.0)
rack (>= 1.0.0)
rails (5.0.1)
actioncable (= 5.0.1)
actionmailer (= 5.0.1)
Expand All @@ -102,6 +140,11 @@ GEM
nokogiri (~> 1.6)
rails-html-sanitizer (1.0.3)
loofah (~> 2.0)
rails_12factor (0.0.3)
rails_serve_static_assets
rails_stdout_logging
rails_serve_static_assets (0.0.5)
rails_stdout_logging (0.0.5)
railties (5.0.1)
actionpack (= 5.0.1)
activesupport (= 5.0.1)
Expand All @@ -112,27 +155,55 @@ GEM
rb-fsevent (0.9.8)
rb-inotify (0.9.7)
ffi (>= 0.5.0)
rest-client (2.0.0)
http-cookie (>= 1.0.2, < 2.0)
mime-types (>= 1.16, < 4.0)
netrc (~> 0.8)
rspec-core (3.5.4)
rspec-support (~> 3.5.0)
rspec-expectations (3.5.0)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.5.0)
rspec-mocks (3.5.0)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.5.0)
rspec-rails (3.5.2)
actionpack (>= 3.0)
activesupport (>= 3.0)
railties (>= 3.0)
rspec-core (~> 3.5.0)
rspec-expectations (~> 3.5.0)
rspec-mocks (~> 3.5.0)
rspec-support (~> 3.5.0)
rspec-support (3.5.0)
sass (3.4.23)
sass-rails (5.0.6)
railties (>= 4.0.0, < 6)
sass (~> 3.1)
sprockets (>= 2.8, < 4.0)
sprockets-rails (>= 2.0, < 4.0)
tilt (>= 1.1, < 3)
shoulda-matchers (3.1.1)
activesupport (>= 4.0.0)
sprockets (3.7.1)
concurrent-ruby (~> 1.0)
rack (> 1, < 3)
sprockets-rails (3.2.0)
actionpack (>= 4.0)
activesupport (>= 4.0)
sprockets (>= 3.0.0)
stripe (1.57.1)
rest-client (>= 1.4, < 4.0)
thor (0.19.4)
thread_safe (0.3.5)
tilt (2.0.5)
tzinfo (1.2.2)
thread_safe (~> 0.1)
uglifier (3.0.4)
execjs (>= 0.3.0, < 3)
unf (0.1.4)
unf_ext
unf_ext (0.0.7.2)
web-console (3.4.0)
actionview (>= 5.0)
activemodel (>= 5.0)
Expand All @@ -141,23 +212,40 @@ GEM
websocket-driver (0.6.4)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.2)
xpath (2.0.0)
nokogiri (~> 1.3)

PLATFORMS
ruby

DEPENDENCIES
bcrypt (~> 3.1.7)
bootstrap-sass (~> 3.3.6)
bootstrap_form
byebug
capybara
coffee-rails (~> 4.2)
database_cleaner
factory_girl_rails
faker
friendly_id (~> 5.1.0)
jbuilder (~> 2.5)
jquery-rails
launchy
listen (~> 3.0.5)
pg (~> 0.18)
puma (~> 3.0)
rack
rack_session_access
rails (~> 5.0.1)
rails_12factor
rspec-rails
sass-rails (~> 5.0)
shoulda-matchers
stripe (~> 1.55)
tzinfo-data
uglifier (>= 1.3.0)
web-console (>= 3.3.0)

BUNDLED WITH
1.13.6
1.13.7
31 changes: 9 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,11 @@
# README
# Little Shop
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i suggest adding an overview of what this application does here and perhaps how to pull it down and get it working locally 👍

#### Master branch build status: ![](https://travis-ci.org/lucyconklin/little_shop.svg?branch=master)

This README would normally document whatever steps are necessary to get the
application up and running.
1610 module 2 final group project
* [Assignment Markdown](https://github.com/turingschool/curriculum/blob/master/source/projects/little_shop.markdown)
* [Timber Shop on Heroku](https://timber-shop.herokuapp.com/)

Things you may want to cover:

* Ruby version

* System dependencies

* Configuration

* Database creation

* Database initialization

* How to run the test suite

* Services (job queues, cache servers, search engines, etc.)

* Deployment instructions

* ...
@cpowell23
@ski-climb
@lucyconklin
@robbie-smith
Binary file added app/assets/images/full_tree_slice.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/images/jumbotron_image.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/images/white_shopping_bag.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions app/assets/javascripts/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,6 @@
// about supported directives.
//
//= require jquery
//= require bootstrap-sprockets
//= require jquery_ujs
//= require_tree .
13 changes: 0 additions & 13 deletions app/assets/javascripts/cable.js

This file was deleted.

41 changes: 41 additions & 0 deletions app/assets/javascripts/checkouts.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
$(function() {
var $form = $('#payment-form');
$form.submit(function(event) {
// Disable the submit button to prevent repeated clicks:
$form.find('.submit').prop('disabled', true);

// Request a token from Stripe:
Stripe.card.createToken($form, stripeResponseHandler);

// Prevent the form from being submitted:
return false;
});
});

function stripeResponseHandler(status, response) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wooo stripe checkout 🎉

// Grab the form:
var $form = $('#payment-form');

if (response.error) { // Problem!

// Show the errors on the form:
$form.find('.payment-errors').text(response.error.message);
$form.find('.submit').prop('disabled', false); // Re-enable submission

} else { // Token was created!

// Get the token ID:
var token = response.id;
console.log(response);

// Insert the token ID into the form so it gets submitted to the server:
$form.append($('<input type="hidden" name="stripeToken">').val(token));
$form.append($('<input type="hidden" name="card_brand">').val(response.card.brand));
$form.append($('<input type="hidden" name="card_last4">').val(response.card.last4));
$form.append($('<input type="hidden" name="card_exp_month">').val(response.card.exp_month));
$form.append($('<input type="hidden" name="card_exp_year">').val(response.card.exp_year));

// Submit the form:
$form.get(0).submit();
}
};
Loading