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

Tunes Takeout #23

Open
wants to merge 74 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 70 commits
Commits
Show all changes
74 commits
Select commit Hold shift + click to select a range
bca2955
added gems Spotity and Yelp API's, HTTParty, simplecov and pry-rails
May 16, 2016
f3ae0d6
bundle
May 16, 2016
8f2ef30
created controllers and its actions from the command line
May 16, 2016
e85bfde
more files auto generated for the controllers
May 16, 2016
ae4e3af
generate the models from the command line
May 16, 2016
61d8e1a
TunesTakeoutWrapper and added to the libs folder
May 16, 2016
902ce31
made the conection with the file in lib
May 17, 2016
7bbabc4
Made possible print the data from Tunes Api on the suggestions view
May 17, 2016
8a26d83
A plain Ruby object that receives and models data retrieved from the …
May 18, 2016
5cae683
have the Yelp API working
May 18, 2016
9863e94
added all the gems necesary for the user authentication with Stofify
May 19, 2016
e2f3f9b
bundle
May 19, 2016
be32b42
pulished the model to create the Music and the Food Objects properly,…
May 19, 2016
ed02bde
hide the files with sensitive conteent such as my Yelp and Spotify keys
May 19, 2016
5d084c8
added routes for user autentucation
May 19, 2016
d743250
created helper methods current_user and login?
May 19, 2016
4a5b550
created migrations to set the User attributes
May 19, 2016
628a8b9
started implementing omniauth
May 19, 2016
5476257
User authentication with Spotofy works... for now
May 19, 2016
bb23d43
fixed bug for spanish words
May 19, 2016
1fdc060
styles, more refactor
May 19, 2016
bc20d57
fixed bug, doubble looping
May 19, 2016
28af326
crated method for the top 20
May 19, 2016
2e05ffe
error
May 19, 2016
a3b9a1c
style
May 19, 2016
4ac1b47
css sugar, spotofy play
May 19, 2016
ee4165b
set Simplecov
May 20, 2016
5105b60
fixed the way top favorites where reachin into Charles API to get Spo…
May 20, 2016
57a72be
created partial to display list of suggestions
May 20, 2016
7cc2b51
started with the add favorite request
May 20, 2016
629485b
added some style, detele squile 3 gem
May 20, 2016
58ff99e
copy pasta the database.yml file back with the PG info
May 20, 2016
b6fac32
think the add favorites works
May 20, 2016
c6f8430
added the head part of the post request, now the add favorite works, …
May 20, 2016
46798e3
redisingeded the routes to meet with the requirements
May 20, 2016
0b1510e
started to fetch my favos
May 20, 2016
1440bba
moved the search bar to the nav bar
May 21, 2016
97342eb
change the background
May 21, 2016
bb552c1
my favorites ready to go
May 21, 2016
da39874
added filters to suggestions controllers
May 21, 2016
526d377
added telephone and open in yelp url
May 21, 2016
702608d
added links to open in Spotofy and yelp to respective images and names
May 21, 2016
32bbf5a
changed the home button and added a favicon
May 21, 2016
3f63be9
added telephone number and link to call from comuter or mobite
May 21, 2016
eed652a
added the pics from favicon
May 21, 2016
212acc5
happy (for now) with the style
May 21, 2016
3584678
change the displaed title
May 21, 2016
3c297b1
very proud of the refactoring this controller, I integrated three loo…
May 21, 2016
24e8c8a
added the sybol '=' so the user name would show upgit add app/views/s…
May 21, 2016
9024f61
more little details
May 21, 2016
4778d2f
add colunm URL to the user table, so the schema changed
May 21, 2016
8d7a115
now the schema did change for realgit add db/schema.rbgit add db/sche…
May 21, 2016
05a92be
captured the open in Spotify from API
May 21, 2016
f8b9eba
added links open in Spotify to the user name and picture , moved that…
May 21, 2016
f1d0410
added the method search_result to the filter
May 21, 2016
4ce3bc3
change the par_ia _display l name to match the instructions to _sugg…
May 21, 2016
dd47f8b
added the delete route for unfavorite
May 22, 2016
0e5478c
created (copy and pasta from the add_favorite and replace )the method…
May 22, 2016
ee6f0a8
added (copy and pasta the fav buttun) the unfav button to the patial
May 22, 2016
7de1025
double check the gems need for testing
May 22, 2016
8a51c97
got rid of the playlist edge pase
May 22, 2016
76009c3
a 100% coverage user test
May 22, 2016
4712204
added two files to the Simplecov filters
May 22, 2016
5009165
fixed the test for suggestions controller, still throing errors since…
May 22, 2016
a8124e3
change the delete test. But User test no ready yet
May 22, 2016
f480cdd
100% Food.rb test coverage
May 22, 2016
1592e49
added the add bottun eventhough the name and pictures are clickable t…
May 23, 2016
c5b5b13
tried thigs around with User for testing
May 23, 2016
5e287aa
trying out some test
May 28, 2016
eea2052
added gem in the Production group
Jun 7, 2016
09451bb
took yelp.rb aout of the .gitignore
Jun 19, 2016
620423b
made the login statment to the right
Jun 20, 2016
13e0239
details on the music display
Jun 20, 2016
81a2ec8
deleted commets
Jun 22, 2016
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
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -63,3 +63,7 @@ build-iPhoneSimulator/

# unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
.rvmrc

/config/initializers/yelp.rb

/.env
26 changes: 24 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,21 @@ gem 'coffee-rails', '~> 4.1.0'

# Use jquery as the JavaScript library
gem 'jquery-rails'
gem 'turbolinks'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.0'
# bundle exec rake doc:rails generates the API under doc/api.
gem 'sdoc', '~> 0.4.0', group: :doc

gem 'httparty', '0.13.7'
# gem 'yelp', require: 'yelp'
gem 'yelp', '~> 2.1', '>= 2.1.2'
gem 'rspotify', '1.10.0'

gem 'omniauth'
#gem 'omniauth-github'
gem 'omniauth-oauth2', '~> 1.3.1'
gem 'addressable'
# Use ActiveModel has_secure_password
# gem 'bcrypt', '~> 3.1.7'

Expand All @@ -32,14 +42,26 @@ gem 'sdoc', '~> 0.4.0', group: :doc

group :development, :test do
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
gem 'byebug'
gem 'byebug', '8.2.5'
gem "pry-rails", '0.3.4'
gem 'simplecov', '0.11.2'
gem 'minitest-vcr'
# gem 'vcr'
gem 'minitest-reporters'
gem 'webmock', '2.0.2'
gem 'dotenv-rails'

end

group :development do
# Access an IRB console on exception pages or by using <%= console %> in views
gem 'web-console', '~> 2.0'
gem "better_errors"

# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
gem 'spring'
# gem 'spring'
end

