diff --git a/.gitignore b/.gitignore
index cce3516..dc1f87d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -27,8 +27,11 @@ db/*.sqlite3
.rspec
.redcar/
.sass-cache
-/config/config.yml
+/config/application.yml
/config/database.yml
+/config/config.yml
+/config/local_env.yml
+/config/secrets.yml
/coverage.data
/coverage/
/db/*.javadb/
@@ -37,6 +40,7 @@ db/*.sqlite3
/doc/app/
/doc/features.html
/doc/specs.html
+/fork_data
/public/cache
/public/stylesheets/compiled
/public/system/*
@@ -72,6 +76,3 @@ pickle-email-*.html
# vim artifacts
**.swp
-
-# Ignore application configuration
-/config/application.yml
diff --git a/.ruby-gemset b/.ruby-gemset
index 1f0d951..d5c6ad2 100644
--- a/.ruby-gemset
+++ b/.ruby-gemset
@@ -1 +1 @@
-rails-prelaunch-signup
+Rails4.2_prelaunch
diff --git a/.ruby-version b/.ruby-version
index 227cea2..c043eea 100644
--- a/.ruby-version
+++ b/.ruby-version
@@ -1 +1 @@
-2.0.0
+2.2.1
diff --git a/Gemfile b/Gemfile
index ad6b4bb..a34ab17 100644
--- a/Gemfile
+++ b/Gemfile
@@ -1,27 +1,39 @@
source 'https://rubygems.org'
-gem 'rails', '3.2.13'
+ruby '2.2.1'
+gem 'rails', '4.2.1'
+gem 'rubyzip', '~> 1.0.0'
gem 'sqlite3'
-group :assets do
- gem 'sass-rails', '~> 3.2.3'
- gem 'coffee-rails', '~> 3.2.1'
- gem 'uglifier', '>= 1.0.3'
+group :development, :test do
+ gem 'binding_of_caller', '~> 0.7.2', platforms: [:mri_19, :rbx]
+ gem 'rspec-rails', '>= 2.12.2'
+ gem 'sass-rails', '~> 5.0'
+ gem 'factory_girl_rails', '>= 4.2.0'
end
+group :test do
+ gem 'cucumber-rails', '>= 1.3.1', require: false
+ gem 'capybara', '>= 2.0.3'
+ gem 'database_cleaner', '>= 1.0.0.RC1'
+ gem 'email_spec', '>= 1.4.0'
+ gem 'launchy', '>= 2.2.0'
+ gem 'pry'
+end
+group :development do
+ gem 'quiet_assets', '>= 1.0.2'
+ gem 'better_errors', '>= 0.7.2'
+ gem 'spring', '~> 1.3.4'
+end
+gem 'bootstrap-sass', '~> 3.3.4.1'
+gem 'cancan', '>= 1.6.9'
+gem 'coffee-rails', '~> 4.1.0'
+gem 'devise', '>= 2.2.3'
+gem 'gibbon', git: 'git://github.com/amro/gibbon.git'
gem 'jquery-rails'
-gem "rspec-rails", ">= 2.12.2", :group => [:development, :test]
-gem "database_cleaner", ">= 1.0.0.RC1", :group => :test
-gem "email_spec", ">= 1.4.0", :group => :test
-gem "cucumber-rails", ">= 1.3.1", :group => :test, :require => false
-gem "launchy", ">= 2.2.0", :group => :test
-gem "capybara", ">= 2.0.3", :group => :test
-gem "factory_girl_rails", ">= 4.2.0", :group => [:development, :test]
-gem "bootstrap-sass", ">= 2.3.0.0"
-gem "devise", ">= 2.2.3"
-gem "cancan", ">= 1.6.9"
-gem "rolify", ">= 3.2.0"
-gem "simple_form", ">= 2.1.0"
-gem "gibbon", ">= 0.4.2"
-gem "selenium-webdriver", "~> 2.32.1"
-gem "quiet_assets", ">= 1.0.2", :group => :development
-gem "figaro", ">= 0.6.3"
-gem "better_errors", ">= 0.7.2", :group => :development
-gem "binding_of_caller", ">= 0.7.1", :group => :development, :platforms => [:mri_19, :rbx]
\ No newline at end of file
+gem 'protected_attributes'
+gem 'railties', '~> 4.2.0'
+gem 'rolify', '>= 3.2.0'
+gem 'responders', '~> 2.0'
+gem 'rubygems-update', '~> 2.4.6'
+gem 'selenium-webdriver', '~> 2.45.0'
+gem 'simple_form', '>= 2.1.0'
+gem 'uglifier', '~> 2.7.1'
+gem 'web-console', '~> 2.0'
\ No newline at end of file
diff --git a/Gemfile.lock b/Gemfile.lock
index ce95bad..4cf214d 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -1,191 +1,242 @@
+GIT
+ remote: git://github.com/amro/gibbon.git
+ revision: 1d8ee00f576d354d5cc1f5bd1ec166d8565db1ca
+ specs:
+ gibbon (1.1.5)
+ httparty
+ multi_json (>= 1.9.0)
+
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.2.1)
+ actionpack (= 4.2.1)
+ actionview (= 4.2.1)
+ activejob (= 4.2.1)
+ mail (~> 2.5, >= 2.5.4)
+ rails-dom-testing (~> 1.0, >= 1.0.5)
+ actionpack (4.2.1)
+ actionview (= 4.2.1)
+ activesupport (= 4.2.1)
+ rack (~> 1.6)
+ rack-test (~> 0.6.2)
+ rails-dom-testing (~> 1.0, >= 1.0.5)
+ rails-html-sanitizer (~> 1.0, >= 1.0.1)
+ actionview (4.2.1)
+ activesupport (= 4.2.1)
+ builder (~> 3.1)
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)
- 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)
- addressable (2.3.4)
- arel (3.0.2)
- bcrypt-ruby (3.0.1)
- better_errors (0.8.0)
+ rails-dom-testing (~> 1.0, >= 1.0.5)
+ rails-html-sanitizer (~> 1.0, >= 1.0.1)
+ activejob (4.2.1)
+ activesupport (= 4.2.1)
+ globalid (>= 0.3.0)
+ activemodel (4.2.1)
+ activesupport (= 4.2.1)
+ builder (~> 3.1)
+ activerecord (4.2.1)
+ activemodel (= 4.2.1)
+ activesupport (= 4.2.1)
+ arel (~> 6.0)
+ activesupport (4.2.1)
+ i18n (~> 0.7)
+ json (~> 1.7, >= 1.7.7)
+ minitest (~> 5.1)
+ thread_safe (~> 0.3, >= 0.3.4)
+ tzinfo (~> 1.1)
+ addressable (2.3.8)
+ arel (6.0.0)
+ autoprefixer-rails (5.1.9)
+ execjs
+ json
+ bcrypt (3.1.10)
+ better_errors (2.1.1)
coderay (>= 1.0.0)
erubis (>= 2.6.6)
- binding_of_caller (0.7.1)
+ rack (>= 0.9.0)
+ binding_of_caller (0.7.2)
debug_inspector (>= 0.0.1)
- bootstrap-sass (2.3.1.0)
- sass (~> 3.2)
- builder (3.0.4)
+ bootstrap-sass (3.3.4.1)
+ autoprefixer-rails (>= 5.0.0.1)
+ sass (>= 3.2.19)
+ builder (3.2.2)
cancan (1.6.10)
- capybara (2.1.0)
+ capybara (2.4.4)
mime-types (>= 1.16)
nokogiri (>= 1.3.3)
rack (>= 1.0.0)
rack-test (>= 0.5.4)
xpath (~> 2.0)
- childprocess (0.3.9)
+ childprocess (0.5.6)
ffi (~> 1.0, >= 1.0.11)
- coderay (1.0.9)
- coffee-rails (3.2.2)
+ coderay (1.1.0)
+ coffee-rails (4.1.0)
coffee-script (>= 2.2.0)
- railties (~> 3.2.0)
- coffee-script (2.2.0)
+ railties (>= 4.0.0, < 5.0)
+ coffee-script (2.4.1)
coffee-script-source
execjs
- coffee-script-source (1.6.2)
- cucumber (1.3.2)
+ coffee-script-source (1.9.1.1)
+ cucumber (1.3.19)
builder (>= 2.1.2)
diff-lcs (>= 1.1.3)
- gherkin (~> 2.12.0)
- multi_json (~> 1.3)
- cucumber-rails (1.3.1)
- capybara (>= 1.1.2)
- cucumber (>= 1.2.0)
- nokogiri (>= 1.5.0)
- rails (~> 3.0)
- database_cleaner (1.0.1)
+ gherkin (~> 2.12)
+ multi_json (>= 1.7.5, < 2.0)
+ multi_test (>= 0.1.2)
+ cucumber-rails (1.4.2)
+ capybara (>= 1.1.2, < 3)
+ cucumber (>= 1.3.8, < 2)
+ mime-types (>= 1.16, < 3)
+ nokogiri (~> 1.5)
+ rails (>= 3, < 5)
+ database_cleaner (1.4.1)
debug_inspector (0.0.2)
- devise (2.2.4)
- bcrypt-ruby (~> 3.0)
+ devise (3.4.1)
+ bcrypt (~> 3.0)
orm_adapter (~> 0.1)
- railties (~> 3.1)
- warden (~> 1.2.1)
- diff-lcs (1.2.4)
- email_spec (1.4.0)
+ railties (>= 3.2.6, < 5)
+ responders
+ thread_safe (~> 0.1)
+ warden (~> 1.2.3)
+ diff-lcs (1.2.5)
+ email_spec (1.6.0)
launchy (~> 2.1)
mail (~> 2.2)
erubis (2.7.0)
- execjs (1.4.0)
- multi_json (~> 1.0)
- factory_girl (4.2.0)
+ execjs (2.5.2)
+ factory_girl (4.5.0)
activesupport (>= 3.0.0)
- factory_girl_rails (4.2.1)
- factory_girl (~> 4.2.0)
+ factory_girl_rails (4.5.0)
+ factory_girl (~> 4.5.0)
railties (>= 3.0.0)
- ffi (1.8.1)
- figaro (0.6.4)
- bundler (~> 1.0)
- rails (>= 3, < 5)
- gherkin (2.12.0)
+ ffi (1.9.8)
+ gherkin (2.12.2)
multi_json (~> 1.3)
- gibbon (0.4.6)
- httparty
- multi_json (>= 1.3.4)
- hike (1.2.2)
- httparty (0.11.0)
- multi_json (~> 1.0)
+ globalid (0.3.5)
+ activesupport (>= 4.1.0)
+ httparty (0.13.3)
+ json (~> 1.8)
multi_xml (>= 0.5.2)
- i18n (0.6.1)
- journey (1.0.4)
- jquery-rails (2.2.1)
- railties (>= 3.0, < 5.0)
+ i18n (0.7.0)
+ jquery-rails (4.0.3)
+ rails-dom-testing (~> 1.0)
+ railties (>= 4.2.0)
thor (>= 0.14, < 2.0)
- json (1.8.0)
- launchy (2.3.0)
+ json (1.8.2)
+ launchy (2.4.3)
addressable (~> 2.3)
- mail (2.5.4)
- mime-types (~> 1.16)
- treetop (~> 1.4.8)
- mime-types (1.23)
- multi_json (1.7.3)
- multi_xml (0.5.3)
- nokogiri (1.5.9)
- orm_adapter (0.4.0)
- polyglot (0.3.3)
- quiet_assets (1.0.2)
+ loofah (2.0.1)
+ nokogiri (>= 1.5.9)
+ mail (2.6.3)
+ mime-types (>= 1.16, < 3)
+ method_source (0.8.2)
+ mime-types (2.4.3)
+ mini_portile (0.6.2)
+ minitest (5.6.0)
+ multi_json (1.11.0)
+ multi_test (0.1.2)
+ multi_xml (0.5.5)
+ nokogiri (1.6.6.2)
+ mini_portile (~> 0.6.0)
+ orm_adapter (0.5.0)
+ protected_attributes (1.0.9)
+ activemodel (>= 4.0.1, < 5.0)
+ pry (0.10.1)
+ coderay (~> 1.1.0)
+ method_source (~> 0.8.1)
+ slop (~> 3.4)
+ quiet_assets (1.1.0)
railties (>= 3.1, < 5.0)
- rack (1.4.5)
- rack-cache (1.2)
- rack (>= 0.4)
- rack-ssl (1.3.3)
- rack
- rack-test (0.6.2)
+ rack (1.6.0)
+ rack-test (0.6.3)
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.2.1)
+ actionmailer (= 4.2.1)
+ actionpack (= 4.2.1)
+ actionview (= 4.2.1)
+ activejob (= 4.2.1)
+ activemodel (= 4.2.1)
+ activerecord (= 4.2.1)
+ activesupport (= 4.2.1)
+ bundler (>= 1.3.0, < 2.0)
+ railties (= 4.2.1)
+ sprockets-rails
+ rails-deprecated_sanitizer (1.0.3)
+ activesupport (>= 4.2.0.alpha)
+ rails-dom-testing (1.0.6)
+ activesupport (>= 4.2.0.beta, < 5.0)
+ nokogiri (~> 1.6.0)
+ rails-deprecated_sanitizer (>= 1.0.1)
+ rails-html-sanitizer (1.0.2)
+ loofah (~> 2.0)
+ railties (4.2.1)
+ actionpack (= 4.2.1)
+ activesupport (= 4.2.1)
rake (>= 0.8.7)
- rdoc (~> 3.4)
- thor (>= 0.14.6, < 2.0)
- rake (10.0.4)
- rdoc (3.12.2)
- json (~> 1.4)
- rolify (3.2.0)
- rspec-core (2.13.1)
- rspec-expectations (2.13.0)
- diff-lcs (>= 1.1.3, < 2.0)
- rspec-mocks (2.13.1)
- rspec-rails (2.13.2)
- actionpack (>= 3.0)
- activesupport (>= 3.0)
- railties (>= 3.0)
- rspec-core (~> 2.13.0)
- rspec-expectations (~> 2.13.0)
- rspec-mocks (~> 2.13.0)
- rubyzip (0.9.9)
- sass (3.2.9)
- sass-rails (3.2.6)
- railties (~> 3.2.0)
- sass (>= 3.1.10)
- tilt (~> 1.3)
- selenium-webdriver (2.32.1)
- childprocess (>= 0.2.5)
- multi_json (~> 1.0)
- rubyzip
- websocket (~> 1.0.4)
- simple_form (2.1.0)
- actionpack (~> 3.0)
- activemodel (~> 3.0)
- sprockets (2.2.2)
- hike (~> 1.2)
+ thor (>= 0.18.1, < 2.0)
+ rake (10.4.2)
+ responders (2.1.0)
+ railties (>= 4.2.0, < 5)
+ rolify (4.0.0)
+ rspec-core (3.2.3)
+ rspec-support (~> 3.2.0)
+ rspec-expectations (3.2.1)
+ diff-lcs (>= 1.2.0, < 2.0)
+ rspec-support (~> 3.2.0)
+ rspec-mocks (3.2.1)
+ diff-lcs (>= 1.2.0, < 2.0)
+ rspec-support (~> 3.2.0)
+ rspec-rails (3.2.1)
+ actionpack (>= 3.0, < 4.3)
+ activesupport (>= 3.0, < 4.3)
+ railties (>= 3.0, < 4.3)
+ rspec-core (~> 3.2.0)
+ rspec-expectations (~> 3.2.0)
+ rspec-mocks (~> 3.2.0)
+ rspec-support (~> 3.2.0)
+ rspec-support (3.2.2)
+ rubygems-update (2.4.6)
+ rubyzip (1.0.0)
+ sass (3.4.13)
+ sass-rails (5.0.3)
+ railties (>= 4.0.0, < 5.0)
+ sass (~> 3.1)
+ sprockets (>= 2.8, < 4.0)
+ sprockets-rails (>= 2.0, < 4.0)
+ tilt (~> 1.1)
+ selenium-webdriver (2.45.0)
+ childprocess (~> 0.5)
multi_json (~> 1.0)
+ rubyzip (~> 1.0)
+ websocket (~> 1.0)
+ simple_form (3.1.0)
+ actionpack (~> 4.0)
+ activemodel (~> 4.0)
+ slop (3.6.0)
+ spring (1.3.4)
+ sprockets (3.0.0)
rack (~> 1.0)
- tilt (~> 1.1, != 1.3.0)
- sqlite3 (1.3.7)
- thor (0.18.1)
+ sprockets-rails (2.2.4)
+ actionpack (>= 3.0)
+ activesupport (>= 3.0)
+ sprockets (>= 2.8, < 4.0)
+ sqlite3 (1.3.10)
+ thor (0.19.1)
+ thread_safe (0.3.5)
tilt (1.4.1)
- treetop (1.4.12)
- polyglot
- polyglot (>= 0.3.1)
- tzinfo (0.3.37)
- uglifier (2.1.1)
+ tzinfo (1.2.2)
+ thread_safe (~> 0.1)
+ uglifier (2.7.1)
execjs (>= 0.3.0)
- multi_json (~> 1.0, >= 1.0.2)
- warden (1.2.1)
+ json (>= 1.8.0)
+ warden (1.2.3)
rack (>= 1.0)
- websocket (1.0.7)
+ web-console (2.1.2)
+ activemodel (>= 4.0)
+ binding_of_caller (>= 0.7.2)
+ railties (>= 4.0)
+ sprockets-rails (>= 2.0, < 4.0)
+ websocket (1.2.1)
xpath (2.0.0)
nokogiri (~> 1.3)
@@ -194,26 +245,33 @@ PLATFORMS
DEPENDENCIES
better_errors (>= 0.7.2)
- binding_of_caller (>= 0.7.1)
- bootstrap-sass (>= 2.3.0.0)
+ binding_of_caller (~> 0.7.2)
+ bootstrap-sass (~> 3.3.4.1)
cancan (>= 1.6.9)
capybara (>= 2.0.3)
- coffee-rails (~> 3.2.1)
+ coffee-rails (~> 4.1.0)
cucumber-rails (>= 1.3.1)
database_cleaner (>= 1.0.0.RC1)
devise (>= 2.2.3)
email_spec (>= 1.4.0)
factory_girl_rails (>= 4.2.0)
- figaro (>= 0.6.3)
- gibbon (>= 0.4.2)
+ gibbon!
jquery-rails
launchy (>= 2.2.0)
+ protected_attributes
+ pry
quiet_assets (>= 1.0.2)
- rails (= 3.2.13)
+ rails (= 4.2.1)
+ railties (~> 4.2.0)
+ responders (~> 2.0)
rolify (>= 3.2.0)
rspec-rails (>= 2.12.2)
- sass-rails (~> 3.2.3)
- selenium-webdriver (~> 2.32.1)
+ rubygems-update (~> 2.4.6)
+ rubyzip (~> 1.0.0)
+ sass-rails (~> 5.0)
+ selenium-webdriver (~> 2.45.0)
simple_form (>= 2.1.0)
+ spring (~> 1.3.4)
sqlite3
- uglifier (>= 1.0.3)
+ uglifier (~> 2.7.1)
+ web-console (~> 2.0)
diff --git a/README b/README
index b26ea68..af3553e 100644
--- a/README
+++ b/README
@@ -1,19 +1,18 @@
Rails Prelaunch Signup
========================
-An example Rails 3.2 app for a web startup prelaunch page.
+Note of 20150413 : this application is currently being updated to Ruby 2.2.1, Rails 4.2.1.
-You can use this project as a starting point for a Rails web application. It requires Rails 3.2 or newer and uses Devise http://github.com/plataformatec/devise for user management and authentication.
-________________________
+What began as an example Rails 3.2 app for a web startup prelaunch page, is being brought current.
-See the README file on GitHub
+________________________
-For more information, please see the updated README file on GitHub:
+For more information, please see the README file on GitHub:
https://github.com/railsapps/rails-prelaunch-signup
________________________
-License
+MIT License
-Contact the author for license terms.
\ No newline at end of file
+Copyright © 2012-2015 Daniel Kehoe
\ No newline at end of file
diff --git a/README.textile b/README.textile
index 697df7e..244bba5 100644
--- a/README.textile
+++ b/README.textile
@@ -1,10 +1,12 @@
h1. !http://railsapps.github.io/images/rails-36x36.jpg(Rails App for a Startup Prelaunch Signup Site)! Rails App for a Startup Prelaunch Signup Site
-Rails 3.2 example application for a “beta launching soon” startup prelaunch signup site.
+Note of 20150413 : This fork of the original Rails 3.2 example application for a “beta launching soon” startup prelaunch signup site, is currently being updated to Rails 4.2.1 Ruby 2.2.1.
+
+Please refer to the original materials :
* "Rails Prelaunch Signup App":http://railsapps.github.io/rails-prelaunch-signup/ project page
-Best of all, there's a "detailed tutorial":https://tutorials.railsapps.org/rails-prelaunch-signup to show how it is built.
+Best of all, there's a "detailed tutorial":https://tutorials.railsapps.org/rails-prelaunch-signup to show how it is built. Go 'Hobo' for free access.
You can build this application in only a few minutes using the "Rails Composer":http://railsapps.github.io/rails-composer/ tool.
@@ -12,593 +14,17 @@ You can build this application in only a few minutes using the "Rails Composer":
Read an "interview with Michael Gajda":http://blog.railsapps.org/post/22543541226/powered-up-by-the-railsapps-project-xplaygrounds-com about how he used the project to launch his startup site.
-h4. Notable Forks
-
-|_. Alternative version |_. |_. Author |
-| "rails-prelaunch-signup-1click":https://github.com/chadokruse/rails-prelaunch-signup-1click | single-click email submit (no modal) | "Chad Kruse":http://twitter.com/chadkruser |
-
h2. !http://twitter-badges.s3.amazonaws.com/t_logo-a.png(Follow on Twitter)!:http://www.twitter.com/rails_apps Follow on Twitter
-Follow the project on Twitter: "@rails_apps":http://twitter.com/rails_apps. Please tweet some praise if you like what you've found.
+Follow the RailsApps projects on Twitter: "@rails_apps":http://twitter.com/rails_apps. Please tweet some praise to Daniel if you like what you've found.
h2. Introduction
The initial app for a typical web startup announces the founders' plans and encourages visitors to enter an email address for future notification of the site launch. It's not difficult to build such an app in Rails.
-But why build it yourself if others have already done so? This project aims to:
-
-* eliminate effort spent building an application that meets a common need;
-* offer code that is already implemented and tested by a large community;
-* provide a well-thought-out app containing most of the features you'll need.
-
-By using code from this project, you'll be able to:
-
-* direct your attention to the design and product offer for your prelaunch site;
-* get started faster building the ultimate application for your business.
-
-h2. What Is Implemented — and What Is Not
-
-This is a complete and fully functional application.
-
-h4. For the user:
-
-* an offer with a "request invite" button
-* a "request invitation" form in a modal window
-* "Thank you" acknowledgement includes social sharing buttons (Twitter, Facebook, Google+)
-* visitor receives an email acknowledging their request
-* visitor's request for an invitation creates an "unconfirmed" account
-* a welcome email when a user is invited by a site administrator
-* a link in the welcome email confirms the user's account and sets a password
-
-h4. For the site owner:
-
-* administrative dashboard page
-* list of all visitors who have requested invitations
-* site owner can send individual invitations
-* "bulk invitation" feature to send 50, 100, or more invitations
-* see status for any user: "uninvited", "confirmed", "last visit"
-
-h4. Implementation details:
-
-* Twitter Bootstrap
-* modal window for invitation requests updated by AJAX
-* Javascript updates the modal window for any form submission errors
-* uses an email service provider for transactional email
-* captures visitor email addresses for a MailChimp mailing list
-
-h4. Tutorial shows how to:
-
-* write user stories
-* use Devise for user management and authentication
-* use CanCan for role-based authorization
-* keep account passwords secret using environment variables
-* use git and GitHub for source control
-* deploy using Heroku
-
-h4. Unimplemented
-
-* queuing (asynchronous processing) for transactional email and MailChimp list capture
-* caching
-* A/B testing of offers
-* Google analytics
-* "about" and "contact" pages
-
-If you add features or improve the implementation, please consider contributing by submitting an issue or pull request from your fork.
-
-h2. Alternatives
-
-This is an application for Rails developers who wish to deploy their own application. It is a good stepping stone to building a more complex application for your startup. You'll own your own code and can customize to your needs.
-
-Unlike a service such as "LaunchRock":http://launchrock.co/, "KickoffLabs":http://kickofflabs.com/ and "Unbounce":http://unbounce.com/, you'll have your own application you can customize as you wish. Just as important, when your visitors sign up, they are creating real user accounts in a user management system you can use after you launch.
-
-If you do not want to build an application, or you are not a Rails developer, you may wish to consider alternatives.
-
-h3. Hosted Services
-
-* "LaunchRock":http://launchrock.com/ - "set up a social launching-soon page in minutes"
-* "KickoffLabs":http://www.kickofflabs.com/ - "viral landing pages you'll love in 60 seconds"
-* "Prefinery":http://www.prefinery.com/ - "complete beta management platform that encourages social sharing"
-* "Unbounce":http://unbounce.com/ - "create, publish & A/B test landing pages"
-
-h3. WordPress Themes
-
-WordPress themes are a popular way to stage a startup prelaunch page.
-
-* "Launch Effect":http://launcheffectapp.com/ - "a WordPress theme for viral launches"
-
-h3. Similar Projects
-
-You can find other projects on GitHub that offer similar functionality.
-
-|_. Author |_. Project |_. Description |
-| codelitt | "launchpage-rails":https://github.com/codelitt/launchpage-rails | Signup for two different types of users |
-| johngrimes | "t-minus":https://github.com/johngrimes/t-minus | Instant prelaunch page for your Rails 3 app |
-| renderedtext | "coming-soon":https://github.com/renderedtext/coming-soon | Sinatra app to show a pre-launch page and collect emails |
-| hashrocket | "coming-soon":https://github.com/hashrocket/coming-soon | Sinatra app to register email addresses |
-| jbeyers | "django-prelaunch":https://github.com/jbeyers/django-prelaunch | Django app to gather email addresses with a referral mechanism |
-
-Found others? Please create an issue with your suggestion or email the author.
-
-h3. Articles and Discussion
-
-Here are some articles that describe the purpose and options for a startup prelaunch page:
-
-* "Building An Effective 'Coming Soon' Page for Your Product":http://www.smashingmagazine.com/2011/05/24/building-an-effective-coming-soon-page-for-your-product/ from Smashing Magazine
-* "Elements Of A Viral Launch Page":http://spking.com/2011/08/30/roll-your-own-pre-launch-page/ from Smashing Magazine
-* "Which Are the Best Startup Prelaunch Pages?":http://www.quora.com/Which-are-the-best-startup-prelaunch-pages from Quora
-
-Have other suggestions? Please create an issue with your suggestion or email the author.
-
-h2. RailsApps Examples and Tutorials
-
-This is one in a series of Rails example apps and tutorials from the "RailsApps Project":http://railsapps.github.io/.
-
-This application is based on two of the RailsApps example apps:
-
-* "rails3-devise-rspec-cucumber":https://github.com/RailsApps/rails3-devise-rspec-cucumber
-* "rails3-bootstrap-devise-cancan":https://github.com/RailsApps/rails3-bootstrap-devise-cancan
-
-The first example shows how to set up Devise for user authentication. It also shows how to set up the app to use RSpec and Cucumber for testing.
-
-The second example shows how to set up Devise and add CanCan to manage access to administrative pages. It also shows how to set up Twitter Bootstrap as a front-end framework for CSS styling.
-
-You can use this example without studying these example applications; if you find you are lost, it may be helpful to look at the two simpler examples.
-
-If you want to use the MongoDB datastore instead of ActiveRecord and a SQL database, look at "rails3-mongoid-devise":https://github.com/RailsApps/rails3-mongoid-devise example.
-
-h2. Tutorial
-
-An in-depth tutorial is available (subscription required). Subscriptions provide financial support for the RailsApps project.
-
-You can use the starter app without getting the tutorial. The tutorial provides a detailed explanation of the code:
-
-h4. "Get the Tutorial":https://tutorials.railsapps.org/rails-prelaunch-signup
-
-The tutorial documents each step to follow to create the application. Every step is documented concisely, so a complete beginner can create this application without any additional knowledge. However, no explanation is offered for any of the steps, so if you are a beginner, you’re advised to look for an introduction to Rails elsewhere. If you’re new to Rails, see recommendations for a "Rails tutorial":https://tutorials.railsapps.org/rails-tutorial and a list of top resources for "Ruby and Rails":http://railsapps.github.io/ruby-and-rails.html. The article "What is Ruby? And Rails?":http://railsapps.github.io/what-is-ruby-rails.html is a good place to get a basic introduction to Rails.
-
-If you simply wish to modify the application for your own project, you can generate the application and set it up as described below, without following the tutorial.
-
-h2. Dependencies
-
-Before generating your application, you will need:
-
-* The Ruby language (version 1.9.3 or 2.0.0)
-* The Rails gem (version 3.2.13)
-
-See "Installing Rails":http://railsapps.github.io/installing-rails.html for detailed instructions and advice.
-
-h2. Accounts You May Need
-
-Before you start, you may need to set up accounts for hosting and email.
-
-h3. Hosting
-
-For easy deployment, use a "platform as a service" provider such as:
-
-* "Heroku":http://www.heroku.com/
-* "CloudFoundry":http://www.cloudfoundry.com/
-* "EngineYard":http://www.engineyard.com/
-* "OpenShift":https://openshift.redhat.com/app/
-
-Instructions are provided for deployment to Heroku.
-
-h3. Transactional Email
-
-For simple testing of email, it's easy to use Gmail to send email messages from the application. For deployment, when the application must send dozens or thousands of acknowledgments or invitations, you will need a hosted SMTP relay service (also known as an ESP or "email service provider"). We provide instructions for "Mandrill by MailChimp":http://mandrill.com/. The Mandrill transactional email service integrates well with the MailChimp email list manager service. Plus, you can send up to 12,000 emails/month from the service for free.
-
-Sign up for a MailChimp account to get started. After you've created your MailChimp account, see the instructions to "Use Mandrill with MailChimp":http://help.mandrill.com/customer/portal/articles/464750-use-mandrill-with-mailchimp. Then get the "Access Information":http://help.mandrill.com/customer/portal/articles/464828-access-information (your SMTP username and password, which is an API key).
-
-h3. Mailing List
-
-In addition to sending transactional email messages, you likely will want to send newsletters or announcements to your entire mailing list. The tutorial shows how to add visitors who request an invitation to a "MailChimp":http://mailchimp.com/ list. MailChimp allows you to send up to 12,000 emails/month to list of 2000 or fewer subscribers for free. After you sign up for a MailChimp account, get your API key. Look under "Account" for "API Keys and Authorized Apps." Note that the Mandrill API key (which you get on the "mandrill.com":http://mandrill.com/ site) is different from the MailChimp API key (which you get on the "mailchimp.com":http://mailchimp.com/ site).
-
-h2. Getting the Application
-
-You have several options for getting the code. You can _fork_, _clone_, or _generate_.
-
-h3. Fork
-
-If you'd like to add features (or bug fixes) to improve the example application, you can fork the GitHub repo and "make pull requests":http://help.github.com/send-pull-requests/. Your code contributions are welcome!
-
-h3. Clone
-
-If you want to copy and customize the app with changes that are only useful for your own project, you can clone the GitHub repo. You'll need to search-and-replace the project name throughout the application. You probably should generate the app instead (see below). To clone:
-
-
-$ git clone git://github.com/RailsApps/rails-prelaunch-signup.git
-
-
-You'll need "git":http://git-scm.com/ on your machine. See "Rails and Git":http://railsapps.github.io/rails-git.html.
-
-h3. Generate
-
-If you want to use the project as a starter app, use the "Rails Composer":http://railsapps.github.io/rails-composer/ tool to generate a new version of the example app. You'll be able to give it your own project name when you generate the app. Generating the application gives you many additional options.
-
-To build the example application, run the command:
-
-
-$ rails new rails-prelaunch-signup -m https://raw.github.com/RailsApps/rails-composer/master/composer.rb -T
-
-
-Use the @-T@ flag to skip Test::Unit files.
-
-The @$@ character indicates a shell prompt; don't include it when you run the command.
-
-This creates a new Rails app named @rails-prelaunch-signup@ on your computer. You can use a different name if you wish.
-
-You'll see a prompt:
-
-
-question Install an example application?
- 1) I want to build my own application
- 2) membership/subscription/saas
- 3) rails-prelaunch-signup
- 4) rails3-bootstrap-devise-cancan
- 5) rails3-devise-rspec-cucumber
- 6) rails3-mongoid-devise
- 7) rails3-mongoid-omniauth
- 8) rails3-subdomains
-
-
-Choose *rails-prelaunch-signup*. The Rails Composer tool may give you other options (other choices may have been added since these notes were written).
-
-The application generator template will ask you for additional preferences:
-
-
- question Git branch for the prelaunch app?
- 1) wip (work-in-progress)
- 2) master
- 3) prelaunch
- 4) staging
- question Git branch for the main app?
- 1) None
- 2) wip (work-in-progress)
- 3) edge
- question Web server for development?
- 1) WEBrick (default)
- 2) Thin
- 3) Unicorn
- 4) Puma
- question Web server for production?
- 1) Same as development
- 2) Thin
- 3) Unicorn
- 4) Puma
- question Template engine?
- 1) ERB
- 2) Haml
- 3) Slim
- extras Set a robots.txt file to ban spiders? (y/n)
- extras Use or create a project-specific rvm gemset? (y/n)
- extras Create a GitHub repository? (y/n)
-
-
-h4. Git Branches
-
-The application template will create Git branches for you. This allows you to maintain two versions of the application: one for immdediate deployment as a prelaunch app; and another version that you can use for ongoing development. I recommend deploying the prelaunch app in the "master" branch. Work on your ultimate application in a "wip" branch.
-
-h4. Web Servers
-
-We recommend Thin in development for speed and less noise in the log files.
-
-If you plan to deploy to Heroku, select Thin as your production webserver.
-
-h4. Template Engine
-
-The example application uses the default "ERB" Rails template engine. Optionally, you can use another template engine, such as Haml or Slim. See instructions for "Haml and Rails":http://railsapps.github.io/rails-haml.html.
-
-h4. Other Choices
-
-Set a robots.txt file to ban spiders if you want to keep your new site out of Google search results.
-
-It is a good idea to use "rvm":https://rvm.io/, the Ruby Version Manager, and create a project-specific rvm gemset (not available on Windows). See "Installing Rails":http://railsapps.github.io/installing-rails.html.
-
-If you choose to create a GitHub repository, the generator will prompt you for a GitHub username and password.
-
-h4. Troubleshooting
-
-If you get an error "OpenSSL certificate verify failed" or "Gem::RemoteFetcher::FetchError: SSL_connect" see the article "OpenSSL errors and Rails":http://railsapps.github.io/openssl-certificate-verify-failed.html.
-
-If you get an error like this:
-
-
-Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed.
- composer Running 'after bundler' callbacks.
-The template [...] could not be loaded.
-Error: You have already activated ..., but your Gemfile requires ....
-Using bundle exec may solve this.
-
-
-It's due to conflicting gem versions. See the article "Rails Error: “You have already activated (…)”":http://railsapps.github.io/rails-error-you-have-already-activated.html.
-
-h3. Edit the README
-
-If you're storing the app in a GitHub repository, please edit the README files to add a description of the app and your contact info. If you don't change the README, people will think I am the author of your version of the application.
-
-h2. Getting Started
-
-See the article "Installing Rails":http://railsapps.github.io/installing-rails.html to make sure your development environment is prepared properly.
-
-h3. Use RVM
-
-I recommend using "rvm":https://rvm.io/, the Ruby Version Manager, to create a project-specific gemset for the application. If you generate the application with the Rails Composer tool, you can create a project-specific gemset.
-
-h3. Install the Required Gems
-
-Check the Gemfile to see which gems are used by this application.
-
-If you used the "Rails Composer":http://railsapps.github.io/rails-composer/ tool to generate the example app, the application template script has already run the @bundle install@ command.
-
-If not, you should run the @bundle install@ command to install the required gems on your computer:
-
-
-$ bundle install
-
-
-You can check which gems are installed on your computer with:
-
-
-$ gem list
-
-
-Keep in mind that you have installed these gems locally. When you deploy the app to another server, the same gems (and versions) must be available.
-
-I recommend using "rvm":https://rvm.io/, the Ruby Version Manager, to create a project-specific gemset for the application. See the article "Installing Rails":http://railsapps.github.io/installing-rails.html.
-
-h3. Configure Email
-
-You must configure the application for your email account. See the article "Send Email with Rails":http://railsapps.github.io/rails-send-email.html.
-
-h3. Configure Devise
-
-You can modify the configuration file for Devise if you want to use something other than the defaults:
-
-* *config/initializers/devise.rb*
-
-h3. Configuration File
-
-The application uses the "figaro gem":https://github.com/laserlemon/figaro to set environment variables. Credentials for your administrator account and email account are set in the *config/application.yml* file. The *.gitignore* file prevents the *config/application.yml* file from being saved in the git repository so your credentials are kept private. See the article "Rails Environment Variables":http://railsapps.github.io/rails-environment-variables.html for more information.
-
-Modify the file *config/application.yml*:
-
-
-# Add account credentials and API keys here.
-# See http://railsapps.github.io/rails-environment-variables.html
-# This file should be listed in .gitignore to keep your settings secret!
-# Each entry sets a local environment variable and overrides ENV variables in the Unix shell.
-# For example, setting:
-# GMAIL_USERNAME: Your_Gmail_Username
-# makes 'Your_Gmail_Username' available as ENV["GMAIL_USERNAME"]
-# Add application configuration variables here, as shown below.
-#
-MANDRILL_USERNAME: Your_Username
-MANDRILL_API_KEY: Your_Mandrill_API_Key
-MAILCHIMP_API_KEY: Your_MailChimp_API_Key
-MAILCHIMP_LIST_ID: My_List_ID
-ADMIN_NAME: First User
-ADMIN_EMAIL: user@example.com
-ADMIN_PASSWORD: changeme
-ROLES: [admin, user]
-EMAIL_ADDRESS: user@example.com
-DOMAIN: example.com
-
-
-We use Mandrill to increase deliverability for email messages from the application. Provide a @MANDRILL_USERNAME@ and @MANDRILL_API_KEY@.
-
-When visitors sign up to be notified of our launch, we'll add them to a MailChimp list. Add an environment variable for the MailChimp API key: @MAILCHIMP_API_KEY@. You can find the MailChimp API key under the tab for "Account" on the MailChimp website after you log in. Look for the "Api Keys and Authorized Apps" menu item.
-
-We'll add @MAILCHIMP_LIST_ID@ for the ID of the mailing list we'll set up in MailChimp. To find the list ID, on the MailChimp "Lists" page, look for the dropdown "gear" menu for the mailing list you've created and click "List Settings and Unique ID." At the bottom of the List Settings page, you'll find the unique ID for the mailing list.
-
-If you wish, set your name, email address, and password for an administrator's account. If you prefer, you can use the default to sign in to the application and edit the account after deployment. It is always a good idea to change the administrator's password after the application is deployed.
-
-Specify roles in the configuration file. You will need an "admin" role and "user" role. Remove the "VIP" role as we won't use it.
-
-We'll add @EMAIL_ADDRESS@ to provide the default sender email address we use when sending email from the application.
-
-Finally, we'll add @DOMAIN@ which is also used when sending email.
-
-All configuration values in the *config/application.yml* file are available anywhere in the application as environment variables. For example, @ENV["GMAIL_USERNAME"]@ will return the string "Your_Username".
-
-If you prefer, you can delete the *config/application.yml* file and set each value as an environment variable in the Unix shell.
-
-h3. Set Up a Database Seed File
-
-The *db/seeds.rb* file initializes the database with default values. To keep some data private, and consolidate configuration settings in a single location, we use the *config/application.yml* file to set environment variables and then use the environment variables in the *db/seeds.rb* file.
-
-
-puts 'ROLES'
-YAML.load(ENV['ROLES']).each do |role|
- Role.find_or_create_by_name({ :name => role }, :without_protection => true)
- puts 'role: ' << role
-end
-puts 'DEFAULT USERS'
-user = User.find_or_create_by_email :name => ENV['ADMIN_NAME'].dup, :email => ENV['ADMIN_EMAIL'].dup, :password => ENV['ADMIN_PASSWORD'].dup, :password_confirmation => ENV['ADMIN_PASSWORD'].dup
-puts 'user: ' << user.name
-user.add_role :admin
-user.skip_confirmation!
-user.save!
-
-
-The *db/seeds.rb* file reads a list of roles from the *config/application.yml* file and adds the roles to the database. In fact, any new role can be added to the roles datatable with a statement such @user.add_role :superhero@. Setting the roles in the *db/seeds.rb* file simply makes sure each role is listed and available.
-
-You can change the administrator name, email, and password in this file but it is better to make the changes in the *config/application.yml* file to keep the credentials private. If you decide to include your private password in the *db/seeds.rb* file, be sure to add the filename to your *.gitignore* file so that your password doesn't become available in your public GitHub repository.
-
-Note that it's not necessary to personalize the *db/seeds.rb* file before you deploy your app. You can deploy the app with an example user and then use the application's "Edit Account" feature to change name, email address, and password after you log in. Use this feature to log in as an administrator and change the user name and password to your own.
-
-Don't overlook the @user.skip_confirmation!@ and @user.save!@ statements. This application uses the Devise Confirmable module to require that a user confirm a new account by clicking on a link in an email message. You won't be sending the administrator an email message with a confirmation link so you must set the account with the @user.skip_confirmation!@ and @user.save!@ statements.
-
-You may wish to include additional sample users:
-
-
-user2 = User.find_or_create_by_email :name => 'Second User', :email => 'user2@example.com', :password => 'changeme', :password_confirmation => 'changeme'
-puts 'user: ' << user2.name
-user2.add_role :VIP
-
-
-This will add a second user to the database with a "VIP" role.
-
-h3. Set the Database
-
-Prepare the database and add the default user to the database by running the commands:
-
-
-$ rake db:migrate
-$ rake db:seed
-
-
-Use @rake db:reset@ if you want to empty and reseed the database.
-
-Set the database for running tests:
-
-
-$ rake db:test:prepare
-
-
-If you’re not using "rvm":https://rvm.io/, the Ruby Version Manager, you should preface each rake command with @bundle exec@. You don’t need to use @bundle exec@ if you are using rvm version 1.11.0 or newer.
-
-h3. Change your Application's Secret Token
-
-If you've used the Rails Composer tool to generate the application, the application's secret token will be unique, just as with any Rails application generated with the @rails new@ command.
-
-However, if you've cloned the application directly from GitHub, it is crucial that you change the application's secret token before deploying your application in production mode. Otherwise, people could change their session information, and potentially access your site without permission. Your secret token should be at least 30 characters long and completely random.
-
-Get a unique secret token:
-
-
-rake secret
-
-
-Edit your *config/initializers/secret_token.rb* file to add the secret token:
-
-
-RailsPrelaunchSignup::Application.config.secret_token = '...some really long, random string...'
-
-
-h2. Test the App
-
-You can check that your app runs properly by entering the command
-
-@$ rails server@
-
-To see your application in action, open a browser window and navigate to "http://localhost:3000/":http://localhost:3000.
-
-Sign in as the first user (the administrator) using:
-
-* email: user@example.com
-* password: changeme
-
-You'll see a navigation link for Admin. Clicking the link will display a page with a list of users at
-"http://localhost:3000/users":http://localhost:3000/users.
-
-If you want to see what the administrative dashboard looks like with many users, you can add a line to the *db/seeds.rb* file to create a hundred bogus users:
-
-
-100.times {|i| User.create! :name => "User #{i+3}", :email => "user#{i+3}@example.com", :password => 'changeme', :password_confirmation => 'changeme'}
-
-
-Then run @$ rake db:reset@ to recreate the database and visit the site again.
-
-h2. Deploy to Heroku
-
-Heroku provides low cost, easily configured Rails application hosting.
-
-For your convenience, here is a "Tutorial for Rails on Heroku":http://railsapps.github.io/rails-heroku-tutorial.html. See the article for details about preparing your application to deploy to Heroku.
-
-Be sure to set up SSL before you make your application available in production. See the "Heroku documentation on SSL":https://devcenter.heroku.com/articles/ssl or use CloudFlare as described in the tutorial.
-
-After you've prepared your application as described in the "Tutorial for Rails on Heroku":http://railsapps.github.io/rails-heroku-tutorial.html article, precompile assets, commit to git, and push to Heroku:
-
-
-$ rake assets:precompile
-$ git add -A
-$ git commit -m "assets compiled for Heroku"
-$ git push heroku master
-
-
-You'll need to set the configuration values from the *config/application.yml* file as Heroku environment variables. See the article "Rails Environment Variables":http://railsapps.github.io/rails-environment-variables.html for more information.
-
-With the figaro gem, just run:
-
-
-$ rake figaro:heroku
-
-
-Alternatively, you can set Heroku environment variables directly.
-
-Here's how to set environment variables directly on Heroku with @heroku config:add@.
-
-
-$ heroku config:add MANDRILL_USERNAME='Your_Username' MANDRILL_API_KEY='Your_Mandrill_API_Key'
-$ heroku config:add MAILCHIMP_LIST_ID='Your_List_ID'
-$ heroku config:add ADMIN_NAME='First User' ADMIN_EMAIL='user@example.com' ADMIN_PASSWORD='changeme'
-$ heroku config:add 'ROLES=[admin, user]'
-$ heroku config:add EMAIL_ADDRESS='me@example.com' DOMAIN='example.com'
-
-
-Complete Heroku deployment with:
-
-
-$ heroku run rake db:migrate
-$ heroku run rake db:seed
-
-
-h2. Testing
-
-The example application contains a suite of RSpec unit tests and Cucumber scenarios and step definitions.
-
-After installing the application, run @rake -T@ to check that rake tasks for RSpec and Cucumber are available.
-
-Run @rake spec@ to run RSpec tests.
-
-Run @rake cucumber@ (or more simply, @cucumber@) to run Cucumber scenarios.
-
-Please send the author a message, create an issue, or submit a pull request if you can contribute improved RSpec or Cucumber files.
-
-h2. Issues
-
-Please create a "GitHub issue":http://github.com/RailsApps/rails-prelaunch-signup/issues if you identify any problems or have suggestions for improvements.
-
-h2. Where to Get Help
-
-Your best source for help with problems is "Stack Overflow":http://stackoverflow.com/questions/tagged/ruby-on-rails-3. Your issue may have been encountered and addressed by others.
-
-You can also try "Rails Hotline":http://www.railshotline.com/, a free telephone hotline for Rails help staffed by volunteers.
-
-h2. Contributing
-
-If you make improvements to this application, please share with others.
-
-Send the author a message, create an "issue":http://github.com/RailsApps/rails-prelaunch-signup/issues, or fork the project and submit a pull request.
-
-If you add functionality to this application, create an alternative implementation, or build an application that is similar, please contact me and I'll add a note to the README so that others can find your work.
-
-h2. Credits
-
-Daniel Kehoe implemented the application and wrote the tutorial.
-
-Is the app useful to you? Follow the project on Twitter: "@rails_apps":http://twitter.com/rails_apps
-and tweet some praise. I'd love to know you were helped out by what I've put together.
-
-h2. MIT License
-
-"MIT License":http://www.opensource.org/licenses/mit-license
-
-Copyright © 2012 Daniel Kehoe
-
-h2. Useful Links
+But why build it yourself if others have already done so?
-|_. Getting Started |_. Articles |_. Tutorials |
-| "Learn Rails":http://learn-rails.com/ | "Twitter Bootstrap and Rails":http://railsapps.github.io/twitter-bootstrap-rails.html | "Rails and Bootstrap":http://railsapps.github.io/rails-bootstrap/ |
-| "Ruby and Rails":http://railsapps.github.io/ruby-and-rails.html | "Analytics for Rails":http://railsapps.github.io/rails-google-analytics.html | |
-| "What is Ruby on Rails?":http://railsapps.github.io/what-is-ruby-rails.html | "Heroku and Rails":http://railsapps.github.io/rails-heroku-tutorial.html | "Devise with CanCan and Twitter Bootstrap":https://tutorials.railsapps.org/rails3-bootstrap-devise-cancan |
-| "Rails Tutorial":https://tutorials.railsapps.org/rails-tutorial | "JavaScript and Rails":http://railsapps.github.io/rails-javascript-include-external.html | "Rails Membership Site with Stripe":https://tutorials.railsapps.org/rails-stripe-membership-saas |
-| "Installing Rails":http://railsapps.github.io/installing-rails.html | "Rails Environment Variables":http://railsapps.github.io/rails-environment-variables.html | "Rails Subscription Site with Recurly":https://tutorials.railsapps.org/rails-recurly-subscription-saas |
-| "Updating Rails":http://railsapps.github.io/updating-rails.html | "Git and Rails":http://railsapps.github.io/rails-git.html | "Startup Prelaunch Signup Application":http://railsapps.github.io/tutorial-rails-prelaunch-signup.html |
-| "Rails Composer":http://railsapps.github.io/rails-composer/ | "Email and Rails":http://railsapps.github.io/rails-send-email.html | "Devise with RSpec and Cucumber":http://railsapps.github.io/tutorial-rails-devise-rspec-cucumber.html |
-| "Rails Examples":http://railsapps.github.io/ | "Haml and Rails":http://railsapps.github.io/rails-haml.html | "Devise with Mongoid":http://railsapps.github.io/tutorial-rails-mongoid-devise.html |
-| "Rails Starter Apps":http://railsapps.github.io/rails-examples-tutorials.html | "Rails Application Layout":http://railsapps.github.io/rails-default-application-layout.html | "OmniAuth with Mongoid":http://railsapps.github.io/tutorial-rails-mongoid-omniauth.html |
-| | "HTML5 Boilerplate for Rails":http://railsapps.github.io/rails-html5-boilerplate.html | "Subdomains with Devise":http://railsapps.github.io/tutorial-rails-subdomains.html |
-| | "Example Gemfiles for Rails":http://railsapps.github.io/rails-3-2-example-gemfile.html | |
-| | "Rails Application Templates":http://railsapps.github.io/rails-application-templates.html | |
+To continue reading and to see the reasons, please see the : "Rails Prelaunch Signup App":http://railsapps.github.io/rails-prelaunch-signup/ project page
-!https://cruel-carlota.pagodabox.com/6ffdc588dd4075aa7827bd7806ed40f7(githalytics.com alpha)!
+Kathy Onu
+a SiteKeeper
diff --git a/app/assets/stylesheets/bootstrap_and_overrides.css.scss b/app/assets/stylesheets/bootstrap_and_overrides.css.scss
index fc66ab6..43df589 100644
--- a/app/assets/stylesheets/bootstrap_and_overrides.css.scss
+++ b/app/assets/stylesheets/bootstrap_and_overrides.css.scss
@@ -1,3 +1,2 @@
@import "bootstrap";
body { padding-top: 60px; }
-@import "bootstrap-responsive";
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb
index f9a089f..d142970 100644
--- a/app/controllers/application_controller.rb
+++ b/app/controllers/application_controller.rb
@@ -2,7 +2,7 @@ class ApplicationController < ActionController::Base
protect_from_forgery
rescue_from CanCan::AccessDenied do |exception|
- redirect_to root_path, :alert => exception.message
+ redirect_to root_path, alert: exception.message
end
end
diff --git a/app/controllers/confirmations_controller.rb b/app/controllers/confirmations_controller.rb
index b85b490..e12aacb 100644
--- a/app/controllers/confirmations_controller.rb
+++ b/app/controllers/confirmations_controller.rb
@@ -8,7 +8,7 @@ class ConfirmationsController < Devise::PasswordsController
def create
self.resource = resource_class.send_confirmation_instructions(resource_params)
if successfully_sent?(resource)
- respond_with({}, :location => after_resending_confirmation_instructions_path_for(resource_name))
+ respond_with({}, location: after_resending_confirmation_instructions_path_for(resource_name))
else
respond_with(resource)
end
@@ -26,7 +26,7 @@ def update
@confirmable.errors.clear #so that we won't render :new
end
else
- self.class.add_error_on(self, :email, :password_allready_set)
+ self.class.add_error_on(self, :email, :password_already_set)
end
end
diff --git a/app/controllers/registrations_controller.rb b/app/controllers/registrations_controller.rb
index 308a177..92a535c 100644
--- a/app/controllers/registrations_controller.rb
+++ b/app/controllers/registrations_controller.rb
@@ -1,22 +1,26 @@
class RegistrationsController < Devise::RegistrationsController
+ helper_method :resource, :resource_name, :devise_mapping # 20150412 addition
# override #create to respond to AJAX with a partial
def create
build_resource
+ #build_resource(sign_up_params)
+ resource.email = resource_params[:email]
+ # ^^ ref https://github.com/RailsApps/rails-prelaunch-signup/commit/ec01a952b56ccf49b4dfa4d529caea22b4dbdae8
if resource.save
if resource.active_for_authentication?
sign_in(resource_name, resource)
- (render(:partial => 'thankyou', :layout => false) && return) if request.xhr?
- respond_with resource, :location => after_sign_up_path_for(resource)
+ (render(partial: 'thankyou', layout: false) && return) if request.xhr?
+ respond_with resource, location: after_sign_up_path_for(resource)
else
- expire_session_data_after_sign_in!
- (render(:partial => 'thankyou', :layout => false) && return) if request.xhr?
- respond_with resource, :location => after_inactive_sign_up_path_for(resource)
+ expire_data_after_sign_in!
+ (render(partial: 'thankyou', layout: false) && return) if request.xhr?
+ respond_with resource, location: after_inactive_sign_up_path_for(resource)
end
else
clean_up_passwords resource
- render :action => :new, :layout => !request.xhr?
+ render action: :new, layout: !request.xhr?
end
end
diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb
index 125c23c..364996a 100644
--- a/app/controllers/users_controller.rb
+++ b/app/controllers/users_controller.rb
@@ -2,7 +2,7 @@ class UsersController < ApplicationController
before_filter :authenticate_user!
def index
- authorize! :index, @user, :message => 'Not authorized as an administrator.'
+ authorize! :index, @user, message: 'Not authorized as an administrator.'
@users = User.all
end
@@ -11,41 +11,41 @@ def show
end
def update
- authorize! :update, @user, :message => 'Not authorized as an administrator.'
+ authorize! :update, @user, message: 'Not authorized as an administrator.'
@user = User.find(params[:id])
- if @user.update_attributes(params[:user], :as => :admin)
- redirect_to users_path, :notice => "User updated."
+ if @user.update_attributes(params[:user], as: :admin)
+ redirect_to users_path, notice: "User updated."
else
- redirect_to users_path, :alert => "Unable to update user."
+ redirect_to users_path, alert: "Unable to update user."
end
end
def destroy
- authorize! :destroy, @user, :message => 'Not authorized as an administrator.'
+ authorize! :destroy, @user, message: 'Not authorized as an administrator.'
user = User.find(params[:id])
unless user == current_user
user.destroy
- redirect_to users_path, :notice => "User deleted."
+ redirect_to users_path, notice: "User deleted."
else
- redirect_to users_path, :notice => "Can't delete yourself."
+ redirect_to users_path, notice: "Can't delete yourself."
end
end
def invite
- authorize! :invite, @user, :message => 'Not authorized as an administrator.'
+ authorize! :invite, @user, message: 'Not authorized as an administrator.'
@user = User.find(params[:id])
@user.send_confirmation_instructions
- redirect_to :back, :only_path => true, :notice => "Sent invitation to #{@user.email}."
+ redirect_to :back, only_path: true, notice: "Sent invitation to #{@user.email}."
end
def bulk_invite
- authorize! :bulk_invite, @user, :message => 'Not authorized as an administrator.'
- users = User.where(:confirmation_token => nil).order(:created_at).limit(params[:quantity])
+ authorize! :bulk_invite, @user, message: 'Not authorized as an administrator.'
+ users = User.where(confirmation_token: nil).order(:created_at).limit(params[:quantity])
count = users.count
users.each do |user|
user.send_confirmation_instructions
end
- redirect_to :back, :only_path => true, :notice => "Sent invitation to #{count} users."
+ redirect_to :back, only_path: true, notice: "Sent invitation to #{count} users."
end
end
diff --git a/app/mailers/user_mailer.rb b/app/mailers/user_mailer.rb
index 80dd22b..983a996 100644
--- a/app/mailers/user_mailer.rb
+++ b/app/mailers/user_mailer.rb
@@ -1,8 +1,8 @@
class UserMailer < ActionMailer::Base
- default :from => ENV["EMAIL_ADDRESS"]
+ default from: ENV["EMAIL_ADDRESS"]
def welcome_email(user)
- mail(:to => user.email, :subject => "Invitation Request Received")
+ mail(to: user.email, subject: "Invitation Request Received")
headers['X-MC-GoogleAnalytics'] = ENV["DOMAIN"]
headers['X-MC-Tags'] = "welcome"
end
diff --git a/app/models/role.rb b/app/models/role.rb
index 145baa7..b966425 100644
--- a/app/models/role.rb
+++ b/app/models/role.rb
@@ -1,6 +1,6 @@
class Role < ActiveRecord::Base
- has_and_belongs_to_many :users, :join_table => :users_roles
- belongs_to :resource, :polymorphic => true
+ has_and_belongs_to_many :users, join_table: :users_roles
+ belongs_to :resource, polymorphic: true
scopify
end
diff --git a/app/models/user.rb b/app/models/user.rb
index 01fdb05..8b5a9c0 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -5,15 +5,13 @@ class User < ActiveRecord::Base
devise :database_authenticatable, :registerable, :confirmable,
:recoverable, :rememberable, :trackable, :validatable
- # Setup accessible (or protected) attributes for your model
- attr_accessible :name, :email, :password, :password_confirmation, :remember_me
-
after_create :add_user_to_mailchimp
before_destroy :remove_user_from_mailchimp
# override Devise method
# no password is required when the account is created; validate password when the user sets one
validates_confirmation_of :password
+
def password_required?
if !persisted?
!(password != "")
@@ -41,7 +39,7 @@ def send_reset_password_instructions
end
# new function to set the password
- def attempt_set_password(params)
+ def attempt_set_password(id_params)
p = {}
p[:password] = params[:password]
p[:password_confirmation] = params[:password_confirmation]
@@ -60,15 +58,21 @@ def only_if_unconfirmed
private
+ # using strong_parameters
+ def id_params
+ require(:user).permit(:email, :password, :password_confirmation)
+ #require(:user).permit(:name, :email, :password, :password_confirmation, :remember_me)
+ end
+
def add_user_to_mailchimp
return if email.include?(ENV['ADMIN_EMAIL'])
mailchimp = Gibbon::API.new
result = mailchimp.lists.subscribe({
- :id => ENV['MAILCHIMP_LIST_ID'],
- :email => {:email => self.email},
- :double_optin => false,
- :update_existing => true,
- :send_welcome => true
+ id: ENV['MAILCHIMP_LIST_ID'],
+ email: { email: self.email },
+ double_optin: false,
+ update_existing: true,
+ send_welcome: true
})
Rails.logger.info("Subscribed #{self.email} to MailChimp") if result
end
@@ -76,11 +80,11 @@ def add_user_to_mailchimp
def remove_user_from_mailchimp
mailchimp = Gibbon::API.new
result = mailchimp.lists.unsubscribe({
- :id => ENV['MAILCHIMP_LIST_ID'],
- :email => {:email => self.email},
- :delete_member => true,
- :send_goodbye => false,
- :send_notify => true
+ id: ENV['MAILCHIMP_LIST_ID'],
+ email: { email: self.email},
+ delete_member: true,
+ send_goodbye: false,
+ send_notify: true
})
Rails.logger.info("Unsubscribed #{self.email} from MailChimp") if result
end
diff --git a/app/views/devise/confirmations/show.html.erb b/app/views/devise/confirmations/show.html.erb
index fe8c0a1..e819418 100644
--- a/app/views/devise/confirmations/show.html.erb
+++ b/app/views/devise/confirmations/show.html.erb
@@ -1,5 +1,5 @@
Account Activation
-<%= simple_form_for resource, :as => resource_name, :url => update_user_confirmation_path, :html => {:class => 'form-horizontal', :method => 'put'}, :id => 'activation-form' do |f| %>
+<%= simple_form_for resource, as: resource_name, url: update_user_confirmation_path, html: { class: 'form-horizontal', method: 'put' }, id: 'activation-form' do |f| %>
<%= devise_error_messages! %>
diff --git a/app/views/devise/mailer/confirmation_instructions.html.erb b/app/views/devise/mailer/confirmation_instructions.html.erb
index 7077efe..0da47ee 100644
--- a/app/views/devise/mailer/confirmation_instructions.html.erb
+++ b/app/views/devise/mailer/confirmation_instructions.html.erb
@@ -4,4 +4,4 @@
Please click the link below to confirm your email address and set your password:
-<%= link_to 'Confirm my account', confirmation_url(@resource, :confirmation_token => @resource.confirmation_token) %>
+<%= link_to 'Confirm my account', confirmation_url(@resource, confirmation_token: @resource.confirmation_token) %>
diff --git a/app/views/devise/registrations/edit.html.erb b/app/views/devise/registrations/edit.html.erb
index 4ac1775..85ed775 100644
--- a/app/views/devise/registrations/edit.html.erb
+++ b/app/views/devise/registrations/edit.html.erb
@@ -1,14 +1,14 @@
Edit <%= resource_name.to_s.humanize %>
-<%= simple_form_for(resource, :as => resource_name, :url => registration_path(resource_name), :html => { :method => :put, :class => 'form-vertical' }) do |f| %>
+<%= simple_form_for(resource, as: resource_name, url: registration_path(resource_name), html: { method: :put, class: 'form-vertical' }) do |f| %>
<%= f.error_notification %>
<%= display_base_errors resource %>
- <%= f.input :name, :autofocus => true %>
- <%= f.input :email, :required => true %>
- <%= f.input :password, :autocomplete => "off", :hint => "leave it blank if you don't want to change it", :required => false %>
- <%= f.input :password_confirmation, :required => false %>
- <%= f.input :current_password, :hint => "we need your current password to confirm your changes", :required => true %>
- <%= f.button :submit, 'Update', :class => 'btn-primary' %>
+ <%= f.input :name, autofocus: true %>
+ <%= f.input :email, required: true %>
+ <%= f.input :password, autocomplete: "off", hint: "leave it blank if you don't want to change it", required: false %>
+ <%= f.input :password_confirmation, required: false %>
+ <%= f.input :current_password, hint: "we need your current password to confirm your changes", required: true %>
+ <%= f.button :submit, 'Update', class: 'btn-primary' %>
<% end %>
Cancel my account
-Unhappy? <%= link_to "Cancel my account", registration_path(resource_name), :data => { :confirm => "Are you sure?" }, :method => :delete %>.
+Unhappy? <%= link_to "Cancel my account", registration_path(resource_name), data: { confirm: "Are you sure?" }, method: :delete %>.
<%= link_to "Back", :back %>
diff --git a/app/views/devise/registrations/edit.html.haml b/app/views/devise/registrations/edit.html.haml
new file mode 100644
index 0000000..6ebfd54
--- /dev/null
+++ b/app/views/devise/registrations/edit.html.haml
@@ -0,0 +1,27 @@
+Edit <%= resource_name.to_s.humanize %>
+
+<%= form_for(resource, as: resource_name, url: registration_path(resource_name), html: { method: :put }) do |f| %>
+ <%= devise_error_messages! %>
+<%= f.label :name %>
+<%= f.text_field :name %>
+
+ <%= f.label :email %>
+ <%= f.email_field :email %>
+
+ <%= f.label :password %> (leave blank if you don't want to change it)
+ <%= f.password_field :password, autocomplete: "off" %>
+
+ <%= f.label :password_confirmation %>
+ <%= f.password_field :password_confirmation %>
+
+ <%= f.label :current_password %> (we need your current password to confirm your changes)
+ <%= f.password_field :current_password %>
+
+ <%= f.submit "Update" %>
+<% end %>
+
+Cancel my account
+
+Unhappy? <%= link_to "Cancel my account", registration_path(resource_name), data: { confirm: "Are you sure?" }, method: :delete %>.
+
+<%= link_to "Back", :back %>
\ No newline at end of file
diff --git a/app/views/devise/registrations/new.html.erb b/app/views/devise/registrations/new.html.erb
index cef4671..ce2f757 100644
--- a/app/views/devise/registrations/new.html.erb
+++ b/app/views/devise/registrations/new.html.erb
@@ -1,15 +1,15 @@
- <%= simple_form_for resource, :as => resource_name, :url => registration_path(resource_name) , :html => {:class => 'form-horizontal' } do |f| %>
+ <%= simple_form_for resource, as: resource_name, url: registration_path(resource_name) , html: { class: 'form-horizontal' } do |f| %>
<%= f.error_notification %>
- <%= f.input :email, :placeholder => 'user@example.com' %>
+ <%= f.input :email, placeholder: 'user@example.com' %>
<% end %>
diff --git a/app/views/devise/sessions/new.html.erb b/app/views/devise/sessions/new.html.erb
index 06d5422..a151d53 100644
--- a/app/views/devise/sessions/new.html.erb
+++ b/app/views/devise/sessions/new.html.erb
@@ -1,8 +1,8 @@
Sign in
-<%= simple_form_for(resource, :as => resource_name, :url => session_path(resource_name), :html => {:class => 'form-vertical' }) do |f| %>
- <%= f.input :email, :autofocus => true %>
+<%= simple_form_for(resource, as: resource_name, url: session_path(resource_name), html: { class: 'form-vertical' }) do |f| %>
+ <%= f.input :email, autofocus: true %>
<%= f.input :password %>
- <%= f.input :remember_me, :as => :boolean if devise_mapping.rememberable? %>
- <%= f.button :submit, "Sign in", :class => 'btn-primary' %>
+ <%= f.input :remember_me, as: :boolean if devise_mapping.rememberable? %>
+ <%= f.button :submit, "Sign in", class: 'btn-primary' %>
<% end %>
<%= render "devise/shared/links" %>
diff --git a/app/views/layouts/_messages.html.erb b/app/views/layouts/_messages.html.erb
index 060b04b..86c2048 100644
--- a/app/views/layouts/_messages.html.erb
+++ b/app/views/layouts/_messages.html.erb
@@ -2,7 +2,7 @@
<% if msg.is_a?(String) %>
">
×
- <%= content_tag :div, msg, :id => "flash_#{name}" %>
+ <%= content_tag :div, msg, id: "flash_#{name}" %>
<% end %>
<% end %>
diff --git a/app/views/layouts/_navigation.html.erb b/app/views/layouts/_navigation.html.erb
index f81f805..4eda054 100644
--- a/app/views/layouts/_navigation.html.erb
+++ b/app/views/layouts/_navigation.html.erb
@@ -1,8 +1,8 @@
-<%= link_to "Rails Prelaunch Signup", root_path, :class => 'brand' %>
+<%= link_to "Rails Prelaunch Signup", root_path, class: 'brand' %>
<% if user_signed_in? %>
- <%= link_to 'Logout', destroy_user_session_path, :method=>'delete' %>
+ <%= link_to 'Logout', destroy_user_session_path, method: 'delete' %>
<% else %>
diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb
index d94aabe..6ef89de 100644
--- a/app/views/layouts/application.html.erb
+++ b/app/views/layouts/application.html.erb
@@ -4,7 +4,7 @@
<%= content_for?(:title) ? yield(:title) : "Rails Prelaunch Signup" %>
">
- <%= stylesheet_link_tag "application", :media => "all" %>
+ <%= stylesheet_link_tag "application", media: "all" %>
<%= javascript_include_tag "application" %>
<%= csrf_meta_tags %>
<%= yield(:head) %>
diff --git a/app/views/users/_user.html.erb b/app/views/users/_user.html.erb
index 14b6afd..50bc2d7 100644
--- a/app/views/users/_user.html.erb
+++ b/app/views/users/_user.html.erb
@@ -1,14 +1,14 @@
- <%= simple_form_for user, :url => user_path(user), :html => {:method => :put, :class => 'form-horizontal' } do |f| %>
+ <%= simple_form_for user, url: user_path(user), html: { method: :put, class: 'form-horizontal' } do |f| %>
- <%= f.input :role_ids, :collection => Role.all, :as => :radio_buttons, :label_method => lambda {|t| t.name.titleize}, :label => false, :item_wrapper_class => 'inline', checked: user.role_ids.first %>
+ <%= f.input :role_ids, collection: Role.all, as: :radio_buttons, label_method: lambda {|t| t.name.titleize}, label: false, item_wrapper_class: 'inline', checked: user.role_ids.first %>
<% end %>
diff --git a/app/views/users/index.html.erb b/app/views/users/index.html.erb
index 2444f71..d92f5f2 100644
--- a/app/views/users/index.html.erb
+++ b/app/views/users/index.html.erb
@@ -2,11 +2,11 @@
Send Bulk Invitations:
- <%= link_to "10 ·".html_safe, bulk_invite_path(:quantity => '10') %>
- <%= link_to "50 ·".html_safe, bulk_invite_path(:quantity => '50') %>
- <%= link_to "100 ·".html_safe, bulk_invite_path(:quantity => '100') %>
- <%= link_to "500 ·".html_safe, bulk_invite_path(:quantity => '500') %>
- <%= link_to "1000", bulk_invite_path(:quantity => '1000') %>
+ <%= link_to "10 ·".html_safe, bulk_invite_path(quantity: '10') %>
+ <%= link_to "50 ·".html_safe, bulk_invite_path(quantity: '50') %>
+ <%= link_to "100 ·".html_safe, bulk_invite_path(quantity: '100') %>
+ <%= link_to "500 ·".html_safe, bulk_invite_path(quantity: '500') %>
+ <%= link_to "1000", bulk_invite_path(quantity: '1000') %>
@@ -29,7 +29,7 @@
<%= link_to user.name, user %>
<%= user.email %>
<%= user.created_at.to_date %>
- <%= (user.confirmation_token.nil? ? (link_to "send invitation", invite_user_path(user), {:class => 'btn btn-mini'}) : (link_to "resend", invite_user_path(user), {:class => 'btn btn-mini'})) unless user.confirmed_at %>
+ <%= (user.confirmation_token.nil? ? (link_to "send invitation", invite_user_path(user), {class: 'btn btn-mini'}) : (link_to "resend", invite_user_path(user), {class: 'btn btn-mini'})) unless user.confirmed_at %>
<%= user.confirmed_at.to_date if user.confirmed_at %>
<%= user.sign_in_count if user.sign_in_count %>
<%= user.last_sign_in_at.to_date if user.last_sign_in_at %>
@@ -38,7 +38,7 @@
Change role
<%= render user %>
- <%= link_to("Delete user", user_path(user), :data => { :confirm => "Are you sure?" }, :method => :delete, :class => 'btn btn-mini') unless user == current_user %>
+ <%= link_to("Delete user", user_path(user), data: { confirm: "Are you sure?" }, method: :delete, class: 'btn btn-mini') unless user == current_user %>
<% end %>
diff --git a/bin/bundle b/bin/bundle
new file mode 100755
index 0000000..66e9889
--- /dev/null
+++ b/bin/bundle
@@ -0,0 +1,3 @@
+#!/usr/bin/env ruby
+ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
+load Gem.bin_path('bundler', 'bundle')
diff --git a/bin/rails b/bin/rails
new file mode 100755
index 0000000..7feb6a3
--- /dev/null
+++ b/bin/rails
@@ -0,0 +1,8 @@
+#!/usr/bin/env ruby
+begin
+ load File.expand_path("../spring", __FILE__)
+rescue LoadError
+end
+APP_PATH = File.expand_path('../../config/application', __FILE__)
+require_relative '../config/boot'
+require 'rails/commands'
diff --git a/bin/rake b/bin/rake
new file mode 100755
index 0000000..8017a02
--- /dev/null
+++ b/bin/rake
@@ -0,0 +1,8 @@
+#!/usr/bin/env ruby
+begin
+ load File.expand_path("../spring", __FILE__)
+rescue LoadError
+end
+require_relative '../config/boot'
+require 'rake'
+Rake.application.run
diff --git a/bin/setup b/bin/setup
new file mode 100755
index 0000000..acdb2c1
--- /dev/null
+++ b/bin/setup
@@ -0,0 +1,29 @@
+#!/usr/bin/env ruby
+require 'pathname'
+
+# path to your application root.
+APP_ROOT = Pathname.new File.expand_path('../../', __FILE__)
+
+Dir.chdir APP_ROOT do
+ # This script is a starting point to setup your application.
+ # Add necessary setup steps to this file:
+
+ puts "== Installing dependencies =="
+ system "gem install bundler --conservative"
+ system "bundle check || bundle install"
+
+ # puts "\n== Copying sample files =="
+ # unless File.exist?("config/database.yml")
+ # system "cp config/database.yml.sample config/database.yml"
+ # end
+
+ puts "\n== Preparing database =="
+ system "bin/rake db:setup"
+
+ puts "\n== Removing old logs and tempfiles =="
+ system "rm -f log/*"
+ system "rm -rf tmp/cache"
+
+ puts "\n== Restarting application server =="
+ system "touch tmp/restart.txt"
+end
diff --git a/bin/spring b/bin/spring
new file mode 100755
index 0000000..7b45d37
--- /dev/null
+++ b/bin/spring
@@ -0,0 +1,15 @@
+#!/usr/bin/env ruby
+
+# This file loads spring without using Bundler, in order to be fast.
+# It gets overwritten when you run the `spring binstub` command.
+
+unless defined?(Spring)
+ require "rubygems"
+ require "bundler"
+
+ if match = Bundler.default_lockfile.read.match(/^GEM$.*?^ (?: )*spring \((.*?)\)$.*?^$/m)
+ Gem.paths = { "GEM_PATH" => [Bundler.bundle_path.to_s, *Gem.path].uniq }
+ gem "spring", match[1]
+ require "spring/binstub"
+ end
+end
diff --git a/config/application.example.yml b/config/application.example.yml
deleted file mode 100644
index 9d272da..0000000
--- a/config/application.example.yml
+++ /dev/null
@@ -1,19 +0,0 @@
-# Add account credentials and API keys here.
-# See http://railsapps.github.io/rails-environment-variables.html
-# This file should be listed in .gitignore to keep your settings secret!
-# Each entry sets a local environment variable and overrides ENV variables in the Unix shell.
-# For example, setting:
-# GMAIL_USERNAME: Your_Gmail_Username
-# makes 'Your_Gmail_Username' available as ENV["GMAIL_USERNAME"]
-# Add application configuration variables here, as shown below.
-#
-MANDRILL_USERNAME: Your_Username
-MANDRILL_API_KEY: Your_Mandrill_API_Key
-MAILCHIMP_API_KEY: Your_MailChimp_API_Key
-MAILCHIMP_LIST_ID: My_List_ID
-ADMIN_NAME: First User
-ADMIN_EMAIL: user@example.com
-ADMIN_PASSWORD: changeme
-ROLES: [admin, user]
-EMAIL_ADDRESS: user@example.com
-DOMAIN: example.com
diff --git a/config/application.rb b/config/application.rb
index 6c5eb5c..47a1049 100644
--- a/config/application.rb
+++ b/config/application.rb
@@ -1,50 +1,25 @@
require File.expand_path('../boot', __FILE__)
-# Pick the frameworks you want:
-require "active_record/railtie"
-require "action_controller/railtie"
-require "action_mailer/railtie"
-require "active_resource/railtie"
-require "sprockets/railtie"
-# require "rails/test_unit/railtie"
+require 'rails/all'
-if defined?(Bundler)
- # If you precompile assets before deploying to production, use this line
- Bundler.require(*Rails.groups(:assets => %w(development test)))
- # If you want your assets lazily compiled in production, use this line
- # Bundler.require(:default, :assets, Rails.env)
-end
+# Require the gems listed in Gemfile, including any gems
+# you've limited to :test, :development, or :production.
+Bundler.require(*Rails.groups)
module RailsPrelaunchSignup
class Application < Rails::Application
-
- # don't generate RSpec tests for views and helpers
- config.generators do |g|
-
- g.test_framework :rspec, fixture: true
- g.fixture_replacement :factory_girl, dir: 'spec/factories'
-
-
- g.view_specs false
- g.helper_specs false
+ # http://railsapps.github.io/rails-environment-variables.html
+ config.before_configuration do
+ env_file = File.join(Rails.root, 'config', 'local_env.yml')
+ YAML.load(File.open(env_file)).each do |key, value|
+ ENV[key.to_s] = value
+ end if File.exists?(env_file)
end
# Settings in config/environments/* take precedence over those specified here.
# Application configuration should go into files in config/initializers
# -- all .rb files in that directory are automatically loaded.
- # Custom directories with classes and modules you want to be autoloadable.
- # config.autoload_paths += %W(#{config.root}/extras)
- config.autoload_paths += %W(#{config.root}/lib)
-
-
- # Only load the plugins named here, in the order given (default is alphabetical).
- # :all can be used as a placeholder for all plugins not explicitly named.
- # config.plugins = [ :exception_notification, :ssl_requirement, :all ]
-
- # Activate observers that should always be running.
- # config.active_record.observers = :cacher, :garbage_collector, :forum_observer
-
# Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
# Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
# config.time_zone = 'Central Time (US & Canada)'
@@ -53,30 +28,16 @@ class Application < Rails::Application
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
# config.i18n.default_locale = :de
- # Configure the default encoding used in templates for Ruby 1.9.
- config.encoding = "utf-8"
-
- # Configure sensitive parameters which will be filtered from the log file.
- config.filter_parameters += [:password, :password_confirmation]
-
- # Enable escaping HTML in JSON.
- config.active_support.escape_html_entities_in_json = true
-
- # Use SQL instead of Active Record's schema dumper when creating the database.
- # This is necessary if your schema can't be completely dumped by the schema dumper,
- # like if you have constraints or database-specific column types
- # config.active_record.schema_format = :sql
+ # Do not swallow errors in after_commit/after_rollback callbacks.
+ config.active_record.raise_in_transactional_callbacks = true
- # Enforce whitelist mode for mass assignment.
- # This will create an empty whitelist of attributes available for mass-assignment for all models
- # in your app. As such, your models will need to explicitly whitelist or blacklist accessible
- # parameters by using an attr_accessible or attr_protected declaration.
- config.active_record.whitelist_attributes = true
-
- # Enable the asset pipeline
- config.assets.enabled = true
-
- # Version of your assets, change this if you want to expire all your assets
- config.assets.version = '1.0'
+ # don't generate RSpec tests for views and helpers
+ config.generators do |g|
+ g.test_framework :rspec, fixture: true
+ g.fixture_replacement :factory_girl, dir: 'spec/factories'
+ g.view_specs false
+ g.helper_specs false
+ end
+
end
end
diff --git a/config/application.yml b/config/application.yml
deleted file mode 100644
index 9d272da..0000000
--- a/config/application.yml
+++ /dev/null
@@ -1,19 +0,0 @@
-# Add account credentials and API keys here.
-# See http://railsapps.github.io/rails-environment-variables.html
-# This file should be listed in .gitignore to keep your settings secret!
-# Each entry sets a local environment variable and overrides ENV variables in the Unix shell.
-# For example, setting:
-# GMAIL_USERNAME: Your_Gmail_Username
-# makes 'Your_Gmail_Username' available as ENV["GMAIL_USERNAME"]
-# Add application configuration variables here, as shown below.
-#
-MANDRILL_USERNAME: Your_Username
-MANDRILL_API_KEY: Your_Mandrill_API_Key
-MAILCHIMP_API_KEY: Your_MailChimp_API_Key
-MAILCHIMP_LIST_ID: My_List_ID
-ADMIN_NAME: First User
-ADMIN_EMAIL: user@example.com
-ADMIN_PASSWORD: changeme
-ROLES: [admin, user]
-EMAIL_ADDRESS: user@example.com
-DOMAIN: example.com
diff --git a/config/boot.rb b/config/boot.rb
index 4489e58..6b750f0 100644
--- a/config/boot.rb
+++ b/config/boot.rb
@@ -1,6 +1,3 @@
-require 'rubygems'
-
-# Set up gems listed in the Gemfile.
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
-require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE'])
+require 'bundler/setup' # Set up gems listed in the Gemfile.
diff --git a/config/database.yml b/config/database.yml
index 09cc85a..f33bc33 100644
--- a/config/database.yml
+++ b/config/database.yml
@@ -19,8 +19,8 @@ test: &test
timeout: 5000
production:
- adapter: sqlite3
- database: db/production.sqlite3
+ adapter: postgresql
+ database: db/production.pg
pool: 5
timeout: 5000
diff --git a/config/environment.rb b/config/environment.rb
index ba9b72f..ee8d90d 100644
--- a/config/environment.rb
+++ b/config/environment.rb
@@ -1,5 +1,5 @@
-# Load the rails application
+# Load the Rails application.
require File.expand_path('../application', __FILE__)
-# Initialize the rails application
-RailsPrelaunchSignup::Application.initialize!
+# Initialize the Rails application.
+Rails.application.initialize!
diff --git a/config/environments/development.rb b/config/environments/development.rb
index 3749bca..526627a 100644
--- a/config/environments/development.rb
+++ b/config/environments/development.rb
@@ -1,51 +1,56 @@
-RailsPrelaunchSignup::Application.configure do
- # Settings specified here will take precedence over those in config/application.rb
+Rails.application.configure do
+ # Settings specified here will take precedence over those in config/application.rb.
# In the development environment your application's code is reloaded on
# 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
+ # Do not eager load code on boot.
+ config.eager_load = false
- # Show full error reports and disable caching
+ # Show full error reports and disable caching.
config.consider_all_requests_local = true
config.action_controller.perform_caching = false
- # ActionMailer Config
- config.action_mailer.default_url_options = { :host => 'localhost:3000' }
- config.action_mailer.delivery_method = :smtp
- # change to true to allow email to be sent during development
- config.action_mailer.perform_deliveries = false
- config.action_mailer.raise_delivery_errors = true
- config.action_mailer.default :charset => "utf-8"
-
- config.action_mailer.smtp_settings = {
- :address => "smtp.mandrillapp.com",
- :port => 25,
- :user_name => ENV["MANDRILL_USERNAME"],
- :password => ENV["MANDRILL_API_KEY"]
- }
+ # Don't care if the mailer can't send.
+ config.action_mailer.raise_delivery_errors = false
+ # Print deprecation notices to the Rails logger.
+ config.active_support.deprecation = :log
+ # Raise an error on page load if there are pending migrations.
+ config.active_record.migration_error = :page_load
- # Print deprecation notices to the Rails logger
- config.active_support.deprecation = :log
+ # Debug mode disables concatenation and preprocessing of assets.
+ # This option may cause significant delays in view rendering with a large
+ # number of complex assets.
+ config.assets.debug = true
- # Only use best-standards-support built into browsers
- config.action_dispatch.best_standards_support = :builtin
+ # Asset digests allow you to set far-future HTTP expiration dates on all assets,
+ # yet still be able to expire them through the digest params.
+ config.assets.digest = true
- # Raise exception on mass assignment protection for Active Record models
- config.active_record.mass_assignment_sanitizer = :strict
+ # Adds additional error checking when serving assets at runtime.
+ # Checks for improperly declared sprockets dependencies.
+ # Raises helpful error messages.
+ config.assets.raise_runtime_errors = true
- # 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
+ # Raises error for missing translations
+ # config.action_view.raise_on_missing_translations = true
- # Do not compress assets
- config.assets.compress = false
+ # ActionMailer Config
+ # change to true to allow email to be sent during development
+ config.action_mailer.perform_deliveries = false
+ config.action_mailer.raise_delivery_errors = true
+ config.action_mailer.default charset: "utf-8"
+ config.action_mailer.default_url_options = { host: 'example.com' }
+ config.action_mailer.delivery_method = :smtp
+ config.action_mailer.smtp_settings = {
+ address: "smtp.mandrillapp.com",
+ port: 25,
+ user_name: ENV["MANDRILL_USERNAME"],
+ password: ENV["MANDRILL_API_KEY"],
+ }
- # Expands the lines which load the assets
- config.assets.debug = true
end
diff --git a/config/environments/production.rb b/config/environments/production.rb
index 7b7494b..220683e 100644
--- a/config/environments/production.rb
+++ b/config/environments/production.rb
@@ -1,84 +1,95 @@
-RailsPrelaunchSignup::Application.configure do
- # Settings specified here will take precedence over those in config/application.rb
+Rails.application.configure do
+ # Settings specified here will take precedence over those in config/application.rb.
- # Code is not reloaded between requests
+ # Code is not reloaded between requests.
config.cache_classes = true
- # Full error reports are disabled and caching is turned on
+ # Eager load code on boot. This eager loads most of Rails and
+ # your application in memory, allowing both threaded web servers
+ # and those relying on copy on write to perform better.
+ # Rake tasks automatically ignore this option for performance.
+ config.eager_load = true
+
+ # Full error reports are disabled and caching is turned on.
config.consider_all_requests_local = false
config.action_controller.perform_caching = true
- # Disable Rails's static asset server (Apache or nginx will already do this)
+ # Enable Rack::Cache to put a simple HTTP cache in front of your application
+ # Add `rack-cache` to your Gemfile before enabling this.
+ # For large-scale production use, consider using a caching reverse proxy like nginx, varnish or squid.
+ # config.action_dispatch.rack_cache = true
+
+ # Disable Rails's static asset server (Apache or nginx will already do this).
config.serve_static_assets = false
- # Compress JavaScripts and CSS
- config.assets.compress = true
+ # Compress JavaScripts and CSS.
+ config.assets.js_compressor = :uglifier
+ # config.assets.css_compressor = :sass
- # Don't fallback to assets pipeline if a precompiled asset is missed
+ # Do not fallback to assets pipeline if a precompiled asset is missed.
config.assets.compile = false
- # Generate digests for assets URLs
+ # Generate digests for assets URLs.
config.assets.digest = true
- # Defaults to nil and saved in location specified by config.assets.prefix
- # config.assets.manifest = YOUR_PATH
+ # Version of your assets, change this if you want to expire all your assets.
+ config.assets.version = '1.0'
- # Specifies the header that your server uses for sending files
+ # Specifies the header that your server uses for sending files.
# config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache
# config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx
# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
# config.force_ssl = true
- # See everything in the log (default is :info)
- # config.log_level = :debug
+ # Set to :debug to see everything in the log.
+ config.log_level = :info
- # Prepend all log lines with the following tags
+ # Prepend all log lines with the following tags.
# config.log_tags = [ :subdomain, :uuid ]
- # Use a different logger for distributed setups
+ # Use a different logger for distributed setups.
# config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
- # Use a different cache store in production
+ # Use a different cache store in production.
# config.cache_store = :mem_cache_store
- # Enable serving of images, stylesheets, and JavaScripts from an asset server
+ # Enable serving of images, stylesheets, and JavaScripts from an asset server.
# config.action_controller.asset_host = "http://assets.example.com"
- # Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added)
+ # Precompile additional assets.
+ # application.js, application.css, and all non-JS/CSS in app/assets folder are already added.
# config.assets.precompile += %w( search.js )
- # Disable delivery errors, bad email addresses will be ignored
+ # Ignore bad email addresses and do not raise email delivery errors.
+ # Set this to true and configure the email server for immediate delivery to raise delivery errors.
# config.action_mailer.raise_delivery_errors = false
- # Enable threaded mode
- # config.threadsafe!
-
# Enable locale fallbacks for I18n (makes lookups for any locale fall back to
- # the I18n.default_locale when a translation can not be found)
+ # the I18n.default_locale when a translation cannot be found).
config.i18n.fallbacks = true
- # Send deprecation notices to registered listeners
+ # Send deprecation notices to registered listeners.
config.active_support.deprecation = :notify
- config.action_mailer.default_url_options = { :host => 'example.com' }
+ # Use default logging formatter so that PID and timestamp are not suppressed.
+ config.log_formatter = ::Logger::Formatter.new
+
+ # Do not dump schema after migrations.
+ config.active_record.dump_schema_after_migration = false
+
# ActionMailer Config
# Setup for production - deliveries, no errors raised
+ config.action_mailer.default charset: "utf-8"
+ config.action_mailer.default_url_options = { host: 'example.com' }
config.action_mailer.delivery_method = :smtp
config.action_mailer.perform_deliveries = true
config.action_mailer.raise_delivery_errors = false
- config.action_mailer.default :charset => "utf-8"
-
- config.action_mailer.smtp_settings = {
- :address => "smtp.mandrillapp.com",
- :port => 25,
- :user_name => ENV["MANDRILL_USERNAME"],
- :password => ENV["MANDRILL_API_KEY"]
- }
-
-
+ config.action_mailer.smtp_settings = {
+ address: "smtp.mandrillapp.com",
+ port: 25,
+ user_name: ENV["MANDRILL_USERNAME"],
+ password: ENV["MANDRILL_API_KEY"],
+ }
- # 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
end
diff --git a/config/environments/test.rb b/config/environments/test.rb
index 0ca469d..cc5ca03 100644
--- a/config/environments/test.rb
+++ b/config/environments/test.rb
@@ -1,5 +1,5 @@
-RailsPrelaunchSignup::Application.configure do
- # Settings specified here will take precedence over those in config/application.rb
+Rails.application.configure do
+ # Settings specified here will take precedence over those in config/application.rb.
# The test environment is used exclusively to run your application's
# test suite. You never need to work with it otherwise. Remember that
@@ -7,35 +7,38 @@
# and recreated between test runs. Don't rely on the data there!
config.cache_classes = 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"
+ # Do not eager load code on boot. This avoids loading your whole application
+ # just for the purpose of running a single test. If you are using a tool that
+ # preloads Rails for running tests, you may have to set it to true.
+ config.eager_load = false
- # Log error messages when you accidentally call methods on nil
- config.whiny_nils = true
+ # Configure static file server for tests with Cache-Control for performance.
+ config.serve_static_files = true
+ config.static_cache_control = 'public, max-age=3600'
- # Show full error reports and disable caching
+ # Show full error reports and disable caching.
config.consider_all_requests_local = true
config.action_controller.perform_caching = false
- # Raise exceptions instead of rendering exception templates
+ # Raise exceptions instead of rendering exception templates.
config.action_dispatch.show_exceptions = false
- # Disable request forgery protection in test environment
- config.action_controller.allow_forgery_protection = false
+ # Disable request forgery protection in test environment.
+ config.action_controller.allow_forgery_protection = false
# Tell Action Mailer not to deliver emails to the real world.
# The :test delivery method accumulates sent emails in the
# ActionMailer::Base.deliveries array.
config.action_mailer.delivery_method = :test
- # Raise exception on mass assignment protection for Active Record models
- config.active_record.mass_assignment_sanitizer = :strict
+ # Randomize the order test cases are executed.
+ config.active_support.test_order = :sorted # or `:random` if you prefer
- # Print deprecation notices to the stderr
+ # Print deprecation notices to the stderr.
config.active_support.deprecation = :stderr
# ActionMailer Config
- config.action_mailer.default_url_options = { :host => 'example.com' }
-
+ # Raises error for missing translations
+ # config.action_view.raise_on_missing_translations = true
+ config.action_mailer.default_url_options = { host: 'example.com' }
end
diff --git a/config/initializers/assets.rb b/config/initializers/assets.rb
new file mode 100644
index 0000000..01ef3e6
--- /dev/null
+++ b/config/initializers/assets.rb
@@ -0,0 +1,11 @@
+# Be sure to restart your server when you modify this file.
+
+# Version of your assets, change this if you want to expire all your assets.
+Rails.application.config.assets.version = '1.0'
+
+# Add additional assets to the asset load path
+# Rails.application.config.assets.paths << Emoji.images_path
+
+# Precompile additional assets.
+# application.js, application.css, and all non-JS/CSS in app/assets folder are already added.
+# Rails.application.config.assets.precompile += %w( search.js )
diff --git a/config/initializers/cookies_serializer.rb b/config/initializers/cookies_serializer.rb
new file mode 100644
index 0000000..90baf61
--- /dev/null
+++ b/config/initializers/cookies_serializer.rb
@@ -0,0 +1,3 @@
+# Be sure to restart your server when you modify this file.
+
+Rails.application.config.action_dispatch.cookies_serializer = :hybrid
\ No newline at end of file
diff --git a/config/initializers/devise.rb b/config/initializers/devise.rb
index 435e607..f680861 100644
--- a/config/initializers/devise.rb
+++ b/config/initializers/devise.rb
@@ -1,6 +1,11 @@
# Use this hook to configure devise mailer, warden hooks and so forth.
# Many of these configuration options can be set straight in your model.
Devise.setup do |config|
+ # The secret key used by Devise. Devise uses this key to generate
+ # random tokens. Changing this key will render invalid all existing
+ # confirmation, reset password and unlock tokens in the database.
+ config.secret_key = '1279ab267148f5ff7472cddc1177dcf4dda3b3873bbcf98024fe24bd95c51d008966513cec0f544f515777da013546415f83884a3883a258f98e8a9d47ef53ae'
+
# ==> Mailer Configuration
# Configure the e-mail address which will be shown in Devise::Mailer,
# note that it will be overwritten if you use your own mailer class with default "from" parameter.
diff --git a/config/initializers/devise_permitted_parameters.rb b/config/initializers/devise_permitted_parameters.rb
new file mode 100644
index 0000000..f295708
--- /dev/null
+++ b/config/initializers/devise_permitted_parameters.rb
@@ -0,0 +1,18 @@
+module DevisePermittedParameters
+ extend ActiveSupport::Concern
+
+ included do
+ before_filter :configure_permitted_parameters
+ end
+
+ protected
+
+ def configure_permitted_parameters
+ devise_parameter_sanitizer.for(:sign_up) << :email
+ devise_parameter_sanitizer.for(:account_update) { |u| u.permit(:email, :password, :password_confirmation, :current_password) }
+ devise_parameter_sanitizer.for(:sign_in) { |u| u.permit(:email, :password) }
+ end
+
+end
+
+DeviseController.send :include, DevisePermittedParameters
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
index 5d8d9be..ac033bf 100644
--- a/config/initializers/inflections.rb
+++ b/config/initializers/inflections.rb
@@ -1,15 +1,16 @@
# Be sure to restart your server when you modify this file.
-# Add new inflection rules using the following format
-# (all these examples are active by default):
-# ActiveSupport::Inflector.inflections do |inflect|
+# 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 do |inflect|
+# ActiveSupport::Inflector.inflections(:en) do |inflect|
# inflect.acronym 'RESTful'
# end
diff --git a/config/initializers/mime_types.rb b/config/initializers/mime_types.rb
index 72aca7e..dc18996 100644
--- a/config/initializers/mime_types.rb
+++ b/config/initializers/mime_types.rb
@@ -2,4 +2,3 @@
# 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/secret_token.rb b/config/initializers/secret_token.rb
deleted file mode 100644
index ea0e466..0000000
--- a/config/initializers/secret_token.rb
+++ /dev/null
@@ -1,7 +0,0 @@
-# Be sure to restart your server when you modify this file.
-
-# Your secret key for verifying the integrity of signed cookies.
-# If you change this key, all old signed cookies will become invalid!
-# Make sure the secret is at least 30 characters and all random,
-# no regular words or you'll be exposed to dictionary attacks.
-RailsPrelaunchSignup::Application.config.secret_token = '1ba85dd1130cb8eed4b810a598d953d218b51c7a05503474fe24eac65df0f9d9f828a59dcc5adbf1183fba51dcadda34832e04bbd31b44854de0dd3f8cabf45a'
diff --git a/config/initializers/session_store.rb b/config/initializers/session_store.rb
index 11f0848..210ce8c 100644
--- a/config/initializers/session_store.rb
+++ b/config/initializers/session_store.rb
@@ -1,8 +1,3 @@
# Be sure to restart your server when you modify this file.
-RailsPrelaunchSignup::Application.config.session_store :cookie_store, key: '_rails-prelaunch-signup_session'
-
-# Use the database for sessions instead of the cookie-based default,
-# which shouldn't be used to store highly confidential information
-# (create the session table with "rails generate session_migration")
-# RailsPrelaunchSignup::Application.config.session_store :active_record_store
+Rails.application.config.session_store :cookie_store, key: '_rails_prelaunch_signup_session'
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/local_env_example.yml b/config/local_env_example.yml
new file mode 100644
index 0000000..36629ee
--- /dev/null
+++ b/config/local_env_example.yml
@@ -0,0 +1,37 @@
+# Rename this file to local_env.yml for use, to keep your data private.
+# NOTE: The local_env.yml file MUST FIRST be listed in .gitignore BEFORE you save it, to keep your settings secret
+# Do that now by opening your git ignore file : $ open -e .gitignore
+# NOW, uncomment this line /config/local_env.yml
+
+# If you accidentally save your file, then uncomment the git ignore statement, your file will still show in the repository, including changes. To resolve do this : $ git rm configl/local_env.yml
+# Only then, will it be safe to add your private data into this file.
+
+# Add account settings and API keys here.
+# Each entry in local_env.yml gets set as a local environment variable.
+# The local_env.yml file overrides ENV variables in the Unix shell.
+# For example, setting:
+# GMAIL_USERNAME: 'Your_Gmail_Username'
+# makes 'Your_Gmail_Username' available as ENV["GMAIL_USERNAME"]
+
+# See the 2nd part of using local_env.yml in config/application.rb
+# With that code in place, the secrets.yml file environment variables
+# will look in the local_env.yml file to access the data.
+# Source Reference : http://railsapps.github.com/rails-environment-variables.html
+
+ADMIN_NAME: Admin
+ADMIN_EMAIL: user@example.com
+ADMIN_PASSWORD: changeme
+DOMAIN_NAME: example.com
+GMAIL_USERNAME: Your_Gmail_Username
+GMAIL_PASSWORD: Your_Gmail_Password
+MAILCHIMP_API_KEY: Your_MailChimp_API_key
+MAILCHIMP_LIST_ID: Your_MailChimp_List_ID
+EMAIL_ADDRESS: user@example.com
+ROLES: '[admin, user]'
+
+# Generate your own new key with $ rake secret
+SECRET_KEY_BASE: your_very_long_secret_key
+
+# uncomment if you use Mandrill :
+#MANDRILL_USERNAME: Your_Mandrill_User_Name
+#MANDRILL_API_KEY: Your_Mandrill_Test_or_Production_Private_API_key
\ No newline at end of file
diff --git a/config/locales/devise.en.yml b/config/locales/devise.en.yml
index 00f6dc6..95309df 100644
--- a/config/locales/devise.en.yml
+++ b/config/locales/devise.en.yml
@@ -28,6 +28,7 @@ en:
success: "Successfully authenticated from %{kind} account."
passwords:
no_token: "You can't access this page without coming from a password reset email. If you do come from a password reset email, please make sure you used the full URL provided."
+ password_already_set: "The password has already been set"
send_instructions: "You will receive an email with instructions about how to reset your password in a few minutes."
send_paranoid_instructions: "If your email address exists in our database, you will receive a password recovery link at your email address in a few minutes."
updated: "Your password was changed successfully. You are now signed in."
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 fa5f804..595c628 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -1,14 +1,69 @@
-RailsPrelaunchSignup::Application.routes.draw do
+Rails.application.routes.draw do
+ # The priority is based upon order of creation: first created -> highest priority.
+ # See how all your routes lay out with "rake routes".
+
+ # You can have the root of your site routed with "root"
+ # root 'welcome#index'
+
+ # Example of regular route:
+ # get 'products/:id' => 'catalog#view'
+
+ # Example of named route that can be invoked with purchase_url(id: product.id)
+ # get 'products/:id/purchase' => 'catalog#purchase', as: :purchase
+
+ # Example resource route (maps HTTP verbs to controller actions automatically):
+ # resources :products
+
+ # Example resource route with options:
+ # resources :products do
+ # member do
+ # get 'short'
+ # post 'toggle'
+ # end
+ #
+ # collection do
+ # get 'sold'
+ # end
+ # end
+
+ # Example resource route with sub-resources:
+ # resources :products do
+ # resources :comments, :sales
+ # resource :seller
+ # end
+
+ # Example resource route with more complex sub-resources:
+ # resources :products do
+ # resources :comments
+ # resources :sales do
+ # get 'recent', on: :collection
+ # end
+ # end
+
+ # Example resource route with concerns:
+ # concern :toggleable do
+ # post 'toggle'
+ # end
+ # resources :posts, concerns: :toggleable
+ # resources :photos, concerns: :toggleable
+
+ # Example resource route within a namespace:
+ # namespace :admin do
+ # # Directs /admin/products/* to Admin::ProductsController
+ # # (app/controllers/admin/products_controller.rb)
+ # resources :products
+ # end
+
authenticated :user do
- root :to => 'home#index'
+ match '/home/index', via: :get
end
devise_scope :user do
- root :to => "devise/registrations#new"
- match '/user/confirmation' => 'confirmations#update', :via => :put, :as => :update_user_confirmation
+ root to: "devise/registrations#new"
+ match '/user/confirmation' => 'confirmations#update', via: :put, as: :update_user_confirmation
end
- devise_for :users, :controllers => { :registrations => "registrations", :confirmations => "confirmations" }
- match 'users/bulk_invite/:quantity' => 'users#bulk_invite', :via => :get, :as => :bulk_invite
+ devise_for :users, controller: { registrations: "registrations", confirmations: "confirmations" }
+ match 'users/bulk_invite/:quantity' => 'users#bulk_invite', via: :get, as: :bulk_invite
resources :users do
- get 'invite', :on => :member
+ get 'invite', on: :member
end
end
diff --git a/db/migrate/20120826102855_rolify_create_roles.rb b/db/migrate/20120826102855_rolify_create_roles.rb
index 999c94a..46c5cda 100644
--- a/db/migrate/20120826102855_rolify_create_roles.rb
+++ b/db/migrate/20120826102855_rolify_create_roles.rb
@@ -2,12 +2,12 @@ class RolifyCreateRoles < ActiveRecord::Migration
def change
create_table(:roles) do |t|
t.string :name
- t.references :resource, :polymorphic => true
+ t.references :resource, polymorphic: true
t.timestamps
end
- create_table(:users_roles, :id => false) do |t|
+ create_table(:users_roles, id: false) do |t|
t.references :user
t.references :role
end
diff --git a/db/schema.rb b/db/schema.rb
index 9d7f068..24cd9c8 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -9,34 +9,34 @@
# 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 => 20120826102940) do
+ActiveRecord::Schema.define(version: 20120826102855) do
- create_table "roles", :force => true do |t|
+ create_table "roles", force: true do |t|
t.string "name"
t.integer "resource_id"
t.string "resource_type"
- 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 "roles", ["name", "resource_type", "resource_id"], :name => "index_roles_on_name_and_resource_type_and_resource_id"
- add_index "roles", ["name"], :name => "index_roles_on_name"
+ add_index "roles", ["name", "resource_type", "resource_id"], name: "index_roles_on_name_and_resource_type_and_resource_id"
+ add_index "roles", ["name"], name: "index_roles_on_name"
- create_table "users", :force => true do |t|
- t.string "email", :default => "", :null => false
- t.string "encrypted_password", :default => "", :null => false
+ create_table "users", force: true do |t|
+ t.string "email", default: "", null: false
+ t.string "encrypted_password", default: "", null: false
t.string "reset_password_token"
t.datetime "reset_password_sent_at"
t.datetime "remember_created_at"
- t.integer "sign_in_count", :default => 0
+ t.integer "sign_in_count", default: 0
t.datetime "current_sign_in_at"
t.datetime "last_sign_in_at"
t.string "current_sign_in_ip"
t.string "last_sign_in_ip"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
+ t.datetime "created_at", null: false
+ t.datetime "updated_at", null: false
t.string "name"
t.string "confirmation_token"
t.datetime "confirmed_at"
@@ -44,14 +44,14 @@
t.string "unconfirmed_email"
end
- add_index "users", ["email"], :name => "index_users_on_email", :unique => true
- add_index "users", ["reset_password_token"], :name => "index_users_on_reset_password_token", :unique => true
+ add_index "users", ["email"], name: "index_users_on_email", unique: true
+ add_index "users", ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true
- create_table "users_roles", :id => false, :force => true do |t|
+ create_table "users_roles", id: false, force: true do |t|
t.integer "user_id"
t.integer "role_id"
end
- add_index "users_roles", ["user_id", "role_id"], :name => "index_users_roles_on_user_id_and_role_id"
+ add_index "users_roles", ["user_id", "role_id"], name: "index_users_roles_on_user_id_and_role_id"
end
diff --git a/db/seeds.rb b/db/seeds.rb
index 8566896..895863b 100644
--- a/db/seeds.rb
+++ b/db/seeds.rb
@@ -1,5 +1,5 @@
# This file should contain all the record creation needed to seed the database with its default values.
-# The data can then be loaded with the rake db:seed (or created alongside the db with db:setup).
+# The data can then be loaded with the $ rake db:seed command, or as part of the db creation command $ rake db:setup
#
# Examples:
#
@@ -9,12 +9,14 @@
# See http://railsapps.github.io/rails-environment-variables.html
puts 'ROLES'
YAML.load(ENV['ROLES']).each do |role|
- Role.find_or_create_by_name({ :name => role }, :without_protection => true)
+ Role.find_or_create_by({ name: role }) #, :without_protection => true)
puts 'role: ' << role
end
puts 'DEFAULT USERS'
-user = User.find_or_create_by_email :name => ENV['ADMIN_NAME'].dup, :email => ENV['ADMIN_EMAIL'].dup, :password => ENV['ADMIN_PASSWORD'].dup, :password_confirmation => ENV['ADMIN_PASSWORD'].dup
-puts 'user: ' << user.name
-user.add_role :admin
+user = User.where(email: ENV['ADMIN_EMAIL'].dup).first_or_create
+puts 'user: ' << user.email
+user.password = 'please123'
+user.password_confirmation = 'please123'
+user.add_role 'admin'
user.skip_confirmation!
user.save!
diff --git a/features/step_definitions/admin_steps.rb b/features/step_definitions/admin_steps.rb
index f8acf34..e9b80fe 100644
--- a/features/step_definitions/admin_steps.rb
+++ b/features/step_definitions/admin_steps.rb
@@ -1,8 +1,8 @@
Given /^I am logged in as an administrator$/ do
@admin = FactoryGirl.create(:user, email: "admin@example.com")
@admin.add_role :admin
- @visitor ||= { :email => "admin@example.com",
- :password => "changeme", :password_confirmation => "changeme" }
+ @visitor ||= { email: "admin@example.com",
+ password: "changeme", password_confirmation: "changeme" }
sign_in
end
diff --git a/features/step_definitions/email_steps.rb b/features/step_definitions/email_steps.rb
index 12bcb3f..7668ee6 100644
--- a/features/step_definitions/email_steps.rb
+++ b/features/step_definitions/email_steps.rb
@@ -65,7 +65,7 @@ def current_email_address
end
Then /^(?:I|they|"([^"]*?)") should receive an email with the following body:$/ do |address, expected_body|
- open_email(address, :with_text => expected_body)
+ open_email(address, with_text: expected_body)
end
#
@@ -78,19 +78,19 @@ def current_email_address
end
When /^(?:I|they|"([^"]*?)") opens? the email with subject "([^"]*?)"$/ do |address, subject|
- open_email(address, :with_subject => subject)
+ open_email(address, with_subject: subject)
end
When /^(?:I|they|"([^"]*?)") opens? the email with subject \/([^"]*?)\/$/ do |address, subject|
- open_email(address, :with_subject => Regexp.new(subject))
+ open_email(address, with_subject: Regexp.new(subject))
end
When /^(?:I|they|"([^"]*?)") opens? the email with text "([^"]*?)"$/ do |address, text|
- open_email(address, :with_text => text)
+ open_email(address, with_text: text)
end
When /^(?:I|they|"([^"]*?)") opens? the email with text \/([^"]*?)\/$/ do |address, text|
- open_email(address, :with_text => Regexp.new(text))
+ open_email(address, with_text: Regexp.new(text))
end
#
diff --git a/features/step_definitions/user_steps.rb b/features/step_definitions/user_steps.rb
index 4ce85fd..032287a 100644
--- a/features/step_definitions/user_steps.rb
+++ b/features/step_definitions/user_steps.rb
@@ -1,12 +1,12 @@
### UTILITY METHODS ###
def create_visitor
- @visitor ||= { :name => "Testy McUserton", :email => "example@example.com",
- :password => "changeme", :password_confirmation => "changeme" }
+ @visitor ||= { name: "Testy McUserton", email: "example@example.com",
+ password: "changeme", password_confirmation: "changeme" }
end
def find_user
- @user ||= User.first conditions: {:email => @visitor[:email]}
+ @user ||= User.where(email: :@visitor[:email]}
end
def create_unconfirmed_user
@@ -23,22 +23,22 @@ def create_user
end
def delete_user
- @user ||= User.first conditions: {:email => @visitor[:email]}
+ @user ||= User.where(email: :@visitor[:email])
@user.destroy unless @user.nil?
end
def sign_up
delete_user
visit '/users/sign_up'
- fill_in "Email", :with => @visitor[:email]
+ fill_in "Email", with: :@visitor[:email]
click_button "Request Invitation"
find_user
end
def sign_in
visit '/users/sign_in'
- fill_in "Email", :with => @visitor[:email]
- fill_in "Password", :with => @visitor[:password]
+ fill_in "Email", with: :@visitor[:email]
+ fill_in "Password", with: :@visitor[:password]
click_button "Sign in"
end
@@ -82,25 +82,25 @@ def sign_in
When /^I sign up with an invalid email$/ do
create_visitor
- @visitor = @visitor.merge(:email => "notanemail")
+ @visitor = @visitor.merge(email: "notanemail")
sign_up
end
When /^I sign up without a password confirmation$/ do
create_visitor
- @visitor = @visitor.merge(:password_confirmation => "")
+ @visitor = @visitor.merge(password_confirmation: "")
sign_up
end
When /^I sign up without a password$/ do
create_visitor
- @visitor = @visitor.merge(:password => "")
+ @visitor = @visitor.merge(password: "")
sign_up
end
When /^I sign up with a mismatched password confirmation$/ do
create_visitor
- @visitor = @visitor.merge(:password_confirmation => "please123")
+ @visitor = @visitor.merge(password_confirmation: "please123")
sign_up
end
@@ -109,19 +109,19 @@ def sign_in
end
When /^I sign in with a wrong email$/ do
- @visitor = @visitor.merge(:email => "wrong@example.com")
+ @visitor = @visitor.merge(email: "wrong@example.com")
sign_in
end
When /^I sign in with a wrong password$/ do
- @visitor = @visitor.merge(:password => "wrongpass")
+ @visitor = @visitor.merge(password: "wrongpass")
sign_in
end
When /^I edit my account details$/ do
click_link "Edit account"
- fill_in "Name", :with => "newname"
- fill_in "Current password", :with => @visitor[:password]
+ fill_in "Name", with: "newname"
+ fill_in "Current password", with: @visitor[:password]
click_button "Update"
end
diff --git a/features/step_definitions/visitor_steps.rb b/features/step_definitions/visitor_steps.rb
index 2b94f43..6b5890c 100644
--- a/features/step_definitions/visitor_steps.rb
+++ b/features/step_definitions/visitor_steps.rb
@@ -1,17 +1,16 @@
def new_user
- @user ||= { :email => "example@example.com",
- :password => "please", :password_confirmation => "please" }
+ @user ||= { email: "example@example.com", password: "please123", password_confirmation: "please123" }
end
def invitation_request user
visit '/users/sign_up'
click_button "Request invite"
- fill_in "Email", :with => user[:email]
+ fill_in "Email", with: user[:email]
click_button "Request Invitation"
end
When /^I visit the home page$/ do
- visit root_path
+ visit root_path
end
When /^I fill in "(.*?)" with "(.*?)"$/ do |field, value|
@@ -49,6 +48,6 @@ def invitation_request user
end
When /^I request an invitation with an invalid email$/ do
- user = new_user.merge(:email => "notanemail")
+ user = new_user.merge(email: "notanemail")
invitation_request user
end
diff --git a/public/humans.txt b/public/humans.txt
index a61e1c2..1b047f9 100644
--- a/public/humans.txt
+++ b/public/humans.txt
@@ -3,10 +3,10 @@
/* TEAM */
- :
- Site:
+ :
+ Site: https://www.goodworksonearth.net
Twitter:
- Location:
+ Location: Eugene, Oregon
/* THANKS */
Daniel Kehoe (@rails_apps) for the RailsApps project
diff --git a/spec/controllers/home_controller_spec.rb b/spec/controllers/home_controller_spec.rb
index 8e8c5c3..ad3b1a8 100644
--- a/spec/controllers/home_controller_spec.rb
+++ b/spec/controllers/home_controller_spec.rb
@@ -5,7 +5,7 @@
describe "GET 'index'" do
it "should be successful" do
get 'index'
- response.should be_success
+ expect(response).to be_success
end
end
diff --git a/spec/controllers/users_controller_spec.rb b/spec/controllers/users_controller_spec.rb
index e73d91a..19e433c 100644
--- a/spec/controllers/users_controller_spec.rb
+++ b/spec/controllers/users_controller_spec.rb
@@ -10,12 +10,12 @@
describe "GET 'show'" do
it "should be successful" do
- get :show, :id => @user.id
+ get :show, id: @user.id
response.should be_success
end
it "should find the right user" do
- get :show, :id => @user.id
+ get :show, id: @user.id
assigns(:user).should == @user
end
diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb
index a1d36b1..5370cd6 100644
--- a/spec/models/user_spec.rb
+++ b/spec/models/user_spec.rb
@@ -1,14 +1,23 @@
require 'spec_helper'
-describe User do
-
- before(:each) do
- @attr = {
- :name => "Example User",
- :email => "user@example.com",
- :password => "changeme",
- :password_confirmation => "changeme"
- }
+include Warden::Test::Helpers
+Warden.test_mode!
+
+RSpec.configure do
+ valid_session = { "user_id": 1 },
+
+ @attr = {
+ name: "Test User",
+ email: "testuser@example.com",
+ password: "changemenow",
+ password_confirmation: "changemenow",
+ }
+end
+
+RSpec.describe User do
+
+ after(:each) do
+ Warden.test_reset!
end
it "should create a new instance given a valid attribute" do
@@ -16,14 +25,14 @@
end
it "should require an email address" do
- no_email_user = User.new(@attr.merge(:email => ""))
+ no_email_user = User.new(@attr.merge(email: ""))
no_email_user.should_not be_valid
end
it "should accept valid email addresses" do
addresses = %w[user@foo.com THE_USER@foo.bar.org first.last@foo.jp]
addresses.each do |address|
- valid_email_user = User.new(@attr.merge(:email => address))
+ valid_email_user = User.new(@attr.merge(email: address))
valid_email_user.should be_valid
end
end
@@ -31,7 +40,7 @@
it "should reject invalid email addresses" do
addresses = %w[user@foo,com user_at_foo.org example.user@foo.]
addresses.each do |address|
- invalid_email_user = User.new(@attr.merge(:email => address))
+ invalid_email_user = User.new(@attr.merge(email: address))
invalid_email_user.should_not be_valid
end
end
@@ -44,7 +53,7 @@
it "should reject email addresses identical up to case" do
upcased_email = @attr[:email].upcase
- User.create!(@attr.merge(:email => upcased_email))
+ User.create!(@attr.merge(email: upcased_email))
user_with_duplicate_email = User.new(@attr)
user_with_duplicate_email.should_not be_valid
end
@@ -67,18 +76,18 @@
describe "password validations" do
it "should require a password" do
- User.new(@attr.merge(:password => "", :password_confirmation => "")).
+ User.new(@attr.merge(password: "", password_confirmation: "")).
should_not be_valid
end
it "should require a matching password confirmation" do
- User.new(@attr.merge(:password_confirmation => "invalid")).
+ User.new(@attr.merge(password_confirmation: "invalid")).
should_not be_valid
end
it "should reject short passwords" do
short = "a" * 5
- hash = @attr.merge(:password => short, :password_confirmation => short)
+ hash = @attr.merge(password: short, password_confirmation: short)
User.new(hash).should_not be_valid
end
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index 280231a..23dbc45 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -3,7 +3,7 @@
require File.expand_path("../../config/environment", __FILE__)
require 'rspec/rails'
require 'email_spec'
-require 'rspec/autorun'
+#require 'rspec/autorun' # 20150412 no longer required per terminal response
# Requires supporting ruby files with custom matchers and macros, etc,
# in spec/support/ and its subdirectories.
@@ -12,6 +12,10 @@
RSpec.configure do |config|
config.include(EmailSpec::Helpers)
config.include(EmailSpec::Matchers)
+
+ # turns deprecation notice into errors and their locations
+ config.raise_errors_for_deprecations!
+
# ## Mock Framework
#
# If you prefer to use mocha, flexmock or RR, uncomment the appropriate line:
diff --git a/spec/support/devise.rb b/spec/support/devise.rb
index 3552bea..7999895 100644
--- a/spec/support/devise.rb
+++ b/spec/support/devise.rb
@@ -1,3 +1,3 @@
RSpec.configure do |config|
- config.include Devise::TestHelpers, :type => :controller
+ config.include Devise::TestHelpers, type: :controller
end