devise-authy 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.document +5 -0
- data/.rspec +1 -0
- data/Gemfile +22 -0
- data/Gemfile.lock +138 -0
- data/LICENSE.txt +20 -0
- data/README.md +86 -0
- data/Rakefile +42 -0
- data/VERSION +1 -0
- data/app/assets/javascripts/devise_authy.js +7 -0
- data/app/assets/stylesheets/devise_authy.css +26 -0
- data/app/assets/stylesheets/devise_authy.sass +23 -0
- data/app/controllers/devise/devise_authy_controller.rb +109 -0
- data/app/views/devise/enable_authy.html.erb +8 -0
- data/app/views/devise/enable_authy.html.haml +8 -0
- data/app/views/devise/verify_authy.html.erb +13 -0
- data/app/views/devise/verify_authy.html.haml +11 -0
- data/app/views/devise/verify_authy_installation.html.erb +10 -0
- data/app/views/devise/verify_authy_installation.html.haml +8 -0
- data/authy-devise-demo/.gitignore +15 -0
- data/authy-devise-demo/Gemfile +39 -0
- data/authy-devise-demo/Gemfile.lock +134 -0
- data/authy-devise-demo/README.md +64 -0
- data/authy-devise-demo/Rakefile +7 -0
- data/authy-devise-demo/app/assets/images/rails.png +0 -0
- data/authy-devise-demo/app/assets/javascripts/application.js +15 -0
- data/authy-devise-demo/app/assets/javascripts/devise_authy.js +7 -0
- data/authy-devise-demo/app/assets/javascripts/welcome.js.coffee +3 -0
- data/authy-devise-demo/app/assets/stylesheets/application.css +13 -0
- data/authy-devise-demo/app/assets/stylesheets/devise_authy.css +26 -0
- data/authy-devise-demo/app/assets/stylesheets/welcome.css.scss +3 -0
- data/authy-devise-demo/app/controllers/application_controller.rb +3 -0
- data/authy-devise-demo/app/controllers/welcome_controller.rb +6 -0
- data/authy-devise-demo/app/helpers/application_helper.rb +2 -0
- data/authy-devise-demo/app/helpers/welcome_helper.rb +2 -0
- data/authy-devise-demo/app/mailers/.gitkeep +0 -0
- data/authy-devise-demo/app/models/.gitkeep +0 -0
- data/authy-devise-demo/app/models/user.rb +11 -0
- data/authy-devise-demo/app/views/devise/devise_authy/enable_authy.html.erb +8 -0
- data/authy-devise-demo/app/views/devise/devise_authy/verify_authy.html.erb +13 -0
- data/authy-devise-demo/app/views/devise/devise_authy/verify_authy_installation.html.erb +10 -0
- data/authy-devise-demo/app/views/layouts/application.html.erb +18 -0
- data/authy-devise-demo/app/views/welcome/index.html.erb +5 -0
- data/authy-devise-demo/config.ru +4 -0
- data/authy-devise-demo/config/application.rb +62 -0
- data/authy-devise-demo/config/boot.rb +6 -0
- data/authy-devise-demo/config/database.yml +25 -0
- data/authy-devise-demo/config/environment.rb +5 -0
- data/authy-devise-demo/config/environments/development.rb +37 -0
- data/authy-devise-demo/config/environments/production.rb +67 -0
- data/authy-devise-demo/config/environments/test.rb +37 -0
- data/authy-devise-demo/config/initializers/authy.rb +1 -0
- data/authy-devise-demo/config/initializers/backtrace_silencers.rb +7 -0
- data/authy-devise-demo/config/initializers/devise.rb +232 -0
- data/authy-devise-demo/config/initializers/inflections.rb +15 -0
- data/authy-devise-demo/config/initializers/mime_types.rb +5 -0
- data/authy-devise-demo/config/initializers/secret_token.rb +7 -0
- data/authy-devise-demo/config/initializers/session_store.rb +8 -0
- data/authy-devise-demo/config/initializers/wrap_parameters.rb +14 -0
- data/authy-devise-demo/config/locales/devise.authy.en.yml +18 -0
- data/authy-devise-demo/config/locales/devise.en.yml +58 -0
- data/authy-devise-demo/config/locales/en.yml +5 -0
- data/authy-devise-demo/config/routes.rb +62 -0
- data/authy-devise-demo/db/migrate/20130409234357_devise_create_users.rb +46 -0
- data/authy-devise-demo/db/migrate/20130409234434_devise_authy_add_to_users.rb +18 -0
- data/authy-devise-demo/db/schema.rb +38 -0
- data/authy-devise-demo/db/seeds.rb +7 -0
- data/authy-devise-demo/lib/assets/.gitkeep +0 -0
- data/authy-devise-demo/lib/tasks/.gitkeep +0 -0
- data/authy-devise-demo/log/.gitkeep +0 -0
- data/authy-devise-demo/public/404.html +26 -0
- data/authy-devise-demo/public/422.html +26 -0
- data/authy-devise-demo/public/500.html +25 -0
- data/authy-devise-demo/public/favicon.ico +0 -0
- data/authy-devise-demo/public/robots.txt +5 -0
- data/authy-devise-demo/script/rails +6 -0
- data/authy-devise-demo/test/fixtures/.gitkeep +0 -0
- data/authy-devise-demo/test/fixtures/users.yml +11 -0
- data/authy-devise-demo/test/functional/.gitkeep +0 -0
- data/authy-devise-demo/test/functional/welcome_controller_test.rb +9 -0
- data/authy-devise-demo/test/integration/.gitkeep +0 -0
- data/authy-devise-demo/test/performance/browsing_test.rb +12 -0
- data/authy-devise-demo/test/test_helper.rb +13 -0
- data/authy-devise-demo/test/unit/.gitkeep +0 -0
- data/authy-devise-demo/test/unit/helpers/welcome_helper_test.rb +4 -0
- data/authy-devise-demo/test/unit/user_test.rb +7 -0
- data/authy-devise-demo/vendor/assets/javascripts/.gitkeep +0 -0
- data/authy-devise-demo/vendor/assets/stylesheets/.gitkeep +0 -0
- data/authy-devise-demo/vendor/plugins/.gitkeep +0 -0
- data/config/locales/en.yml +18 -0
- data/devise-authy.gemspec +223 -0
- data/lib/devise-authy.rb +22 -0
- data/lib/devise-authy/controllers/helpers.rb +39 -0
- data/lib/devise-authy/controllers/view_helpers.rb +36 -0
- data/lib/devise-authy/hooks/authy_authenticatable.rb +7 -0
- data/lib/devise-authy/models/authy_authenticatable.rb +23 -0
- data/lib/devise-authy/rails.rb +11 -0
- data/lib/devise-authy/routes.rb +20 -0
- data/lib/devise-authy/version.rb +3 -0
- data/lib/generators/active_record/devise_authy_generator.rb +13 -0
- data/lib/generators/active_record/templates/migration.rb +18 -0
- data/lib/generators/devise_authy/devise_authy_generator.rb +30 -0
- data/lib/generators/devise_authy/install_generator.rb +64 -0
- data/spec/controllers/devise_authy_controller_spec.rb +85 -0
- data/spec/generators_spec.rb +24 -0
- data/spec/integration/authy_authenticatable.rb +88 -0
- data/spec/models/authy_authenticatable.rb +17 -0
- data/spec/orm/active_record.rb +4 -0
- data/spec/rails_app/Rakefile +10 -0
- data/spec/rails_app/app/assets/images/rails.png +0 -0
- data/spec/rails_app/app/assets/javascripts/application.js +10 -0
- data/spec/rails_app/app/assets/stylesheets/application.css +9 -0
- data/spec/rails_app/app/assets/stylesheets/devise_authy.css +26 -0
- data/spec/rails_app/app/assets/stylesheets/devise_authy.css.scss +26 -0
- data/spec/rails_app/app/assets/stylesheets/scaffolds.css.scss +56 -0
- data/spec/rails_app/app/controllers/application_controller.rb +4 -0
- data/spec/rails_app/app/controllers/posts_controller.rb +83 -0
- data/spec/rails_app/app/helpers/application_helper.rb +2 -0
- data/spec/rails_app/app/helpers/posts_helper.rb +2 -0
- data/spec/rails_app/app/mailers/.gitkeep +0 -0
- data/spec/rails_app/app/models/.gitkeep +0 -0
- data/spec/rails_app/app/models/post.rb +2 -0
- data/spec/rails_app/app/models/user.rb +9 -0
- data/spec/rails_app/app/views/devise/devise_authy/register.html.erb +10 -0
- data/spec/rails_app/app/views/devise/devise_authy/show.html.erb +10 -0
- data/spec/rails_app/app/views/layouts/application.html.erb +24 -0
- data/spec/rails_app/app/views/posts/_form.html.erb +25 -0
- data/spec/rails_app/app/views/posts/edit.html.erb +6 -0
- data/spec/rails_app/app/views/posts/index.html.erb +27 -0
- data/spec/rails_app/app/views/posts/new.html.erb +5 -0
- data/spec/rails_app/app/views/posts/show.html.erb +15 -0
- data/spec/rails_app/config.ru +4 -0
- data/spec/rails_app/config/application.rb +33 -0
- data/spec/rails_app/config/boot.rb +7 -0
- data/spec/rails_app/config/database.yml +22 -0
- data/spec/rails_app/config/environment.rb +5 -0
- data/spec/rails_app/config/environments/development.rb +37 -0
- data/spec/rails_app/config/environments/production.rb +67 -0
- data/spec/rails_app/config/environments/test.rb +37 -0
- data/spec/rails_app/config/initializers/authy.rb +3 -0
- data/spec/rails_app/config/initializers/backtrace_silencers.rb +7 -0
- data/spec/rails_app/config/initializers/devise.rb +237 -0
- data/spec/rails_app/config/initializers/inflections.rb +10 -0
- data/spec/rails_app/config/initializers/mime_types.rb +5 -0
- data/spec/rails_app/config/initializers/secret_token.rb +7 -0
- data/spec/rails_app/config/initializers/session_store.rb +8 -0
- data/spec/rails_app/config/initializers/wrap_parameters.rb +14 -0
- data/spec/rails_app/config/locales/devise.authy.en.yml +14 -0
- data/spec/rails_app/config/routes.rb +6 -0
- data/spec/rails_app/db/migrate/20121029205626_devise_create_users.rb +32 -0
- data/spec/rails_app/db/migrate/20121029205627_create_posts.rb +10 -0
- data/spec/rails_app/db/migrate/20121029205628_devise_authy_add_to_users.rb +15 -0
- data/spec/rails_app/db/schema.rb +43 -0
- data/spec/rails_app/public/favicon.ico +0 -0
- data/spec/rails_app/script/rails +6 -0
- data/spec/routing/routes_spec.rb +19 -0
- data/spec/spec_helper.rb +30 -0
- data/spec/support/helpers.rb +28 -0
- metadata +367 -0
@@ -0,0 +1,56 @@
|
|
1
|
+
body {
|
2
|
+
background-color: #fff;
|
3
|
+
color: #333;
|
4
|
+
font-family: verdana, arial, helvetica, sans-serif;
|
5
|
+
font-size: 13px;
|
6
|
+
line-height: 18px; }
|
7
|
+
|
8
|
+
p, ol, ul, td {
|
9
|
+
font-family: verdana, arial, helvetica, sans-serif;
|
10
|
+
font-size: 13px;
|
11
|
+
line-height: 18px; }
|
12
|
+
|
13
|
+
pre {
|
14
|
+
background-color: #eee;
|
15
|
+
padding: 10px;
|
16
|
+
font-size: 11px; }
|
17
|
+
|
18
|
+
a {
|
19
|
+
color: #000;
|
20
|
+
&:visited {
|
21
|
+
color: #666; }
|
22
|
+
&:hover {
|
23
|
+
color: #fff;}
|
24
|
+
}
|
25
|
+
|
26
|
+
div {
|
27
|
+
&.field, &.actions {
|
28
|
+
margin-bottom: 10px; } }
|
29
|
+
|
30
|
+
#notice {
|
31
|
+
color: green; }
|
32
|
+
|
33
|
+
.field_with_errors {
|
34
|
+
padding: 2px;
|
35
|
+
background-color: red;
|
36
|
+
display: table; }
|
37
|
+
|
38
|
+
#error_explanation {
|
39
|
+
width: 450px;
|
40
|
+
border: 2px solid red;
|
41
|
+
padding: 7px;
|
42
|
+
padding-bottom: 0;
|
43
|
+
margin-bottom: 20px;
|
44
|
+
background-color: #f0f0f0;
|
45
|
+
h2 {
|
46
|
+
text-align: left;
|
47
|
+
font-weight: bold;
|
48
|
+
padding: 5px 5px 5px 15px;
|
49
|
+
font-size: 12px;
|
50
|
+
margin: -7px;
|
51
|
+
margin-bottom: 0px;
|
52
|
+
background-color: #c00;
|
53
|
+
color: #fff; }
|
54
|
+
ul li {
|
55
|
+
font-size: 12px;
|
56
|
+
list-style: square; } }
|
@@ -0,0 +1,83 @@
|
|
1
|
+
class PostsController < ApplicationController
|
2
|
+
# GET /posts
|
3
|
+
# GET /posts.json
|
4
|
+
def index
|
5
|
+
@posts = Post.all
|
6
|
+
|
7
|
+
respond_to do |format|
|
8
|
+
format.html # index.html.erb
|
9
|
+
format.json { render json: @posts }
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
# GET /posts/1
|
14
|
+
# GET /posts/1.json
|
15
|
+
def show
|
16
|
+
@post = Post.find(params[:id])
|
17
|
+
|
18
|
+
respond_to do |format|
|
19
|
+
format.html # show.html.erb
|
20
|
+
format.json { render json: @post }
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
# GET /posts/new
|
25
|
+
# GET /posts/new.json
|
26
|
+
def new
|
27
|
+
@post = Post.new
|
28
|
+
|
29
|
+
respond_to do |format|
|
30
|
+
format.html # new.html.erb
|
31
|
+
format.json { render json: @post }
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
# GET /posts/1/edit
|
36
|
+
def edit
|
37
|
+
@post = Post.find(params[:id])
|
38
|
+
end
|
39
|
+
|
40
|
+
# POST /posts
|
41
|
+
# POST /posts.json
|
42
|
+
def create
|
43
|
+
@post = Post.new(params[:post])
|
44
|
+
|
45
|
+
respond_to do |format|
|
46
|
+
if @post.save
|
47
|
+
format.html { redirect_to @post, notice: 'Post was successfully created.' }
|
48
|
+
format.json { render json: @post, status: :created, location: @post }
|
49
|
+
else
|
50
|
+
format.html { render action: "new" }
|
51
|
+
format.json { render json: @post.errors, status: :unprocessable_entity }
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
56
|
+
# PUT /posts/1
|
57
|
+
# PUT /posts/1.json
|
58
|
+
def update
|
59
|
+
@post = Post.find(params[:id])
|
60
|
+
|
61
|
+
respond_to do |format|
|
62
|
+
if @post.update_attributes(params[:post])
|
63
|
+
format.html { redirect_to @post, notice: 'Post was successfully updated.' }
|
64
|
+
format.json { head :ok }
|
65
|
+
else
|
66
|
+
format.html { render action: "edit" }
|
67
|
+
format.json { render json: @post.errors, status: :unprocessable_entity }
|
68
|
+
end
|
69
|
+
end
|
70
|
+
end
|
71
|
+
|
72
|
+
# DELETE /posts/1
|
73
|
+
# DELETE /posts/1.json
|
74
|
+
def destroy
|
75
|
+
@post = Post.find(params[:id])
|
76
|
+
@post.destroy
|
77
|
+
|
78
|
+
respond_to do |format|
|
79
|
+
format.html { redirect_to posts_url }
|
80
|
+
format.json { head :ok }
|
81
|
+
end
|
82
|
+
end
|
83
|
+
end
|
File without changes
|
File without changes
|
@@ -0,0 +1,9 @@
|
|
1
|
+
class User < ActiveRecord::Base
|
2
|
+
# Include default devise modules. Others available are:
|
3
|
+
# :token_authenticatable, :encryptable, :confirmable, :lockable, :timeoutable and :omniauthable
|
4
|
+
devise :authy_authenticatable, :database_authenticatable, :registerable,
|
5
|
+
:recoverable, :rememberable, :trackable, :validatable
|
6
|
+
|
7
|
+
# Setup accessible (or protected) attributes for your model
|
8
|
+
attr_accessible :email, :password, :password_confirmation, :authy_id, :last_sign_in_with_authy
|
9
|
+
end
|
@@ -0,0 +1,10 @@
|
|
1
|
+
<h2><%= I18n.t('authy_register_title', {:scope => 'devise'}) %></h2>
|
2
|
+
|
3
|
+
<%= form_tag([resource_name, :devise_authy], :html => { :method => :post }) do %>
|
4
|
+
|
5
|
+
<%= text_field_tag :cellphone, '', :autocomplete => :off, :placeholder =>
|
6
|
+
I18n.t('devise.cellphone'), :id => "authy-cellphone"%>
|
7
|
+
<%= text_field_tag :country_code, '', :autocomplete => :off, :placeholder =>
|
8
|
+
I18n.t('devise.country'), :id => "authy-countries"%>
|
9
|
+
<p><%= submit_tag I18n.t('enable_authy', {:scope => 'devise'}) %></p>
|
10
|
+
<% end %>
|
@@ -0,0 +1,10 @@
|
|
1
|
+
<div class="devise_authy">
|
2
|
+
<%= form_for(resource, :as => resource_name, :url => [resource_name, :devise_authy], :html => {:id => 'devise_authy', :method => :put }) do |f| %>
|
3
|
+
<legend><%= I18n.t('submit_token_title', {:scope => 'devise'}) %></legend>
|
4
|
+
<%= f.hidden_field :authy_id, {:value => @authy_id} %>
|
5
|
+
<%= f.label :token %>
|
6
|
+
<%= f.text_field :token, :autocomplete => :off, :id => 'authy-token'%>
|
7
|
+
<%= link_to '?', '#', :id => 'authy-help' %>
|
8
|
+
<%= f.submit I18n.t('submit_token', {:scope => 'devise'}), :class => 'btn' %>
|
9
|
+
<% end %>
|
10
|
+
</div>
|
@@ -0,0 +1,24 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>Authy App</title>
|
5
|
+
<%= stylesheet_link_tag 'application' %>
|
6
|
+
<%= javascript_include_tag 'application' %>
|
7
|
+
<%= csrf_meta_tags %>
|
8
|
+
</head>
|
9
|
+
<body>
|
10
|
+
<% if flash[:notice] %>
|
11
|
+
<div id="notice">
|
12
|
+
<%= flash[:notice] %>
|
13
|
+
</div>
|
14
|
+
<% end %>
|
15
|
+
|
16
|
+
<% if flash[:error] %>
|
17
|
+
<div class='alert alert-error'>
|
18
|
+
<%= flash[:error] %>
|
19
|
+
<% end %>
|
20
|
+
|
21
|
+
<%= yield %>
|
22
|
+
|
23
|
+
</body>
|
24
|
+
</html>
|
@@ -0,0 +1,25 @@
|
|
1
|
+
<%= form_for(@post) do |f| %>
|
2
|
+
<% if @post.errors.any? %>
|
3
|
+
<div id="error_explanation">
|
4
|
+
<h2><%= pluralize(@post.errors.count, "error") %> prohibited this post from being saved:</h2>
|
5
|
+
|
6
|
+
<ul>
|
7
|
+
<% @post.errors.full_messages.each do |msg| %>
|
8
|
+
<li><%= msg %></li>
|
9
|
+
<% end %>
|
10
|
+
</ul>
|
11
|
+
</div>
|
12
|
+
<% end %>
|
13
|
+
|
14
|
+
<div class="field">
|
15
|
+
<%= f.label :title %><br />
|
16
|
+
<%= f.text_field :title %>
|
17
|
+
</div>
|
18
|
+
<div class="field">
|
19
|
+
<%= f.label :body %><br />
|
20
|
+
<%= f.text_area :body %>
|
21
|
+
</div>
|
22
|
+
<div class="actions">
|
23
|
+
<%= f.submit %>
|
24
|
+
</div>
|
25
|
+
<% end %>
|
@@ -0,0 +1,27 @@
|
|
1
|
+
<h1>Listing posts</h1>
|
2
|
+
|
3
|
+
<table>
|
4
|
+
<tr>
|
5
|
+
<th>Title</th>
|
6
|
+
<th>Body</th>
|
7
|
+
<th></th>
|
8
|
+
<th></th>
|
9
|
+
<th></th>
|
10
|
+
</tr>
|
11
|
+
|
12
|
+
<% @posts.each do |post| %>
|
13
|
+
<tr>
|
14
|
+
<td><%= post.title %></td>
|
15
|
+
<td><%= post.body %></td>
|
16
|
+
<td><%= link_to 'Show', post %></td>
|
17
|
+
<td><%= link_to 'Edit', edit_post_path(post) %></td>
|
18
|
+
<td><%= link_to 'Destroy', post, confirm: 'Are you sure?', method: :delete %></td>
|
19
|
+
</tr>
|
20
|
+
<% end %>
|
21
|
+
</table>
|
22
|
+
|
23
|
+
<br />
|
24
|
+
|
25
|
+
<%= link_to 'New Post', new_post_path %>
|
26
|
+
<%= link_to 'Enable Authy', user_enable_authy_path %>
|
27
|
+
<%= link_to 'Logout', destroy_user_session_path, :method => :delete %>
|
@@ -0,0 +1,33 @@
|
|
1
|
+
require File.expand_path('../boot', __FILE__)
|
2
|
+
|
3
|
+
require "action_controller/railtie"
|
4
|
+
require "action_mailer/railtie"
|
5
|
+
require "active_resource/railtie"
|
6
|
+
require "active_record/railtie"
|
7
|
+
require 'sprockets/railtie'
|
8
|
+
|
9
|
+
if defined?(Bundler)
|
10
|
+
# If you precompile assets before deploying to production, use this line
|
11
|
+
Bundler.require(*Rails.groups(:assets => %w(development test)))
|
12
|
+
# If you want your assets lazily compiled in production, use this line
|
13
|
+
# Bundler.require(:default, :assets, Rails.env)
|
14
|
+
end
|
15
|
+
|
16
|
+
require "devise"
|
17
|
+
require "devise/rails"
|
18
|
+
require "devise-authy"
|
19
|
+
|
20
|
+
module RailsApp
|
21
|
+
class Application < Rails::Application
|
22
|
+
config.filter_parameters << :password
|
23
|
+
|
24
|
+
# Configure the default encoding used in templates for Ruby 1.9.
|
25
|
+
config.encoding = "utf-8"
|
26
|
+
|
27
|
+
# Enable the asset pipeline
|
28
|
+
config.assets.enabled = true
|
29
|
+
|
30
|
+
# Version of your assets, change this if you want to expire all your assets
|
31
|
+
config.assets.version = '1.0'
|
32
|
+
end
|
33
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# SQLite version 3.x
|
2
|
+
# gem install sqlite3-ruby (not necessary on OS X Leopard)
|
3
|
+
development:
|
4
|
+
adapter: sqlite3
|
5
|
+
database: "db/devise_authy_dev.sqlite3"
|
6
|
+
pool: 5
|
7
|
+
timeout: 5000
|
8
|
+
|
9
|
+
# Warning: The database defined as "test" will be erased and
|
10
|
+
# re-generated from your development database when you run "rake".
|
11
|
+
# Do not set this db to the same as development or production.
|
12
|
+
test:
|
13
|
+
adapter: sqlite3
|
14
|
+
database: "db/devise_authy_test.sqlite3"
|
15
|
+
pool: 5
|
16
|
+
timeout: 5000
|
17
|
+
|
18
|
+
production:
|
19
|
+
adapter: sqlite3
|
20
|
+
database: db/production.sqlite3
|
21
|
+
pool: 5
|
22
|
+
timeout: 5000
|
@@ -0,0 +1,37 @@
|
|
1
|
+
RailsApp::Application.configure do
|
2
|
+
# Settings specified here will take precedence over those in config/application.rb
|
3
|
+
|
4
|
+
# In the development environment your application's code is reloaded on
|
5
|
+
# every request. This slows down response time but is perfect for development
|
6
|
+
# since you don't have to restart the web server when you make code changes.
|
7
|
+
config.cache_classes = false
|
8
|
+
|
9
|
+
# Log error messages when you accidentally call methods on nil.
|
10
|
+
config.whiny_nils = true
|
11
|
+
|
12
|
+
# Show full error reports and disable caching
|
13
|
+
config.consider_all_requests_local = true
|
14
|
+
config.action_controller.perform_caching = false
|
15
|
+
|
16
|
+
# Don't care if the mailer can't send
|
17
|
+
config.action_mailer.raise_delivery_errors = false
|
18
|
+
|
19
|
+
# Print deprecation notices to the Rails logger
|
20
|
+
config.active_support.deprecation = :log
|
21
|
+
|
22
|
+
# Only use best-standards-support built into browsers
|
23
|
+
config.action_dispatch.best_standards_support = :builtin
|
24
|
+
|
25
|
+
# Raise exception on mass assignment protection for Active Record models
|
26
|
+
config.active_record.mass_assignment_sanitizer = :strict
|
27
|
+
|
28
|
+
# Log the query plan for queries taking more than this (works
|
29
|
+
# with SQLite, MySQL, and PostgreSQL)
|
30
|
+
config.active_record.auto_explain_threshold_in_seconds = 0.5
|
31
|
+
|
32
|
+
# Do not compress assets
|
33
|
+
config.assets.compress = false
|
34
|
+
|
35
|
+
# Expands the lines which load the assets
|
36
|
+
config.assets.debug = true
|
37
|
+
end
|
@@ -0,0 +1,67 @@
|
|
1
|
+
RailsApp::Application.configure do
|
2
|
+
# Settings specified here will take precedence over those in config/application.rb
|
3
|
+
|
4
|
+
# Code is not reloaded between requests
|
5
|
+
config.cache_classes = true
|
6
|
+
|
7
|
+
# Full error reports are disabled and caching is turned on
|
8
|
+
config.consider_all_requests_local = false
|
9
|
+
config.action_controller.perform_caching = true
|
10
|
+
|
11
|
+
# Disable Rails's static asset server (Apache or nginx will already do this)
|
12
|
+
config.serve_static_assets = false
|
13
|
+
|
14
|
+
# Compress JavaScripts and CSS
|
15
|
+
config.assets.compress = true
|
16
|
+
|
17
|
+
# Don't fallback to assets pipeline if a precompiled asset is missed
|
18
|
+
config.assets.compile = false
|
19
|
+
|
20
|
+
# Generate digests for assets URLs
|
21
|
+
config.assets.digest = true
|
22
|
+
|
23
|
+
# Defaults to nil and saved in location specified by config.assets.prefix
|
24
|
+
# config.assets.manifest = YOUR_PATH
|
25
|
+
|
26
|
+
# Specifies the header that your server uses for sending files
|
27
|
+
# config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache
|
28
|
+
# config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx
|
29
|
+
|
30
|
+
# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
|
31
|
+
# config.force_ssl = true
|
32
|
+
|
33
|
+
# See everything in the log (default is :info)
|
34
|
+
# config.log_level = :debug
|
35
|
+
|
36
|
+
# Prepend all log lines with the following tags
|
37
|
+
# config.log_tags = [ :subdomain, :uuid ]
|
38
|
+
|
39
|
+
# Use a different logger for distributed setups
|
40
|
+
# config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
|
41
|
+
|
42
|
+
# Use a different cache store in production
|
43
|
+
# config.cache_store = :mem_cache_store
|
44
|
+
|
45
|
+
# Enable serving of images, stylesheets, and JavaScripts from an asset server
|
46
|
+
# config.action_controller.asset_host = "http://assets.example.com"
|
47
|
+
|
48
|
+
# Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added)
|
49
|
+
# config.assets.precompile += %w( search.js )
|
50
|
+
|
51
|
+
# Disable delivery errors, bad email addresses will be ignored
|
52
|
+
# config.action_mailer.raise_delivery_errors = false
|
53
|
+
|
54
|
+
# Enable threaded mode
|
55
|
+
# config.threadsafe!
|
56
|
+
|
57
|
+
# Enable locale fallbacks for I18n (makes lookups for any locale fall back to
|
58
|
+
# the I18n.default_locale when a translation can not be found)
|
59
|
+
config.i18n.fallbacks = true
|
60
|
+
|
61
|
+
# Send deprecation notices to registered listeners
|
62
|
+
config.active_support.deprecation = :notify
|
63
|
+
|
64
|
+
# Log the query plan for queries taking more than this (works
|
65
|
+
# with SQLite, MySQL, and PostgreSQL)
|
66
|
+
# config.active_record.auto_explain_threshold_in_seconds = 0.5
|
67
|
+
end
|