group :production do
gem 'rails_12factor'
end
111 changes: 107 additions & 4 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,18 @@ GEM
minitest (~> 5.1)
thread_safe (~> 0.3, >= 0.3.4)
tzinfo (~> 1.1)
addressable (2.4.0)
ansi (1.5.0)
arel (6.0.3)
better_errors (2.1.1)
coderay (>= 1.0.0)
erubis (>= 2.6.6)
rack (>= 0.9.0)
binding_of_caller (0.7.2)
debug_inspector (>= 0.0.1)
builder (3.2.2)
byebug (8.2.5)
coderay (1.1.1)
coffee-rails (4.1.1)
coffee-script (>= 2.2.0)
railties (>= 4.0.0, < 5.1.x)
Expand All @@ -49,11 +56,27 @@ GEM
execjs
coffee-script-source (1.10.0)
concurrent-ruby (1.0.2)
crack (0.4.3)
safe_yaml (~> 1.0.0)
debug_inspector (0.0.2)
docile (1.1.5)
dotenv (2.1.1)
dotenv-rails (2.1.1)
dotenv (= 2.1.1)
railties (>= 4.0, < 5.1)
erubis (2.7.0)
execjs (2.6.0)
faraday (0.9.2)
multipart-post (>= 1.2, < 3)
faraday_middleware (0.10.0)
faraday (>= 0.7.4, < 0.10)
globalid (0.3.6)
activesupport (>= 4.1.0)
hashdiff (0.3.0)
hashie (3.4.4)
httparty (0.13.7)
json (~> 1.8)
multi_xml (>= 0.5.2)
i18n (0.7.0)
jbuilder (2.4.1)
activesupport (>= 3.0.0, < 5.1)
Expand All @@ -63,19 +86,53 @@ GEM
railties (>= 4.2.0)
thor (>= 0.14, < 2.0)
json (1.8.3)
jwt (1.5.1)
loofah (2.0.3)
nokogiri (>= 1.5.9)
mail (2.6.4)
mime-types (>= 1.16, < 4)
method_source (0.8.2)
mime-types (3.0)
mime-types-data (~> 3.2015)
mime-types-data (3.2016.0221)
mini_portile2 (2.0.0)
minispec-metadata (2.0.0)
minitest
minitest (5.8.4)
minitest-reporters (1.1.9)
ansi
builder
minitest (>= 5.0)
ruby-progressbar
minitest-vcr (1.4.0)
minispec-metadata (~> 2.0)
minitest (>= 4.7.5)
vcr (>= 2.9)
multi_json (1.12.0)
multi_xml (0.5.5)
multipart-post (2.0.0)
netrc (0.7.9)
nokogiri (1.6.7.2)
mini_portile2 (~> 2.0.0.rc2)
oauth2 (1.1.0)
faraday (>= 0.8, < 0.10)
jwt (~> 1.0, < 1.5.2)
multi_json (~> 1.3)
multi_xml (~> 0.5)
rack (>= 1.2, < 3)
omniauth (1.3.1)
hashie (>= 1.2, < 4)
rack (>= 1.0, < 3)
omniauth-oauth2 (1.3.1)
oauth2 (~> 1.0)
omniauth (~> 1.2)
pg (0.18.4)
pry (0.10.3)
coderay (~> 1.1.0)
method_source (~> 0.8.1)
slop (~> 3.4)
pry-rails (0.3.4)
pry (>= 0.9.10)
rack (1.6.4)
rack-test (0.6.3)
rack (>= 1.0)
Expand All @@ -98,6 +155,11 @@ GEM
rails-deprecated_sanitizer (>= 1.0.1)
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 (4.2.6)
actionpack (= 4.2.6)
activesupport (= 4.2.6)
Expand All @@ -106,6 +168,13 @@ GEM
rake (11.1.2)
rdoc (4.2.2)
json (~> 1.4)
rest_client (1.8.3)
netrc (~> 0.7.7)
rspotify (1.10.0)
omniauth-oauth2 (~> 1.1)
rest_client (~> 1.8)
ruby-progressbar (1.8.1)
safe_yaml (1.0.4)
sass (3.4.22)
sass-rails (5.0.4)
railties (>= 4.0.0, < 5.0)
Expand All @@ -116,7 +185,13 @@ GEM
sdoc (0.4.1)
json (~> 1.7, >= 1.7.7)
rdoc (~> 4.0)
spring (1.7.1)
simple_oauth (0.3.1)
simplecov (0.11.2)
docile (~> 1.1.0)
json (~> 1.8)
simplecov-html (~> 0.10.0)
simplecov-html (0.10.0)
slop (3.6.0)
sprockets (3.6.0)
concurrent-ruby (~> 1.0)
rack (> 1, < 3)
Expand All @@ -127,31 +202,59 @@ GEM
thor (0.19.1)
thread_safe (0.3.5)
tilt (2.0.2)
turbolinks (2.5.3)
coffee-rails
tzinfo (1.2.2)
thread_safe (~> 0.1)
uglifier (3.0.0)
execjs (>= 0.3.0, < 3)
vcr (3.0.1)
web-console (2.3.0)
activemodel (>= 4.0)
binding_of_caller (>= 0.7.2)
railties (>= 4.0)
sprockets-rails (>= 2.0, < 4.0)
webmock (2.0.2)
addressable (>= 2.3.6)
crack (>= 0.3.2)
hashdiff
yelp (2.1.2)
faraday (~> 0.8, >= 0.8.0)
faraday_middleware (~> 0.8, >= 0.8.0)
simple_oauth (~> 0.3.1)

