diff --git a/.rbenv-version b/.rbenv-version
deleted file mode 100644
index f3a9c9a..0000000
--- a/.rbenv-version
+++ /dev/null
@@ -1 +0,0 @@
-1.9.3-p194
diff --git a/.ruby-version b/.ruby-version
new file mode 100644
index 0000000..c031dda
--- /dev/null
+++ b/.ruby-version
@@ -0,0 +1 @@
+2.0.0-p0
diff --git a/Gemfile b/Gemfile
index 97e7f29..5fbd9f2 100644
--- a/Gemfile
+++ b/Gemfile
@@ -1,6 +1,10 @@
source 'http://rubygems.org'
-gem 'rails', '3.2.8'
+gem 'rails', github: 'rails/rails'
+gem 'sass-rails', github: 'rails/sass-rails'
+
+# TODO: Migrate to new mass-assignment approach
+gem 'protected_attributes'
# Datastore adapters
gem 'pg' # PostgreSQL adapter
@@ -15,7 +19,7 @@ gem 'pandora_client' # Pandora Tuner API client
gem 'rdio-ruby', git: 'https://github.com/nixme/rdio-ruby.git'
# Full-text search
-gem 'tire' # ElasticSearch adapter
+gem 'tire', github: 'karmi/tire' # ElasticSearch adapter
# Async processing
gem 'sidekiq' # Threaded, Resque-compatible task queues
@@ -27,21 +31,26 @@ gem 'omniauth-facebook'
gem 'omniauth-rdio'
# Front-end asset helpers
-gem 'haml', '3.2.0.beta.3' # HTML pre-processor
+gem 'sass'
+gem "haml", :github => "haml/haml", :branch => "stable"
+gem 'sass-rails', github: 'rails/sass-rails'
# Front-end asset helpers not loaded in production
group :assets do
+ gem 'bourbon'
gem 'animation', '~> 0.1.alpha.3' # [TEMP] Sass CSS3 animation helpers. Remove after Compass 0.13 upgrade
- gem 'sass-rails' # CSS pre-processor
- gem 'compass-rails' # CSS helpers and mixins
- gem 'coffee-rails' # CoffeeScript compiling
gem 'uglifier' # JavaScript minifer
+ gem 'sprockets-rails', github: 'rails/sprockets-rails'
+ gem 'coffee-rails', github: 'rails/coffee-rails'
+
# Vendor JavaScript libraries
gem 'jquery-rails'
gem 'rails-behaviors'
gem 'rails-backbone'
- gem 'swfobject-rails'
+
+ # This fork adds supports for Rails 4
+ gem 'swfobject-rails', github: 'geraudmathe/swfobject-rails'
end
# Push server gems. Not loaded by main Rails app.
diff --git a/Gemfile.lock b/Gemfile.lock
index 1d38a1f..4fe72bc 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -1,3 +1,99 @@
+GIT
+ remote: git://github.com/geraudmathe/swfobject-rails.git
+ revision: 0e50c7a332ed6c9874cd10277dda85c3b5d71415
+ specs:
+ swfobject-rails (1.1.1)
+ rails (>= 3.2)
+
+GIT
+ remote: git://github.com/haml/haml.git
+ revision: ae9c15890e3ebff69cd2fec5c9f069da9ec08320
+ branch: stable
+ specs:
+ haml (4.0.1.rc.1)
+ tilt
+
+GIT
+ remote: git://github.com/karmi/tire.git
+ revision: 53cf972eca9db6ccae794d5dbe7f25b1bbd4da85
+ specs:
+ tire (0.5.4)
+ activemodel (>= 3.0)
+ activesupport
+ hashr (~> 0.0.19)
+ multi_json (~> 1.3)
+ rake
+ rest-client (~> 1.6)
+
+GIT
+ remote: git://github.com/rails/coffee-rails.git
+ revision: 948fef30464235e7588e34faa513b448a00c0e6b
+ specs:
+ coffee-rails (4.0.0.beta1)
+ coffee-script (>= 2.2.0)
+ railties (>= 4.0.0.beta, < 5.0)
+
+GIT
+ remote: git://github.com/rails/rails.git
+ revision: b956771e82166ef7ccb2e53299a6a192029b668d
+ specs:
+ actionmailer (4.0.0.beta1)
+ actionpack (= 4.0.0.beta1)
+ mail (~> 2.5.3)
+ actionpack (4.0.0.beta1)
+ activesupport (= 4.0.0.beta1)
+ builder (~> 3.1.0)
+ erubis (~> 2.7.0)
+ rack (~> 1.5.2)
+ rack-test (~> 0.6.2)
+ activemodel (4.0.0.beta1)
+ activesupport (= 4.0.0.beta1)
+ builder (~> 3.1.0)
+ activerecord (4.0.0.beta1)
+ activemodel (= 4.0.0.beta1)
+ activerecord-deprecated_finders (~> 0.0.3)
+ activesupport (= 4.0.0.beta1)
+ arel (~> 4.0.0.beta1)
+ activesupport (4.0.0.beta1)
+ i18n (~> 0.6, >= 0.6.4)
+ minitest (~> 4.2)
+ multi_json (~> 1.3)
+ thread_safe (~> 0.1)
+ tzinfo (~> 0.3.33)
+ rails (4.0.0.beta1)
+ actionmailer (= 4.0.0.beta1)
+ actionpack (= 4.0.0.beta1)
+ activerecord (= 4.0.0.beta1)
+ activesupport (= 4.0.0.beta1)
+ bundler (>= 1.3.0, < 2.0)
+ railties (= 4.0.0.beta1)
+ sprockets-rails (~> 2.0.0.rc3)
+ railties (4.0.0.beta1)
+ actionpack (= 4.0.0.beta1)
+ activesupport (= 4.0.0.beta1)
+ rake (>= 0.8.7)
+ rdoc (~> 3.4)
+ thor (>= 0.17.0, < 2.0)
+
+GIT
+ remote: git://github.com/rails/sass-rails.git
+ revision: d435679b0fe528b954a9abd0059f975d94707574
+ specs:
+ sass-rails (4.0.0.beta1)
+ railties (>= 4.0.0.beta, < 5.0)
+ sass (>= 3.1.10)
+ sprockets-rails (~> 2.0.0.rc0)
+ tilt (~> 1.3)
+
+GIT
+ remote: git://github.com/rails/sprockets-rails.git
+ revision: afce1e65f7c6df4ae96522b26e755915d238ff80
+ specs:
+ sprockets-rails (2.0.0.rc3)
+ actionpack (>= 3.0)
+ activesupport (>= 3.0)
+ sprockets (~> 2.8)
+
GIT
remote: https://github.com/nixme/rdio-ruby.git
revision: f95ba6285ef0376f14d939832d49b1b75d316a3d
@@ -10,72 +106,56 @@ GIT
GEM
remote: http://rubygems.org/
specs:
- actionmailer (3.2.8)
- actionpack (= 3.2.8)
- mail (~> 2.4.4)
- actionpack (3.2.8)
- activemodel (= 3.2.8)
- activesupport (= 3.2.8)
- builder (~> 3.0.0)
- erubis (~> 2.7.0)
- journey (~> 1.0.4)
- rack (~> 1.4.0)
- rack-cache (~> 1.2)
- rack-test (~> 0.6.1)
- sprockets (~> 2.1.3)
- activemodel (3.2.8)
- activesupport (= 3.2.8)
- builder (~> 3.0.0)
- activerecord (3.2.8)
- activemodel (= 3.2.8)
- activesupport (= 3.2.8)
- arel (~> 3.0.2)
- tzinfo (~> 0.3.29)
- activeresource (3.2.8)
- activemodel (= 3.2.8)
- activesupport (= 3.2.8)
- activesupport (3.2.8)
- i18n (~> 0.6)
- multi_json (~> 1.0)
- addressable (2.3.2)
+ activerecord-deprecated_finders (0.0.3)
+ addressable (2.3.3)
animation (0.1.alpha.3)
compass (>= 0.12.0)
sass (>= 3.2.0.alpha.95)
- arel (3.0.2)
- awesome_print (1.0.2)
- binding_of_caller (0.6.7)
- builder (3.0.3)
- capistrano (2.9.0)
+ arel (4.0.0.beta1)
+ atomic (1.0.1)
+ awesome_print (1.1.0)
+ binding_of_caller (0.7.1)
+ debug_inspector (>= 0.0.1)
+ bourbon (3.1.1)
+ sass (>= 3.2.0)
+ thor
+ builder (3.1.4)
+ capistrano (2.14.2)
highline
net-scp (>= 1.0.0)
net-sftp (>= 2.0.0)
net-ssh (>= 2.0.14)
net-ssh-gateway (>= 1.1.0)
- celluloid (0.12.0)
+ celluloid (0.12.4)
+ facter (>= 1.6.12)
timers (>= 1.0.0)
- chunky_png (1.2.6)
- coderay (1.0.6)
- coffee-rails (3.2.2)
- coffee-script (>= 2.2.0)
- railties (~> 3.2.0)
+ chunky_png (1.2.7)
+ coderay (1.0.9)
coffee-script (2.2.0)
coffee-script-source
execjs
- coffee-script-source (1.3.3)
+ coffee-script-source (1.6.1)
+ columnize (0.3.6)
compass (0.12.2)
chunky_png (~> 1.2)
fssm (>= 0.2.7)
sass (~> 3.1)
- compass-rails (1.0.3)
- compass (>= 0.12.2, < 0.14)
- connection_pool (0.9.2)
+ connection_pool (1.0.0)
cookiejar (0.3.0)
- coolline (0.2.0)
- crypt19 (1.2.1)
+ coolline (0.4.0)
+ crypt19-rb (1.2.1)
daemons (1.1.9)
- diff-lcs (1.1.3)
- diffy (2.0.6)
- ejs (1.0.0)
+ debug_inspector (0.0.2)
+ debugger (1.4.0)
+ columnize (>= 0.3.1)
+ debugger-linecache (~> 1.1.1)
+ debugger-ruby_core_source (~> 1.2.0)
+ debugger-linecache (1.1.2)
+ debugger-ruby_core_source (>= 1.1.1)
+ debugger-ruby_core_source (1.2.0)
+ diff-lcs (1.2.1)
+ diffy (2.1.3)
+ ejs (1.1.1)
em-hiredis (0.1.1)
hiredis (~> 0.4.0)
em-http-request (1.0.3)
@@ -87,14 +167,15 @@ GEM
em-socksify (0.2.1)
eventmachine (>= 1.0.0.beta.4)
erubis (2.7.0)
- eventmachine (1.0.0)
+ eventmachine (1.0.1)
execjs (1.4.0)
multi_json (~> 1.0)
- faraday (0.8.4)
+ facter (1.6.17)
+ faraday (0.8.6)
multipart-post (~> 1.1)
faraday_middleware (0.8.8)
faraday (>= 0.7.4, < 0.9)
- faye (0.8.6)
+ faye (0.8.9)
cookiejar (>= 0.3.0)
em-http-request (>= 0.3.0)
eventmachine (>= 0.12.0)
@@ -105,70 +186,70 @@ GEM
em-hiredis (>= 0.0.1)
eventmachine (>= 0.12.0)
yajl-ruby (>= 1.0.0)
- faye-websocket (0.4.6)
+ faye-websocket (0.4.7)
eventmachine (>= 0.12.0)
- foreigner (1.1.1)
+ foreigner (1.4.0)
activerecord (>= 3.0.0)
- foreman (0.60.2)
+ foreman (0.61.0)
thor (>= 0.13.6)
- fssm (0.2.9)
+ fssm (0.2.10)
grit (2.5.0)
diff-lcs (~> 1.1)
mime-types (~> 1.15)
posix-spawn (~> 0.3.6)
- haml (3.2.0.beta.3)
- tilt
hashie (1.2.0)
- highline (1.6.11)
+ hashr (0.0.22)
+ highline (1.6.15)
hike (1.2.1)
- hirb (0.6.2)
+ hirb (0.7.1)
hiredis (0.4.5)
http_parser.rb (0.5.3)
httpauth (0.2.0)
- i18n (0.6.1)
- jazz_hands (0.2.0)
- awesome_print (~> 1.0.2)
- coderay (~> 1.0.5)
- coolline (>= 0.1.0)
- hirb (~> 0.6.2)
- pry (~> 0.9.8.4)
- pry-doc (~> 0.4.1)
- pry-git (~> 0.2.2)
- pry-nav (~> 0.2.0)
- pry-remote (>= 0.1.1)
- pry-stack_explorer (~> 0.4.1)
- railties (~> 3.0)
- journey (1.0.4)
- jquery-rails (1.0.18)
- railties (~> 3.0)
- thor (~> 0.14)
- json (1.7.5)
- jwt (0.1.5)
- multi_json (>= 1.0)
- mail (2.4.4)
+ i18n (0.6.4)
+ jazz_hands (0.5.0)
+ awesome_print (~> 1.1.0)
+ coderay (~> 1.0.9)
+ coolline (>= 0.4.0)
+ hirb (~> 0.7.1)
+ pry (~> 0.9.12)
+ pry-debugger (~> 0.2.2)
+ pry-doc (~> 0.4.4)
+ pry-git (~> 0.2.3)
+ pry-rails (~> 0.2.2)
+ pry-remote (>= 0.1.7)
+ pry-stack_explorer (~> 0.4.9)
+ railties (>= 3.0, < 5.0)
+ jquery-rails (2.1.4)
+ railties (>= 3.0, < 5.0)
+ thor (>= 0.14, < 2.0)
+ json (1.7.7)
+ jwt (0.1.7)
+ multi_json (>= 1.5)
+ mail (2.5.3)
i18n (>= 0.4.0)
mime-types (~> 1.16)
treetop (~> 1.4.8)
- method_source (0.7.1)
- mime-types (1.19)
- multi_json (1.3.6)
- multipart-post (1.1.5)
- net-scp (1.0.4)
- net-ssh (>= 1.99.1)
- net-sftp (2.0.5)
- net-ssh (>= 2.0.9)
- net-ssh (2.3.0)
- net-ssh-gateway (1.1.0)
- net-ssh (>= 1.99.1)
- nokogiri (1.5.5)
+ method_source (0.8.1)
+ mime-types (1.21)
+ minitest (4.6.2)
+ multi_json (1.6.1)
+ multipart-post (1.2.0)
+ net-scp (1.1.0)
+ net-ssh (>= 2.6.5)
+ net-sftp (2.1.1)
+ net-ssh (>= 2.6.5)
+ net-ssh (2.6.6)
+ net-ssh-gateway (1.2.0)
+ net-ssh (>= 2.6.5)
+ nokogiri (1.5.6)
oauth (0.4.7)
- oauth2 (0.8.0)
+ oauth2 (0.8.1)
faraday (~> 0.8)
httpauth (~> 0.1)
jwt (~> 0.1.4)
multi_json (~> 1.0)
rack (~> 1.2)
- omniauth (1.1.1)
+ omniauth (1.1.3)
hashie (~> 1.2)
rack
omniauth-facebook (1.4.1)
@@ -181,132 +262,111 @@ GEM
omniauth (~> 1.0)
omniauth-rdio (0.1.0)
omniauth-oauth (~> 1.0)
- pandora_client (0.1.2)
- crypt19 (~> 1.2.1)
+ pandora_client (0.1.3)
+ crypt19-rb (~> 1.2.1)
faraday (~> 0.8)
nokogiri (~> 1.5.2)
- patron (0.4.16)
+ patron (0.4.18)
pg (0.14.1)
polyglot (0.3.3)
posix-spawn (0.3.6)
- pry (0.9.8.4)
+ protected_attributes (1.0.0)
+ activemodel (>= 4.0.0.beta, < 5.0)
+ pry (0.9.12)
coderay (~> 1.0.5)
- method_source (~> 0.7.1)
- slop (>= 2.4.4, < 3)
- pry-doc (0.4.2)
- pry (>= 0.9.0)
+ method_source (~> 0.8)
+ slop (~> 3.4)
+ pry-debugger (0.2.2)
+ debugger (~> 1.3)
+ pry (~> 0.9.10)
+ pry-doc (0.4.4)
+ pry (>= 0.9.9.6)
yard (~> 0.8.1)
pry-git (0.2.3)
diffy
grit
pry (>= 0.9.8)
- pry-nav (0.2.0)
- pry (~> 0.9.8.1)
- pry-remote (0.1.1)
- pry (~> 0.9.8)
- slop (~> 2.1)
- pry-stack_explorer (0.4.1)
- binding_of_caller (~> 0.6.2)
- pry (~> 0.9.8.2)
+ pry-rails (0.2.2)
+ pry (>= 0.9.10)
+ pry-remote (0.1.7)
+ pry (~> 0.9)
+ slop (~> 3.0)
+ pry-stack_explorer (0.4.9)
+ binding_of_caller (>= 0.7)
+ pry (~> 0.9.11)
puma (1.6.3)
rack (~> 1.2)
- rack (1.4.1)
- rack-cache (1.2)
- rack (>= 0.4)
- rack-protection (1.2.0)
- rack
- rack-ssl (1.3.2)
+ rack (1.5.2)
+ rack-protection (1.4.0)
rack
rack-test (0.6.2)
rack (>= 1.0)
- rails (3.2.8)
- actionmailer (= 3.2.8)
- actionpack (= 3.2.8)
- activerecord (= 3.2.8)
- activeresource (= 3.2.8)
- activesupport (= 3.2.8)
- bundler (~> 1.0)
- railties (= 3.2.8)
- rails-backbone (0.7.0)
+ rails-backbone (0.9.10)
coffee-script (~> 2.2.0)
- ejs (~> 1.0.0)
+ ejs (~> 1.1.1)
+ jquery-rails (~> 2.1.3)
railties (>= 3.1.0)
rails-behaviors (0.4.1)
coffee-script-source (~> 1.1)
sprockets (~> 2.0)
- railties (3.2.8)
- actionpack (= 3.2.8)
- activesupport (= 3.2.8)
- rack-ssl (~> 1.3.2)
- rake (>= 0.8.7)
- rdoc (~> 3.4)
- thor (>= 0.14.6, < 2.0)
- rake (0.9.2.2)
- rdoc (3.12)
+ rake (10.0.3)
+ rdoc (3.12.2)
json (~> 1.4)
- redis (3.0.2)
+ redis (3.0.3)
redis-namespace (1.2.1)
redis (~> 3.0.0)
rest-client (1.6.7)
mime-types (>= 1.16)
- sass (3.2.1)
- sass-rails (3.2.5)
- railties (~> 3.2.0)
- sass (>= 3.1.10)
- tilt (~> 1.3)
- sidekiq (2.3.3)
+ sass (3.3.0.alpha.101)
+ sidekiq (2.8.0)
celluloid (~> 0.12.0)
- connection_pool (~> 0.9.2)
+ connection_pool (~> 1.0)
multi_json (~> 1)
redis (~> 3)
redis-namespace
simple_oauth (0.1.9)
- sinatra (1.3.3)
- rack (~> 1.3, >= 1.3.6)
- rack-protection (~> 1.2)
+ sinatra (1.3.5)
+ rack (~> 1.4)
+ rack-protection (~> 1.3)
tilt (~> 1.3, >= 1.3.3)
slim (1.3.0)
temple (~> 0.4.1)
tilt (~> 1.3.3)
- slop (2.4.4)
- springboard (0.18.7.1)
- sprockets (2.1.3)
+ slop (3.4.3)
+ springboard (0.20.5)
+ sprockets (2.9.0)
hike (~> 1.2)
+ multi_json (~> 1.0)
rack (~> 1.0)
tilt (~> 1.1, != 1.3.0)
- swfobject-rails (1.1.1)
- rails (~> 3.2)
temple (0.4.1)
thin (1.5.0)
daemons (>= 1.0.9)
eventmachine (>= 0.12.6)
rack (>= 1.0.0)
- thor (0.16.0)
- tilt (1.3.3)
- timers (1.0.1)
- tire (0.3.12)
- activemodel (~> 3.0)
- multi_json (~> 1.0)
- rake
- rest-client (~> 1.6.0)
- treetop (1.4.10)
+ thor (0.17.0)
+ thread_safe (0.1.0)
+ atomic
+ tilt (1.3.4)
+ timers (1.1.0)
+ treetop (1.4.12)
polyglot
polyglot (>= 0.3.1)
- tzinfo (0.3.33)
+ tzinfo (0.3.36)
uglifier (1.3.0)
execjs (>= 0.3.0)
multi_json (~> 1.0, >= 1.0.2)
yajl-ruby (1.1.0)
- yard (0.8.1)
+ yard (0.8.5.2)
PLATFORMS
ruby
DEPENDENCIES
animation (~> 0.1.alpha.3)
+ bourbon
capistrano
- coffee-rails
- compass-rails
+ coffee-rails!
connection_pool
execjs
faraday
@@ -315,7 +375,7 @@ DEPENDENCIES
faye-redis
foreigner
foreman
- haml (= 3.2.0.beta.3)
+ haml!
jazz_hands
jquery-rails
nokogiri
@@ -324,18 +384,21 @@ DEPENDENCIES
pandora_client
patron
pg
+ protected_attributes
puma
- rails (= 3.2.8)
+ rails!
rails-backbone
rails-behaviors
rdio-ruby!
redis
- sass-rails
+ sass
+ sass-rails!
sidekiq
sinatra
slim (<= 1.3.0)
springboard
- swfobject-rails
+ sprockets-rails!
+ swfobject-rails!
thin
- tire
+ tire!
uglifier
diff --git a/app/assets/javascripts/templates/sources.jst.hbs.erb b/app/assets/javascripts/templates/sources.jst.hbs.erb
index bee6a07..11f7e3c 100644
--- a/app/assets/javascripts/templates/sources.jst.hbs.erb
+++ b/app/assets/javascripts/templates/sources.jst.hbs.erb
@@ -8,7 +8,7 @@
- <%= image_tag 'pandora.png' %>
+
Pandora
@@ -19,7 +19,7 @@
- <%= image_tag 'youtube.png' %>
+
YouTube
diff --git a/app/assets/javascripts/ui/application/header.js.coffee b/app/assets/javascripts/ui/application/header.js.coffee
index c6ad4ce..2300175 100644
--- a/app/assets/javascripts/ui/application/header.js.coffee
+++ b/app/assets/javascripts/ui/application/header.js.coffee
@@ -14,7 +14,7 @@ class Warble.ControlsView extends Backbone.View
animate: true
value: $('#volume').data 'volume'
stop: (e, ui) ->
- $.ajax '/jukebox/volume'
+ $.ajax '/jukebox/volume',
type: 'put'
data:
value: ui.value
diff --git a/app/assets/javascripts/utils/spinner.js.coffee.erb b/app/assets/javascripts/utils/spinner.js.coffee.erb
index 0ff489e..39a10e7 100644
--- a/app/assets/javascripts/utils/spinner.js.coffee.erb
+++ b/app/assets/javascripts/utils/spinner.js.coffee.erb
@@ -12,7 +12,7 @@ Utils.toggleLoadingSpinner = (show) ->
if !spinner.size()
spinner = $("""
- <%= image_tag('spinner-small-white.png', alt: 'loading...', class: 'spinner') %>
+
""").appendTo(el)
# content.toggleClass 'mask', show
diff --git a/app/assets/stylesheets/application.css.sass b/app/assets/stylesheets/application.css.sass
index cc54ec5..e89ad29 100644
--- a/app/assets/stylesheets/application.css.sass
+++ b/app/assets/stylesheets/application.css.sass
@@ -1,7 +1,23 @@
@import 'pictos'
@import 'roboto'
-@import 'compass'
-@import 'compass/reset'
+@import 'bourbon'
+
+= border-radius($radii: 3px)
+ border-radius: $radii
+
+= border-top-right-radius($rad: 3px)
+ border-top-left-radius: $rad
+
+= border-top-left-radius($rad: 3px)
+ border-top-left-radius: $rad
+
+= text-shadow($arg)
+ text-shadow: $arg
+
+= ellipsis
+
+// @import 'compass'
+// @import 'compass/reset'
@import 'effects'
@import 'spinner'
@import 'slider'
@@ -256,7 +272,6 @@ span.pictos
margin-right: 20px
#artist, #title
- @extend .ultralight
+text-shadow(#FFF 0px 1px 1px)
+ellipsis
diff --git a/app/assets/stylesheets/effects.sass b/app/assets/stylesheets/effects.sass
index 09164e0..33b43df 100644
--- a/app/assets/stylesheets/effects.sass
+++ b/app/assets/stylesheets/effects.sass
@@ -1,12 +1,6 @@
-// TODO: Switch to https://github.com/ericam/compass-animate
-// whenever we upgrade to Compass 0.13
-
-@import "animation"
-@import "animation/animate/attention-seekers"
-@import "animation/animate/flippers"
-@import "animation/animate/fading"
-@import "animation/animate/rotating"
-
+= rotate($deg)
+= keyframes($name)
+ @content
// -------------------------------------------------
// EFFECTS
// -------------------------------------------------
diff --git a/config/boot.rb b/config/boot.rb
index 4489e58..3596736 100644
--- a/config/boot.rb
+++ b/config/boot.rb
@@ -1,5 +1,3 @@
-require 'rubygems'
-
# Set up gems listed in the Gemfile.
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
diff --git a/config/environments/development.rb b/config/environments/development.rb
index f9057a5..b8ae340 100644
--- a/config/environments/development.rb
+++ b/config/environments/development.rb
@@ -5,9 +5,7 @@
# every request. This slows down response time but is perfect for development
# since you don't have to restart the web server when you make code changes.
config.cache_classes = false
-
- # Log error messages when you accidentally call methods on nil.
- config.whiny_nils = true
+ config.eager_load = false
# Show full error reports and disable caching
config.consider_all_requests_local = true
@@ -25,10 +23,6 @@
# Raise exception on mass assignment protection for Active Record models
config.active_record.mass_assignment_sanitizer = :strict
- # Log the query plan for queries taking more than this (works
- # with SQLite, MySQL, and PostgreSQL)
- config.active_record.auto_explain_threshold_in_seconds = 0.5
-
# Do not compress assets
config.assets.compress = false
diff --git a/config/environments/production.rb b/config/environments/production.rb
index 5674be7..d33da72 100644
--- a/config/environments/production.rb
+++ b/config/environments/production.rb
@@ -3,6 +3,7 @@
# Code is not reloaded between requests
config.cache_classes = true
+ config.eager_load = true
# Full error reports are disabled and caching is turned on
config.consider_all_requests_local = false
diff --git a/config/environments/test.rb b/config/environments/test.rb
index 813b3d1..4109a05 100644
--- a/config/environments/test.rb
+++ b/config/environments/test.rb
@@ -6,14 +6,12 @@
# your test database is "scratch space" for the test suite and is wiped
# and recreated between test runs. Don't rely on the data there!
config.cache_classes = true
+ config.eager_load = true
# Configure static asset server for tests with Cache-Control for performance
config.serve_static_assets = true
config.static_cache_control = "public, max-age=3600"
- # Log error messages when you accidentally call methods on nil
- config.whiny_nils = true
-
# Show full error reports and disable caching
config.consider_all_requests_local = true
config.action_controller.perform_caching = false
diff --git a/config/initializers/backtrace_silencers.rb b/config/initializers/backtrace_silencers.rb
new file mode 100644
index 0000000..59385cd
--- /dev/null
+++ b/config/initializers/backtrace_silencers.rb
@@ -0,0 +1,7 @@
+# Be sure to restart your server when you modify this file.
+
+# You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
+# Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
+
+# You can also remove all the silencers if you're trying to debug a problem that might stem from framework code.
+# Rails.backtrace_cleaner.remove_silencers!
diff --git a/config/initializers/filter_parameter_logging.rb b/config/initializers/filter_parameter_logging.rb
new file mode 100644
index 0000000..4a994e1
--- /dev/null
+++ b/config/initializers/filter_parameter_logging.rb
@@ -0,0 +1,4 @@
+# Be sure to restart your server when you modify this file.
+
+# Configure sensitive parameters which will be filtered from the log file.
+Rails.application.config.filter_parameters += [:password]
diff --git a/config/initializers/inflections.rb b/config/initializers/inflections.rb
new file mode 100644
index 0000000..ac033bf
--- /dev/null
+++ b/config/initializers/inflections.rb
@@ -0,0 +1,16 @@
+# Be sure to restart your server when you modify this file.
+
+# Add new inflection rules using the following format. Inflections
+# are locale specific, and you may define rules for as many different
+# locales as you wish. All of these examples are active by default:
+# ActiveSupport::Inflector.inflections(:en) do |inflect|
+# inflect.plural /^(ox)$/i, '\1en'
+# inflect.singular /^(ox)en/i, '\1'
+# inflect.irregular 'person', 'people'
+# inflect.uncountable %w( fish sheep )
+# end
+
+# These inflection rules are supported but not enabled by default:
+# ActiveSupport::Inflector.inflections(:en) do |inflect|
+# inflect.acronym 'RESTful'
+# end
diff --git a/config/initializers/mime_types.rb b/config/initializers/mime_types.rb
new file mode 100644
index 0000000..72aca7e
--- /dev/null
+++ b/config/initializers/mime_types.rb
@@ -0,0 +1,5 @@
+# Be sure to restart your server when you modify this file.
+
+# Add new mime types for use in respond_to blocks:
+# Mime::Type.register "text/richtext", :rtf
+# Mime::Type.register_alias "text/html", :iphone
diff --git a/config/initializers/wrap_parameters.rb b/config/initializers/wrap_parameters.rb
index 999df20..33725e9 100644
--- a/config/initializers/wrap_parameters.rb
+++ b/config/initializers/wrap_parameters.rb
@@ -1,14 +1,14 @@
# Be sure to restart your server when you modify this file.
-#
+
# This file contains settings for ActionController::ParamsWrapper which
# is enabled by default.
# Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
ActiveSupport.on_load(:action_controller) do
- wrap_parameters format: [:json]
+ wrap_parameters format: [:json] if respond_to?(:wrap_parameters)
end
-# Disable root element in JSON by default.
-ActiveSupport.on_load(:active_record) do
- self.include_root_in_json = false
-end
+# To enable root element in JSON for ActiveRecord objects.
+# ActiveSupport.on_load(:active_record) do
+# self.include_root_in_json = true
+# end
diff --git a/config/locales/en.yml b/config/locales/en.yml
index 179c14c..0653957 100644
--- a/config/locales/en.yml
+++ b/config/locales/en.yml
@@ -1,5 +1,23 @@
-# Sample localization file for English. Add more files in this directory for other locales.
-# See https://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points.
+# Files in the config/locales directory are used for internationalization
+# and are automatically loaded by Rails. If you want to use locales other
+# than English, add the necessary files in this directory.
+#
+# To use the locales, use `I18n.t`:
+#
+# I18n.t 'hello'
+#
+# In views, this is aliased to just `t`:
+#
+# <%= t('hello') %>
+#
+# To use a different locale, set it with `I18n.locale`:
+#
+# I18n.locale = :es
+#
+# This would use the information in config/locales/es.yml.
+#
+# To learn more, please read the Rails Internationalization guide
+# available at http://guides.rubyonrails.org/i18n.html.
en:
hello: "Hello world"
diff --git a/config/routes.rb b/config/routes.rb
index a80e3b8..f5fa934 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -6,13 +6,13 @@
root to: 'jukeboxes#app'
# Authentication
- get 'login' => 'sessions#new', as: :login
- delete 'logout' => 'sessions#destroy', as: :logout
- match 'auth/:provider/callback' => 'sessions#create'
- match 'auth/failure' => 'sessions#failure'
+ get 'login' => 'sessions#new', as: :login
+ delete 'logout' => 'sessions#destroy', as: :logout
+ match 'auth/:provider/callback', to: 'sessions#create', via: [:get, :post]
+ get 'auth/failure', to: 'sessions#failure'
# TODO: more resource friendly?
- match 'auth/rdio-oauth2/helper' => 'jukeboxes#rdio_helper', as: :rdio_helper
+ get 'auth/rdio-oauth2/helper' => 'jukeboxes#rdio_helper', as: :rdio_helper
### ------------------------------ API ROUTES --------------------------------
@@ -50,7 +50,7 @@
resources :songs, only: :index
end
- match 'hype' => 'hype#index'
+ get 'hype' => 'hype#index'
### ------------------------ ADMINISTRATIVE ROUTES ---------------------------
@@ -93,12 +93,12 @@ def catch_all_redirect(prefix = '/')
html_format[request] &&
not_handled_by_middleware[request] &&
authenticated_user[request]
- }
+ }, via: :get
match '/*client_route' => redirect(catch_all_redirect('/login'), status: 302),
constraints: ->(request) {
html_format[request] &&
not_handled_by_middleware[request]
# ... && Unauthenticated
- }
+ }, via: :get
end
diff --git a/db/schema.rb b/db/schema.rb
index de9baca..ad24a4c 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -9,54 +9,57 @@
# from scratch. The latter is a flawed and unsustainable approach (the more migrations
# you'll amass, the slower it'll run and the greater likelihood for issues).
#
-# It's strongly recommended to check this file into your version control system.
+# It's strongly recommended that you check this file into your version control system.
-ActiveRecord::Schema.define(:version => 20120203195018) do
+ActiveRecord::Schema.define(version: 20120203195018) do
- create_table "plays", :force => true do |t|
+ # These are extensions that must be enabled in order to support this database
+ enable_extension "plpgsql"
+
+ create_table "plays", force: true do |t|
t.integer "user_id"
- t.integer "song_id", :null => false
+ t.integer "song_id", null: false
t.datetime "created_at"
- t.integer "skips", :default => 0, :null => false
+ t.integer "skips", default: 0, null: false
end
- add_index "plays", ["song_id", "user_id"], :name => "index_plays_on_song_id_and_user_id"
+ add_index "plays", ["song_id", "user_id"], name: "index_plays_on_song_id_and_user_id"
- create_table "songs", :force => true do |t|
- t.string "source", :null => false
- t.string "external_id", :null => false
- t.text "title", :null => false
+ create_table "songs", force: true do |t|
+ t.string "source", null: false
+ t.string "external_id", null: false
+ t.text "title", null: false
t.text "artist"
t.text "album"
t.text "cover_url"
t.text "url"
- t.integer "user_id", :null => false
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
+ t.integer "user_id", null: false
+ t.datetime "created_at", null: false
+ t.datetime "updated_at", null: false
end
- add_index "songs", ["source", "external_id"], :name => "index_songs_on_source_and_external_id", :unique => true
+ add_index "songs", ["source", "external_id"], name: "index_songs_on_source_and_external_id", unique: true
- create_table "users", :force => true do |t|
- t.string "facebook_id", :null => false
- t.string "first_name", :null => false
- t.string "last_name", :null => false
- t.string "email", :null => false
+ create_table "users", force: true do |t|
+ t.string "facebook_id", null: false
+ t.string "first_name", null: false
+ t.string "last_name", null: false
+ t.string "email", null: false
t.string "photo_url"
t.string "pandora_username"
t.string "pandora_password"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
+ t.datetime "created_at", null: false
+ t.datetime "updated_at", null: false
end
- add_index "users", ["facebook_id"], :name => "index_users_on_facebook_id", :unique => true
+ add_index "users", ["facebook_id"], name: "index_users_on_facebook_id", unique: true
- create_table "votes", :force => true do |t|
- t.integer "user_id", :null => false
- t.integer "song_id", :null => false
- t.datetime "created_at", :null => false
+ create_table "votes", force: true do |t|
+ t.integer "user_id", null: false
+ t.integer "song_id", null: false
+ t.datetime "created_at", null: false
end
- add_index "votes", ["song_id", "user_id"], :name => "index_votes_on_song_id_and_user_id", :unique => true
+ add_index "votes", ["song_id", "user_id"], name: "index_votes_on_song_id_and_user_id", unique: true
end