diff --git a/Gemfile b/Gemfile index 93efed1e..ee42dc4e 100644 --- a/Gemfile +++ b/Gemfile @@ -1,6 +1,6 @@ source 'https://rubygems.org' -gem 'rails', '3.2.13' +gem 'rails', '4.0.2' gem 'rack-cors', :require => 'rack/cors' # Bundle edge Rails instead: @@ -17,10 +17,10 @@ gem 'slim-rails' # Gems used only for assets and not required # in production environments by default. group :assets do - gem 'sass-rails', '~> 3.2.3' - gem 'coffee-rails', '~> 3.2.1' + gem 'sass-rails' #, '~> 3.2.3' + gem 'coffee-rails' #, '~> 3.2.1' #gem 'twitter-bootstrap-rails' - gem 'bootstrap-sass' + gem 'bootstrap-sass', '~>2.3.2.2' gem 'bourbon' gem 'compass-rails' gem 'js-routes' @@ -38,7 +38,7 @@ end gem 'couch_potato' , github: 'bterkuile/couch_potato' gem 'simply_stored' , github: 'bterkuile/simply_stored' gem 'orm_adapter', github: 'bterkuile/orm_adapter' -gem 'devise', '3.1.0' #, '2.0.4' +gem 'devise' #, '3.1.0' #, '2.0.4' gem 'devise_simply_stored', github: 'bterkuile/devise_simply_stored' gem "omniauth-facebook" gem 'simple_form' @@ -70,11 +70,13 @@ group :test do #gem 'steak' gem 'rspec-rails' gem 'database_cleaner' - gem 'capybara-webkit' + gem 'capybara' #, '2.0.3' + gem 'selenium-webdriver' + #gem 'capybara-webkit', '~>0.14.2' # version 1.1.0 does not yet compile in mavericks gem 'turnip' gem 'launchy' gem 'fuubar' - gem 'rb-fsevent', :require => false #if RUBY_PLATFORM =~ /darwin/i + #gem 'rb-fsevent', :require => false #if RUBY_PLATFORM =~ /darwin/i gem 'factory_girl_rails' gem 'pry-rails' end diff --git a/Gemfile.lock b/Gemfile.lock index 76a9d611..09c3ebc0 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -49,38 +49,35 @@ PATH GEM remote: https://rubygems.org/ specs: - actionmailer (3.2.13) - actionpack (= 3.2.13) - mail (~> 2.5.3) - actionpack (3.2.13) - activemodel (= 3.2.13) - activesupport (= 3.2.13) - builder (~> 3.0.0) + actionmailer (4.0.2) + actionpack (= 4.0.2) + mail (~> 2.5.4) + actionpack (4.0.2) + activesupport (= 4.0.2) + builder (~> 3.1.0) erubis (~> 2.7.0) - journey (~> 1.0.4) - rack (~> 1.4.5) - rack-cache (~> 1.2) - rack-test (~> 0.6.1) - sprockets (~> 2.2.1) + rack (~> 1.5.2) + rack-test (~> 0.6.2) active_decorator (0.3.4) active_model_serializers (0.8.1) activemodel (>= 3.0) - activemodel (3.2.13) - activesupport (= 3.2.13) - builder (~> 3.0.0) - activerecord (3.2.13) - activemodel (= 3.2.13) - activesupport (= 3.2.13) - arel (~> 3.0.2) - tzinfo (~> 0.3.29) - activeresource (3.2.13) - activemodel (= 3.2.13) - activesupport (= 3.2.13) - activesupport (3.2.13) - i18n (= 0.6.1) - multi_json (~> 1.0) + activemodel (4.0.2) + activesupport (= 4.0.2) + builder (~> 3.1.0) + activerecord (4.0.2) + activemodel (= 4.0.2) + activerecord-deprecated_finders (~> 1.0.2) + activesupport (= 4.0.2) + arel (~> 4.0.0) + activerecord-deprecated_finders (1.0.3) + activesupport (4.0.2) + i18n (~> 0.6, >= 0.6.4) + minitest (~> 4.2) + multi_json (~> 1.3) + thread_safe (~> 0.1) + tzinfo (~> 0.3.37) addressable (2.3.5) - arel (3.0.2) + arel (4.0.1) atomic (1.1.14) barber (0.4.2) ember-source @@ -95,25 +92,24 @@ GEM bourbon (3.1.8) sass (>= 3.2.0) thor - builder (3.0.4) - capybara (2.1.0) + builder (3.1.4) + capybara (2.2.0) mime-types (>= 1.16) nokogiri (>= 1.3.3) rack (>= 1.0.0) rack-test (>= 0.5.4) xpath (~> 2.0) - capybara-webkit (1.0.0) - capybara (~> 2.0, >= 2.0.2) - json - chunky_png (1.2.8) + childprocess (0.3.9) + ffi (~> 1.0, >= 1.0.11) + chunky_png (1.2.9) climate_control (0.0.3) activesupport (>= 3.0) - cocaine (0.5.2) + cocaine (0.5.3) climate_control (>= 0.0.3, < 1.0) - coderay (1.0.9) - coffee-rails (3.2.2) + coderay (1.1.0) + coffee-rails (4.0.1) coffee-script (>= 2.2.0) - railties (~> 3.2.0) + railties (>= 4.0.0, < 5.0) coffee-script (2.2.0) coffee-script-source execjs @@ -122,23 +118,23 @@ GEM chunky_png (~> 1.2) fssm (>= 0.2.7) sass (~> 3.1) - compass-rails (1.0.3) - compass (>= 0.12.2, < 0.14) + compass-rails (1.1.2) + compass (>= 0.12.2) cookiejar (0.3.0) couchrest (1.2.0) mime-types (~> 1.15) multi_json (~> 1.0) rest-client (~> 1.6.1) daemons (1.1.9) - database_cleaner (1.1.1) - devise (3.1.0) + database_cleaner (1.2.0) + devise (3.2.2) bcrypt-ruby (~> 3.0) orm_adapter (~> 0.1) railties (>= 3.2.6, < 5) thread_safe (~> 0.1) warden (~> 1.2.3) - diff-lcs (1.2.4) - em-http-request (1.1.0) + diff-lcs (1.2.5) + em-http-request (1.1.1) addressable (>= 2.3.4) cookiejar em-socksify (>= 0.3) @@ -150,147 +146,138 @@ GEM activemodel ember-data-source (0.14) ember-source - ember-rails (0.13.0) + ember-rails (0.14.1) active_model_serializers barber (>= 0.4.1) ember-data-source ember-source execjs (>= 1.2) handlebars-source + jquery-rails (>= 1.0.17) railties (>= 3.1) - ember-source (1.0.0) - handlebars-source (= 1.0.12) - emblem-rails (0.1.1) + ember-source (1.2.0.1) + handlebars-source (~> 1.1.2) + emblem-rails (0.2.1) barber-emblem (~> 0.1.1) - ember-rails (>= 0.11.1) - emblem-source (0.3.2) + ember-rails (>= 0.14.0) + emblem-source (0.3.5) erubis (2.7.0) eventmachine (1.0.3) - execjs (2.0.1) - factory_girl (4.2.0) + execjs (2.0.2) + factory_girl (4.3.0) activesupport (>= 3.0.0) - factory_girl_rails (4.2.1) - factory_girl (~> 4.2.0) + factory_girl_rails (4.3.0) + factory_girl (~> 4.3.0) railties (>= 3.0.0) - faraday (0.8.7) - multipart-post (~> 1.1) - faye (0.8.9) + faraday (0.8.8) + multipart-post (~> 1.2.0) + faye (1.0.1) cookiejar (>= 0.3.0) em-http-request (>= 0.3.0) eventmachine (>= 0.12.0) - faye-websocket (>= 0.4.0) + faye-websocket (>= 0.7.0) + multi_json (>= 1.0.0) rack (>= 1.0.0) - yajl-ruby (>= 1.0.0) - faye-websocket (0.7.0) - eventmachine (>= 0.12.0) websocket-driver (>= 0.3.0) + faye-websocket (0.7.1) + eventmachine (>= 0.12.0) + websocket-driver (>= 0.3.1) + ffi (1.9.3) fssm (0.2.10) - fuubar (1.1.1) - rspec (~> 2.0) - rspec-instafail (~> 0.2.0) - ruby-progressbar (~> 1.0) - gherkin (2.12.1) + fuubar (1.3.0) + rspec (>= 2.14.0, < 3.1.0) + ruby-progressbar (~> 1.3) + gherkin (2.12.2) multi_json (~> 1.3) - haml (4.0.3) + haml (4.0.4) tilt - haml-rails (0.4) - actionpack (>= 3.1, < 4.1) - activesupport (>= 3.1, < 4.1) - haml (>= 3.1, < 4.1) - railties (>= 3.1, < 4.1) - handlebars-source (1.0.12) - hashie (1.2.0) + haml-rails (0.5.2) + actionpack (~> 4.0.1) + activesupport (~> 4.0.1) + haml (>= 3.1, < 5.0) + railties (~> 4.0.1) + handlebars-source (1.1.2) + hashie (2.0.5) hike (1.2.3) - http_parser.rb (0.6.0.beta.2) - httpauth (0.1) - i18n (0.6.1) - journey (1.0.4) + http_parser.rb (0.6.0) + httpauth (0.2.0) + i18n (0.6.9) jquery-rails (3.0.4) railties (>= 3.0, < 5.0) thor (>= 0.14, < 2.0) - jquery-ui-rails (4.0.4) - jquery-rails + jquery-ui-rails (4.1.1) railties (>= 3.1.0) - js-routes (0.9.0) + js-routes (0.9.6) rails (>= 3.2) json (1.8.1) jwt (0.1.8) multi_json (>= 1.5) - kaminari (0.14.1) + kaminari (0.15.0) actionpack (>= 3.0.0) activesupport (>= 3.0.0) - launchy (2.3.0) + launchy (2.4.2) addressable (~> 2.3) - letter_opener (1.1.2) + letter_opener (1.2.0) launchy (~> 2.2) mail (2.5.4) mime-types (~> 1.16) treetop (~> 1.4.8) method_source (0.8.2) - mime-types (1.25) - mini_magick (3.6.0) + mime-types (1.25.1) + mini_magick (3.7.0) subexec (~> 0.2.1) - mini_portile (0.5.1) - multi_json (1.8.0) + mini_portile (0.5.2) + minitest (4.7.5) + multi_json (1.8.2) multipart-post (1.2.0) - nokogiri (1.6.0) + nokogiri (1.6.1) mini_portile (~> 0.5.0) - 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) - hashie (~> 1.2) + omniauth (1.1.4) + hashie (>= 1.2, < 3) rack - omniauth-facebook (1.4.1) + omniauth-facebook (1.5.1) omniauth-oauth2 (~> 1.1.0) - omniauth-oauth2 (1.1.0) + omniauth-oauth2 (1.1.1) oauth2 (~> 0.8.0) omniauth (~> 1.0) - paperclip (3.5.1) + paperclip (3.5.2) activemodel (>= 3.0.0) activesupport (>= 3.0.0) - cocaine (~> 0.5.0) + cocaine (~> 0.5.3) mime-types polyglot (0.3.3) - pry (0.9.12.2) - coderay (~> 1.0.5) + pry (0.9.12.4) + coderay (~> 1.0) method_source (~> 0.8) slop (~> 3.4) pry-rails (0.3.2) pry (>= 0.9.10) quiet_assets (1.0.2) railties (>= 3.1, < 5.0) - rack (1.4.5) - rack-cache (1.2) - rack (>= 0.4) - rack-cors (0.2.8) - rack - rack-ssl (1.3.3) - rack + rack (1.5.2) + rack-cors (0.2.9) rack-test (0.6.2) rack (>= 1.0) - rails (3.2.13) - actionmailer (= 3.2.13) - actionpack (= 3.2.13) - activerecord (= 3.2.13) - activeresource (= 3.2.13) - activesupport (= 3.2.13) - bundler (~> 1.0) - railties (= 3.2.13) - railties (3.2.13) - actionpack (= 3.2.13) - activesupport (= 3.2.13) - rack-ssl (~> 1.3.2) + rails (4.0.2) + actionmailer (= 4.0.2) + actionpack (= 4.0.2) + activerecord (= 4.0.2) + activesupport (= 4.0.2) + bundler (>= 1.3.0, < 2.0) + railties (= 4.0.2) + sprockets-rails (~> 2.0.0) + railties (4.0.2) + actionpack (= 4.0.2) + activesupport (= 4.0.2) rake (>= 0.8.7) - rdoc (~> 3.4) - thor (>= 0.14.6, < 2.0) + thor (>= 0.18.1, < 2.0) rake (10.1.0) - rb-fsevent (0.9.3) - rdoc (3.12.2) - json (~> 1.4) rest-client (1.6.7) mime-types (>= 1.16) rqrcode (0.4.2) @@ -298,11 +285,10 @@ GEM rspec-core (~> 2.14.0) rspec-expectations (~> 2.14.0) rspec-mocks (~> 2.14.0) - rspec-core (2.14.5) - rspec-expectations (2.14.2) + rspec-core (2.14.7) + rspec-expectations (2.14.4) diff-lcs (>= 1.1.3, < 2.0) - rspec-instafail (0.2.4) - rspec-mocks (2.14.3) + rspec-mocks (2.14.4) rspec-rails (2.14.0) actionpack (>= 3.0) activesupport (>= 3.0) @@ -310,40 +296,50 @@ GEM rspec-core (~> 2.14.0) rspec-expectations (~> 2.14.0) rspec-mocks (~> 2.14.0) - ruby-progressbar (1.1.1) - sass (3.2.10) - sass-rails (3.2.6) - railties (~> 3.2.0) + ruby-progressbar (1.3.2) + rubyzip (1.1.0) + sass (3.2.12) + sass-rails (4.0.1) + railties (>= 4.0.0, < 5.0) sass (>= 3.1.10) - tilt (~> 1.3) - simple_form (2.1.0) - actionpack (~> 3.0) - activemodel (~> 3.0) - slim (2.0.1) + sprockets-rails (~> 2.0.0) + selenium-webdriver (2.38.0) + childprocess (>= 0.2.5) + multi_json (~> 1.0) + rubyzip (~> 1.0) + websocket (~> 1.0.4) + simple_form (3.0.1) + actionpack (>= 4.0.0, < 4.1) + activemodel (>= 4.0.0, < 4.1) + slim (2.0.2) temple (~> 0.6.6) tilt (>= 1.3.3, < 2.1) - slim-rails (2.0.1) + slim-rails (2.0.4) actionpack (>= 3.0, < 4.1) activesupport (>= 3.0, < 4.1) railties (>= 3.0, < 4.1) slim (~> 2.0) - slop (3.4.6) - sprockets (2.2.2) + slop (3.4.7) + sprockets (2.10.1) hike (~> 1.2) multi_json (~> 1.0) rack (~> 1.0) tilt (~> 1.1, != 1.3.0) + sprockets-rails (2.0.1) + actionpack (>= 3.0) + activesupport (>= 3.0) + sprockets (~> 2.8) subexec (0.2.3) - temple (0.6.6) - thin (1.5.1) + temple (0.6.7) + thin (1.6.1) daemons (>= 1.0.9) - eventmachine (>= 0.12.6) + eventmachine (>= 1.0.0) rack (>= 1.0.0) thor (0.18.1) thread_safe (0.1.3) atomic tilt (1.4.1) - tinymce-rails (4.0.6) + tinymce-rails (4.0.11) railties (>= 3.1.1) treetop (1.4.15) polyglot @@ -351,31 +347,31 @@ GEM turnip (1.1.0) gherkin (>= 2.5) rspec (~> 2.0) - tzinfo (0.3.37) - uglifier (2.2.1) + tzinfo (0.3.38) + uglifier (2.3.3) execjs (>= 0.3.0) - multi_json (~> 1.0, >= 1.0.2) + json (>= 1.8.0) warden (1.2.3) rack (>= 1.0) - websocket-driver (0.3.0) + websocket (1.0.7) + websocket-driver (0.3.1) xpath (2.0.0) nokogiri (~> 1.3) - yajl-ruby (1.1.0) PLATFORMS ruby DEPENDENCIES active_decorator - bootstrap-sass + bootstrap-sass (~> 2.3.2.2) bourbon - capybara-webkit + capybara cmtool! - coffee-rails (~> 3.2.1) + coffee-rails compass-rails couch_potato! database_cleaner - devise (= 3.1.0) + devise devise_simply_stored! ember-rails ember-source @@ -395,11 +391,11 @@ DEPENDENCIES pry-rails quiet_assets rack-cors - rails (= 3.2.13) - rb-fsevent + rails (= 4.0.2) rqrcode rspec-rails - sass-rails (~> 3.2.3) + sass-rails + selenium-webdriver simple_form simply_stored! slim-rails diff --git a/app/assets/stylesheets/theme1/bootstrap_and_overrides.css.sass b/app/assets/stylesheets/theme1/bootstrap_and_overrides.css.sass index bdd7a399..2f1ed054 100644 --- a/app/assets/stylesheets/theme1/bootstrap_and_overrides.css.sass +++ b/app/assets/stylesheets/theme1/bootstrap_and_overrides.css.sass @@ -1,8 +1,7 @@ @import bootstrap body .nav - > li + > li > a &:hover background-color: transparent -@import bootstrap-responsive diff --git a/app/models/user.rb b/app/models/user.rb index 2f88886c..f6dc68f8 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -12,7 +12,7 @@ class User property :oauth_expires_at property :auth_data - devise :database_authenticatable, :recoverable, :rememberable, :trackable, :token_authenticatable, :omniauthable, :omniauth_providers => [:facebook] # , :registerable + devise :database_authenticatable, :recoverable, :rememberable, :trackable, :omniauthable, :omniauth_providers => [:facebook] #, :token_authenticatable , :registerable property :authentication_token @@ -58,4 +58,33 @@ class User def has_active_list? active_list_id.present? end + + ##################################### + # Taken from devise 2.2 + ##################################### + + # Generate new authentication token (a.k.a. "single access token"). + def reset_authentication_token + self.authentication_token = self.class.authentication_token + end + + # Generate new authentication token and save the record. + def reset_authentication_token! + reset_authentication_token + save(:validate => false) + end + + # Generate authentication token unless already exists. + def ensure_authentication_token + reset_authentication_token if authentication_token.blank? + end + + # Generate authentication token unless already exists and save the record. + def ensure_authentication_token! + reset_authentication_token! if authentication_token.blank? + end + + def self.authentication_token + SecureRandom.hex(24) + end end diff --git a/config/application.rb b/config/application.rb index 0fceb5aa..b980e179 100644 --- a/config/application.rb +++ b/config/application.rb @@ -5,7 +5,7 @@ require 'rails' #require 'active_record/railtie' require 'action_controller/railtie' require 'action_mailer/railtie' -require 'active_resource/railtie' +#require 'active_resource/railtie' require 'rails/test_unit/railtie' require 'sprockets/railtie' diff --git a/config/initializers/model_human_plural.rb b/config/initializers/model_human_plural.rb index 9ae2309d..b66a4b77 100644 --- a/config/initializers/model_human_plural.rb +++ b/config/initializers/model_human_plural.rb @@ -1,7 +1,7 @@ module ActiveModel class Name def human_plural - I18n.t("activemodel.models.plural.#{underscore.gsub('/', '.')}", :default => nil ) || human.pluralize + @human_plural ||= (I18n.t("activemodel.models.plural.#{i18n_key.to_s.gsub('/', '.')}", :default => nil ) || human.pluralize) end end end diff --git a/faye/config.ru b/faye/config.ru index d47d271b..11920c6a 100644 --- a/faye/config.ru +++ b/faye/config.ru @@ -13,6 +13,6 @@ class ServerAuth end faye_server = Faye::RackAdapter.new(mount: '/faye', timeout: 45) -faye_server.listen 9296 +#faye_server.listen 9296 faye_server.add_extension(ServerAuth.new) run faye_server diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 24d7a62e..b61c9e27 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -14,8 +14,8 @@ Dir.glob("spec/acceptance_steps/**/*steps.rb") { |f| load f, true } I18n.locale =I18n.default_locale Devise.stretches = 1 -Capybara.javascript_driver = :webkit -#Capybara.default_driver = :selenium +#Capybara.javascript_driver = :webkit +Capybara.javascript_driver = :selenium module FactoryAttributesFor def attributes_for(obj, options={})