PLATFORMS
ruby

DEPENDENCIES
byebug
addressable
better_errors
byebug (= 8.2.5)
coffee-rails (~> 4.1.0)
dotenv-rails
httparty (= 0.13.7)
jbuilder (~> 2.0)
jquery-rails
minitest-reporters
minitest-vcr
omniauth
omniauth-oauth2 (~> 1.3.1)
pg (~> 0.15)
pry-rails (= 0.3.4)
rails (= 4.2.6)
rails_12factor
rspotify (= 1.10.0)
sass-rails (~> 5.0)
sdoc (~> 0.4.0)
spring
simplecov (= 0.11.2)
turbolinks
uglifier (>= 1.3.0)
web-console (~> 2.0)
webmock (= 2.0.2)
yelp (~> 2.1, >= 2.1.2)

RUBY VERSION
ruby 2.2.3p173

BUNDLED WITH
1.12.3
1.12.4
Binary file added app/assets/images/animated_favicon1.gif
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/favicon.ico
Binary file not shown.
3 changes: 3 additions & 0 deletions app/assets/javascripts/sessions.coffee
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Place all the behaviors and hooks related to the matching controller here.
# All this logic will automatically be available in application.js.
# You can use CoffeeScript in this file: http://coffeescript.org/
3 changes: 3 additions & 0 deletions app/assets/javascripts/suggestions.coffee
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Place all the behaviors and hooks related to the matching controller here.
# All this logic will automatically be available in application.js.
# You can use CoffeeScript in this file: http://coffeescript.org/
81 changes: 81 additions & 0 deletions app/assets/stylesheets/application.css
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,84 @@
*= require_tree .
*= require_self
*/
/*
html {
background-image: url(https://cdn.elegantthemes.com/blog/wp-content/uploads/2013/09/bg-5-full.jpg);
}*/

body {
/*background-image: url(https://cdn.elegantthemes.com/blog/wp-content/uploads/2013/09/bg-1-full.jpg);*/
background-image: url(https://cdn.elegantthemes.com/blog/wp-content/uploads/2013/09/bg-11-full.jpg);
background-image: url(http://static1.squarespace.com/static/54e5fa76e4b0453ef23d0e1c/t/55256769e4b007c5fd384a2e/1428514738661/website-background-image3_BRIGHTER.jpg?format=1200w);
height: 100%;
background-repeat: no-repeat;
background-attachment: fixed;
}

.yelp_pic {
float: right;

}

.picprofile {
border-radius: 50%;
height: 50px;
width: 50px;
}

.totheleft {
float: right;
}

.spotifypic {
height: 100px;
width: 100px;

}

.table>tbody>tr>.food {
width: 42%;
padding-top: 4%;
padding-right: 7%;
}

.table>tbody>tr>.music {
width: 42%;
padding-top: 4%;
padding-left: 7%;
}

.fava {
width: 16%;
}

tr {
margin-bottom: 40px;
background-color: rgba(250, 250, 250, 0.7);
}

.spotifytitle {
float: right;
width: 54%;
text-align: right;
}

.ratingpic {
float: right;
}

.yelpheader {
overflow: auto;
}

.yelpheaderti{
margin-top: 0;
}

.yelprates {
overflow: auto;
}

table a {
color: rgb(130, 16, 30);
}
3 changes: 3 additions & 0 deletions app/assets/stylesheets/sessions.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// Place all the styles related to the sessions controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/
3 changes: 3 additions & 0 deletions app/assets/stylesheets/suggestions.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// Place all the styles related to the suggestions controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/
16 changes: 16 additions & 0 deletions app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,20 @@ class ApplicationController < ActionController::Base
# Prevent CSRF attacks by raising an exception.
# For APIs, you may want to use :null_session instead.
protect_from_forgery with: :exception
#protect_from_forgery with: :null_session
helper_method :current_user

#before_action :require_login

def current_user
@user ||= User.find_by(id: session[:user_id])
end

def require_login
if current_user.nil?
flash[:error] = "You must be logged in to view this section"
redirect_to root_path
end
end

Choose a reason for hiding this comment

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

Minor, but you can clean up whitespace.

end
Loading