sapience 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.coveralls.yml +1 -0
- data/.gitignore +13 -0
- data/.rspec +2 -0
- data/.ruby-version +1 -0
- data/.simplecov +15 -0
- data/.travis.yml +27 -0
- data/CODE_OF_CONDUCT.md +49 -0
- data/Gemfile +12 -0
- data/LICENSE.txt +21 -0
- data/README.md +43 -0
- data/Rakefile +13 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/lib/sapience/ansi_colors.rb +27 -0
- data/lib/sapience/appender/file.rb +138 -0
- data/lib/sapience/appender/sentry.rb +72 -0
- data/lib/sapience/appender/statsd.rb +68 -0
- data/lib/sapience/appender/wrapper.rb +74 -0
- data/lib/sapience/base.rb +381 -0
- data/lib/sapience/concerns/compatibility.rb +53 -0
- data/lib/sapience/configuration.rb +86 -0
- data/lib/sapience/core_ext/thread.rb +14 -0
- data/lib/sapience/formatters/base.rb +36 -0
- data/lib/sapience/formatters/color.rb +68 -0
- data/lib/sapience/formatters/default.rb +41 -0
- data/lib/sapience/formatters/json.rb +22 -0
- data/lib/sapience/formatters/raw.rb +12 -0
- data/lib/sapience/log.rb +221 -0
- data/lib/sapience/loggable.rb +29 -0
- data/lib/sapience/logger.rb +236 -0
- data/lib/sapience/rails.rb +15 -0
- data/lib/sapience/sapience.rb +357 -0
- data/lib/sapience/subscriber.rb +127 -0
- data/lib/sapience/version.rb +3 -0
- data/lib/sapience.rb +35 -0
- data/sapience.gemspec +39 -0
- data/test_app/.gitignore +42 -0
- data/test_app/.rspec +2 -0
- data/test_app/.ruby-version +1 -0
- data/test_app/Gemfile +36 -0
- data/test_app/README.md +24 -0
- data/test_app/Rakefile +6 -0
- data/test_app/app/assets/config/manifest.js +2 -0
- data/test_app/app/assets/images/.keep +0 -0
- data/test_app/app/assets/javascripts/posts.js +2 -0
- data/test_app/app/assets/stylesheets/application.css +15 -0
- data/test_app/app/assets/stylesheets/posts.css +4 -0
- data/test_app/app/assets/stylesheets/scaffold.css +84 -0
- data/test_app/app/channels/application_cable/channel.rb +4 -0
- data/test_app/app/channels/application_cable/connection.rb +4 -0
- data/test_app/app/controllers/application_controller.rb +3 -0
- data/test_app/app/controllers/concerns/.keep +0 -0
- data/test_app/app/controllers/posts_controller.rb +58 -0
- data/test_app/app/helpers/application_helper.rb +2 -0
- data/test_app/app/helpers/posts_helper.rb +2 -0
- data/test_app/app/jobs/application_job.rb +2 -0
- data/test_app/app/mailers/application_mailer.rb +4 -0
- data/test_app/app/models/application_record.rb +3 -0
- data/test_app/app/models/concerns/.keep +0 -0
- data/test_app/app/models/post.rb +3 -0
- data/test_app/app/models/user.rb +2 -0
- data/test_app/app/views/layouts/application.html.erb +13 -0
- data/test_app/app/views/layouts/mailer.html.erb +13 -0
- data/test_app/app/views/layouts/mailer.text.erb +1 -0
- data/test_app/app/views/posts/_form.html.erb +32 -0
- data/test_app/app/views/posts/create.html.erb +2 -0
- data/test_app/app/views/posts/destroy.html.erb +2 -0
- data/test_app/app/views/posts/edit.html.erb +6 -0
- data/test_app/app/views/posts/index.html.erb +31 -0
- data/test_app/app/views/posts/new.html.erb +5 -0
- data/test_app/app/views/posts/show.html.erb +19 -0
- data/test_app/app/views/posts/update.html.erb +2 -0
- data/test_app/bin/bundle +3 -0
- data/test_app/bin/rails +4 -0
- data/test_app/bin/rake +4 -0
- data/test_app/bin/setup +34 -0
- data/test_app/bin/update +29 -0
- data/test_app/config/application.rb +26 -0
- data/test_app/config/boot.rb +3 -0
- data/test_app/config/cable.yml +9 -0
- data/test_app/config/database.yml +25 -0
- data/test_app/config/environment.rb +5 -0
- data/test_app/config/environments/development.rb +49 -0
- data/test_app/config/environments/production.rb +78 -0
- data/test_app/config/environments/test.rb +42 -0
- data/test_app/config/initializers/application_controller_renderer.rb +6 -0
- data/test_app/config/initializers/backtrace_silencers.rb +7 -0
- data/test_app/config/initializers/cookies_serializer.rb +5 -0
- data/test_app/config/initializers/filter_parameter_logging.rb +4 -0
- data/test_app/config/initializers/inflections.rb +16 -0
- data/test_app/config/initializers/mime_types.rb +4 -0
- data/test_app/config/initializers/new_framework_defaults.rb +24 -0
- data/test_app/config/initializers/session_store.rb +3 -0
- data/test_app/config/initializers/wrap_parameters.rb +14 -0
- data/test_app/config/locales/en.yml +23 -0
- data/test_app/config/puma.rb +45 -0
- data/test_app/config/routes.rb +3 -0
- data/test_app/config/secrets.yml +22 -0
- data/test_app/config.ru +5 -0
- data/test_app/db/migrate/20160812092236_create_users.rb +13 -0
- data/test_app/db/migrate/20160812093621_create_posts.rb +11 -0
- data/test_app/db/schema.rb +33 -0
- data/test_app/db/seeds.rb +7 -0
- data/test_app/lib/assets/.keep +0 -0
- data/test_app/lib/tasks/.keep +0 -0
- data/test_app/log/.keep +0 -0
- data/test_app/public/404.html +67 -0
- data/test_app/public/422.html +67 -0
- data/test_app/public/500.html +66 -0
- data/test_app/public/apple-touch-icon-precomposed.png +0 -0
- data/test_app/public/apple-touch-icon.png +0 -0
- data/test_app/public/favicon.ico +0 -0
- data/test_app/public/robots.txt +5 -0
- data/test_app/spec/controllers/posts_controller_spec.rb +7 -0
- data/test_app/spec/helpers/posts_helper_spec.rb +15 -0
- data/test_app/spec/models/post_spec.rb +5 -0
- data/test_app/spec/models/user_spec.rb +5 -0
- data/test_app/spec/rails_helper.rb +23 -0
- data/test_app/spec/requests/posts_spec.rb +10 -0
- data/test_app/spec/routing/posts_routing_spec.rb +39 -0
- data/test_app/spec/spec_helper.rb +60 -0
- data/test_app/tmp/.keep +0 -0
- data/test_app/vendor/assets/stylesheets/.keep +0 -0
- metadata +298 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* This is a manifest file that'll be compiled into application.css, which will include all the files
|
|
3
|
+
* listed below.
|
|
4
|
+
*
|
|
5
|
+
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
|
|
6
|
+
* or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path.
|
|
7
|
+
*
|
|
8
|
+
* You're free to add application-wide styles to this file and they'll appear at the bottom of the
|
|
9
|
+
* compiled file so the styles you add here take precedence over styles defined in any other CSS/SCSS
|
|
10
|
+
* files in this directory. Styles in this file should be added after the last require_* statement.
|
|
11
|
+
* It is generally better to create a new file per style scope.
|
|
12
|
+
*
|
|
13
|
+
*= require_tree .
|
|
14
|
+
*= require_self
|
|
15
|
+
*/
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
body {
|
|
2
|
+
background-color: #fff;
|
|
3
|
+
color: #333;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
body, p, ol, ul, td {
|
|
7
|
+
font-family: verdana, arial, helvetica, sans-serif;
|
|
8
|
+
font-size: 13px;
|
|
9
|
+
line-height: 18px;
|
|
10
|
+
margin: 33px;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
pre {
|
|
14
|
+
background-color: #eee;
|
|
15
|
+
padding: 10px;
|
|
16
|
+
font-size: 11px;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
a {
|
|
20
|
+
color: #000;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
a:visited {
|
|
24
|
+
color: #666;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
a:hover {
|
|
28
|
+
color: #fff;
|
|
29
|
+
background-color: #000;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
th {
|
|
33
|
+
padding-bottom: 5px;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
td {
|
|
37
|
+
padding-bottom: 7px;
|
|
38
|
+
padding-left: 5px;
|
|
39
|
+
padding-right: 5px;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
div.field,
|
|
43
|
+
div.actions {
|
|
44
|
+
margin-bottom: 10px;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
#notice {
|
|
48
|
+
color: green;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.field_with_errors {
|
|
52
|
+
padding: 2px;
|
|
53
|
+
background-color: red;
|
|
54
|
+
display: table;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
#error_explanation {
|
|
58
|
+
width: 450px;
|
|
59
|
+
border: 2px solid red;
|
|
60
|
+
padding: 7px;
|
|
61
|
+
padding-bottom: 0;
|
|
62
|
+
margin-bottom: 20px;
|
|
63
|
+
background-color: #f0f0f0;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
#error_explanation h2 {
|
|
67
|
+
text-align: left;
|
|
68
|
+
font-weight: bold;
|
|
69
|
+
padding: 5px 5px 5px 15px;
|
|
70
|
+
font-size: 12px;
|
|
71
|
+
margin: -7px;
|
|
72
|
+
margin-bottom: 0;
|
|
73
|
+
background-color: #c00;
|
|
74
|
+
color: #fff;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
#error_explanation ul li {
|
|
78
|
+
font-size: 12px;
|
|
79
|
+
list-style: square;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
label {
|
|
83
|
+
display: block;
|
|
84
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
class PostsController < ApplicationController
|
|
2
|
+
before_action :set_post, only: [:show, :edit, :update, :destroy]
|
|
3
|
+
|
|
4
|
+
# GET /posts
|
|
5
|
+
def index
|
|
6
|
+
@posts = Post.all
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
# GET /posts/1
|
|
10
|
+
def show
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
# GET /posts/new
|
|
14
|
+
def new
|
|
15
|
+
@post = Post.new
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
# GET /posts/1/edit
|
|
19
|
+
def edit
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
# POST /posts
|
|
23
|
+
def create
|
|
24
|
+
@post = Post.new(post_params)
|
|
25
|
+
|
|
26
|
+
if @post.save
|
|
27
|
+
redirect_to @post, notice: 'Post was successfully created.'
|
|
28
|
+
else
|
|
29
|
+
render :new
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
# PATCH/PUT /posts/1
|
|
34
|
+
def update
|
|
35
|
+
if @post.update(post_params)
|
|
36
|
+
redirect_to @post, notice: 'Post was successfully updated.'
|
|
37
|
+
else
|
|
38
|
+
render :edit
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
# DELETE /posts/1
|
|
43
|
+
def destroy
|
|
44
|
+
@post.destroy
|
|
45
|
+
redirect_to posts_url, notice: 'Post was successfully destroyed.'
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
private
|
|
49
|
+
# Use callbacks to share common setup or constraints between actions.
|
|
50
|
+
def set_post
|
|
51
|
+
@post = Post.find(params[:id])
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
# Only allow a trusted parameter "white list" through.
|
|
55
|
+
def post_params
|
|
56
|
+
params.require(:post).permit(:title, :body, :author_id)
|
|
57
|
+
end
|
|
58
|
+
end
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<%= yield %>
|
|
@@ -0,0 +1,32 @@
|
|
|
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 |message| %>
|
|
8
|
+
<li><%= message %></li>
|
|
9
|
+
<% end %>
|
|
10
|
+
</ul>
|
|
11
|
+
</div>
|
|
12
|
+
<% end %>
|
|
13
|
+
|
|
14
|
+
<div class="field">
|
|
15
|
+
<%= f.label :title %>
|
|
16
|
+
<%= f.text_field :title %>
|
|
17
|
+
</div>
|
|
18
|
+
|
|
19
|
+
<div class="field">
|
|
20
|
+
<%= f.label :body %>
|
|
21
|
+
<%= f.text_field :body %>
|
|
22
|
+
</div>
|
|
23
|
+
|
|
24
|
+
<div class="field">
|
|
25
|
+
<%= f.label :author_id %>
|
|
26
|
+
<%= f.text_field :author_id %>
|
|
27
|
+
</div>
|
|
28
|
+
|
|
29
|
+
<div class="actions">
|
|
30
|
+
<%= f.submit %>
|
|
31
|
+
</div>
|
|
32
|
+
<% end %>
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
<p id="notice"><%= notice %></p>
|
|
2
|
+
|
|
3
|
+
<h1>Posts</h1>
|
|
4
|
+
|
|
5
|
+
<table>
|
|
6
|
+
<thead>
|
|
7
|
+
<tr>
|
|
8
|
+
<th>Title</th>
|
|
9
|
+
<th>Body</th>
|
|
10
|
+
<th>Author</th>
|
|
11
|
+
<th colspan="3"></th>
|
|
12
|
+
</tr>
|
|
13
|
+
</thead>
|
|
14
|
+
|
|
15
|
+
<tbody>
|
|
16
|
+
<% @posts.each do |post| %>
|
|
17
|
+
<tr>
|
|
18
|
+
<td><%= post.title %></td>
|
|
19
|
+
<td><%= post.body %></td>
|
|
20
|
+
<td><%= post.author %></td>
|
|
21
|
+
<td><%= link_to 'Show', post %></td>
|
|
22
|
+
<td><%= link_to 'Edit', edit_post_path(post) %></td>
|
|
23
|
+
<td><%= link_to 'Destroy', post, method: :delete, data: { confirm: 'Are you sure?' } %></td>
|
|
24
|
+
</tr>
|
|
25
|
+
<% end %>
|
|
26
|
+
</tbody>
|
|
27
|
+
</table>
|
|
28
|
+
|
|
29
|
+
<br>
|
|
30
|
+
|
|
31
|
+
<%= link_to 'New Post', new_post_path %>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<p id="notice"><%= notice %></p>
|
|
2
|
+
|
|
3
|
+
<p>
|
|
4
|
+
<strong>Title:</strong>
|
|
5
|
+
<%= @post.title %>
|
|
6
|
+
</p>
|
|
7
|
+
|
|
8
|
+
<p>
|
|
9
|
+
<strong>Body:</strong>
|
|
10
|
+
<%= @post.body %>
|
|
11
|
+
</p>
|
|
12
|
+
|
|
13
|
+
<p>
|
|
14
|
+
<strong>Author:</strong>
|
|
15
|
+
<%= @post.author %>
|
|
16
|
+
</p>
|
|
17
|
+
|
|
18
|
+
<%= link_to 'Edit', edit_post_path(@post) %> |
|
|
19
|
+
<%= link_to 'Back', posts_path %>
|
data/test_app/bin/bundle
ADDED
data/test_app/bin/rails
ADDED
data/test_app/bin/rake
ADDED
data/test_app/bin/setup
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
require "pathname"
|
|
3
|
+
require "fileutils"
|
|
4
|
+
include FileUtils
|
|
5
|
+
|
|
6
|
+
# path to your application root.
|
|
7
|
+
APP_ROOT = Pathname.new File.expand_path("../../", __FILE__)
|
|
8
|
+
|
|
9
|
+
def system!(*args)
|
|
10
|
+
system(*args) || abort("\n== Command #{args} failed ==")
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
chdir APP_ROOT do
|
|
14
|
+
# This script is a starting point to setup your application.
|
|
15
|
+
# Add necessary setup steps to this file.
|
|
16
|
+
|
|
17
|
+
puts "== Installing dependencies =="
|
|
18
|
+
system! "gem install bundler --conservative"
|
|
19
|
+
system("bundle check") || system!("bundle install")
|
|
20
|
+
|
|
21
|
+
# puts "\n== Copying sample files =="
|
|
22
|
+
# unless File.exist?('config/database.yml')
|
|
23
|
+
# cp 'config/database.yml.sample', 'config/database.yml'
|
|
24
|
+
# end
|
|
25
|
+
|
|
26
|
+
puts "\n== Preparing database =="
|
|
27
|
+
system! "bin/rails db:setup"
|
|
28
|
+
|
|
29
|
+
puts "\n== Removing old logs and tempfiles =="
|
|
30
|
+
system! "bin/rails log:clear tmp:clear"
|
|
31
|
+
|
|
32
|
+
puts "\n== Restarting application server =="
|
|
33
|
+
system! "bin/rails restart"
|
|
34
|
+
end
|
data/test_app/bin/update
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
require "pathname"
|
|
3
|
+
require "fileutils"
|
|
4
|
+
include FileUtils
|
|
5
|
+
|
|
6
|
+
# path to your application root.
|
|
7
|
+
APP_ROOT = Pathname.new File.expand_path("../../", __FILE__)
|
|
8
|
+
|
|
9
|
+
def system!(*args)
|
|
10
|
+
system(*args) || abort("\n== Command #{args} failed ==")
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
chdir APP_ROOT do
|
|
14
|
+
# This script is a way to update your development environment automatically.
|
|
15
|
+
# Add necessary update steps to this file.
|
|
16
|
+
|
|
17
|
+
puts "== Installing dependencies =="
|
|
18
|
+
system! "gem install bundler --conservative"
|
|
19
|
+
system("bundle check") || system!("bundle install")
|
|
20
|
+
|
|
21
|
+
puts "\n== Updating database =="
|
|
22
|
+
system! "bin/rails db:migrate"
|
|
23
|
+
|
|
24
|
+
puts "\n== Removing old logs and tempfiles =="
|
|
25
|
+
system! "bin/rails log:clear tmp:clear"
|
|
26
|
+
|
|
27
|
+
puts "\n== Restarting application server =="
|
|
28
|
+
system! "bin/rails restart"
|
|
29
|
+
end
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
require_relative "boot"
|
|
2
|
+
|
|
3
|
+
require "rails"
|
|
4
|
+
# Pick the frameworks you want:
|
|
5
|
+
require "active_model/railtie"
|
|
6
|
+
require "active_job/railtie"
|
|
7
|
+
require "active_record/railtie"
|
|
8
|
+
require "action_controller/railtie"
|
|
9
|
+
require "action_mailer/railtie"
|
|
10
|
+
require "action_view/railtie"
|
|
11
|
+
require "action_cable/engine"
|
|
12
|
+
require "sapience/rails"
|
|
13
|
+
# require "sprockets/railtie"
|
|
14
|
+
# require "rails/test_unit/railtie"
|
|
15
|
+
|
|
16
|
+
# Require the gems listed in Gemfile, including any gems
|
|
17
|
+
# you've limited to :test, :development, or :production.
|
|
18
|
+
Bundler.require(*Rails.groups)
|
|
19
|
+
|
|
20
|
+
module TestApp
|
|
21
|
+
class Application < Rails::Application
|
|
22
|
+
# Settings in config/environments/* take precedence over those specified here.
|
|
23
|
+
# Application configuration should go into files in config/initializers
|
|
24
|
+
# -- all .rb files in that directory are automatically loaded.
|
|
25
|
+
end
|
|
26
|
+
end
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# SQLite version 3.x
|
|
2
|
+
# gem install sqlite3
|
|
3
|
+
#
|
|
4
|
+
# Ensure the SQLite 3 gem is defined in your Gemfile
|
|
5
|
+
# gem 'sqlite3'
|
|
6
|
+
#
|
|
7
|
+
default: &default
|
|
8
|
+
adapter: sqlite3
|
|
9
|
+
pool: 5
|
|
10
|
+
timeout: 5000
|
|
11
|
+
|
|
12
|
+
development:
|
|
13
|
+
<<: *default
|
|
14
|
+
database: db/development.sqlite3
|
|
15
|
+
|
|
16
|
+
# Warning: The database defined as "test" will be erased and
|
|
17
|
+
# re-generated from your development database when you run "rake".
|
|
18
|
+
# Do not set this db to the same as development or production.
|
|
19
|
+
test:
|
|
20
|
+
<<: *default
|
|
21
|
+
database: db/test.sqlite3
|
|
22
|
+
|
|
23
|
+
production:
|
|
24
|
+
<<: *default
|
|
25
|
+
database: db/production.sqlite3
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
Rails.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
|
+
# Do not eager load code on boot.
|
|
10
|
+
config.eager_load = false
|
|
11
|
+
|
|
12
|
+
# Show full error reports.
|
|
13
|
+
config.consider_all_requests_local = true
|
|
14
|
+
|
|
15
|
+
# Enable/disable caching. By default caching is disabled.
|
|
16
|
+
if Rails.root.join("tmp/caching-dev.txt").exist?
|
|
17
|
+
config.action_controller.perform_caching = true
|
|
18
|
+
|
|
19
|
+
config.cache_store = :memory_store
|
|
20
|
+
config.public_file_server.headers = {
|
|
21
|
+
"Cache-Control" => "public, max-age=172800",
|
|
22
|
+
}
|
|
23
|
+
else
|
|
24
|
+
config.action_controller.perform_caching = false
|
|
25
|
+
|
|
26
|
+
config.cache_store = :null_store
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
# Don't care if the mailer can't send.
|
|
30
|
+
config.action_mailer.raise_delivery_errors = false
|
|
31
|
+
|
|
32
|
+
config.action_mailer.perform_caching = false
|
|
33
|
+
|
|
34
|
+
# Print deprecation notices to the Rails logger.
|
|
35
|
+
config.active_support.deprecation = :log
|
|
36
|
+
|
|
37
|
+
# Raise an error on page load if there are pending migrations.
|
|
38
|
+
config.active_record.migration_error = :page_load
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
# Raises error for missing translations
|
|
42
|
+
# config.action_view.raise_on_missing_translations = true
|
|
43
|
+
|
|
44
|
+
# Use an evented file watcher to asynchronously detect changes in source code,
|
|
45
|
+
# routes, locales, etc. This feature depends on the listen gem.
|
|
46
|
+
config.file_watcher = ActiveSupport::EventedFileUpdateChecker
|
|
47
|
+
config.colorize_logging = false
|
|
48
|
+
config.log_level = :debug
|
|
49
|
+
end
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
Rails.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
|
+
# Eager load code on boot. This eager loads most of Rails and
|
|
8
|
+
# your application in memory, allowing both threaded web servers
|
|
9
|
+
# and those relying on copy on write to perform better.
|
|
10
|
+
# Rake tasks automatically ignore this option for performance.
|
|
11
|
+
config.eager_load = true
|
|
12
|
+
|
|
13
|
+
# Full error reports are disabled and caching is turned on.
|
|
14
|
+
config.consider_all_requests_local = false
|
|
15
|
+
config.action_controller.perform_caching = true
|
|
16
|
+
|
|
17
|
+
# Disable serving static files from the `/public` folder by default since
|
|
18
|
+
# Apache or NGINX already handles this.
|
|
19
|
+
config.public_file_server.enabled = ENV["RAILS_SERVE_STATIC_FILES"].present?
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
# Enable serving of images, stylesheets, and JavaScripts from an asset server.
|
|
23
|
+
# config.action_controller.asset_host = 'http://assets.example.com'
|
|
24
|
+
|
|
25
|
+
# Specifies the header that your server uses for sending files.
|
|
26
|
+
# config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache
|
|
27
|
+
# config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX
|
|
28
|
+
|
|
29
|
+
# Mount Action Cable outside main process or domain
|
|
30
|
+
# config.action_cable.mount_path = nil
|
|
31
|
+
# config.action_cable.url = 'wss://example.com/cable'
|
|
32
|
+
# config.action_cable.allowed_request_origins = [ 'http://example.com', /http:\/\/example.*/ ]
|
|
33
|
+
|
|
34
|
+
# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
|
|
35
|
+
# config.force_ssl = true
|
|
36
|
+
|
|
37
|
+
# Use the lowest log level to ensure availability of diagnostic information
|
|
38
|
+
# when problems arise.
|
|
39
|
+
config.log_level = :debug
|
|
40
|
+
|
|
41
|
+
# Prepend all log lines with the following tags.
|
|
42
|
+
config.log_tags = [:request_id]
|
|
43
|
+
|
|
44
|
+
# Use a different cache store in production.
|
|
45
|
+
# config.cache_store = :mem_cache_store
|
|
46
|
+
|
|
47
|
+
# Use a real queuing backend for Active Job (and separate queues per environment)
|
|
48
|
+
# config.active_job.queue_adapter = :resque
|
|
49
|
+
# config.active_job.queue_name_prefix = "test_app_#{Rails.env}"
|
|
50
|
+
config.action_mailer.perform_caching = false
|
|
51
|
+
|
|
52
|
+
# Ignore bad email addresses and do not raise email delivery errors.
|
|
53
|
+
# Set this to true and configure the email server for immediate delivery to raise delivery errors.
|
|
54
|
+
# config.action_mailer.raise_delivery_errors = false
|
|
55
|
+
|
|
56
|
+
# Enable locale fallbacks for I18n (makes lookups for any locale fall back to
|
|
57
|
+
# the I18n.default_locale when a translation cannot be found).
|
|
58
|
+
config.i18n.fallbacks = true
|
|
59
|
+
|
|
60
|
+
# Send deprecation notices to registered listeners.
|
|
61
|
+
config.active_support.deprecation = :notify
|
|
62
|
+
|
|
63
|
+
# Use default logging formatter so that PID and timestamp are not suppressed.
|
|
64
|
+
config.log_formatter = ::Logger::Formatter.new
|
|
65
|
+
|
|
66
|
+
# Use a different logger for distributed setups.
|
|
67
|
+
# require 'syslog/logger'
|
|
68
|
+
# config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new 'app-name')
|
|
69
|
+
|
|
70
|
+
if ENV["RAILS_LOG_TO_STDOUT"].present?
|
|
71
|
+
logger = ActiveSupport::Logger.new(STDOUT)
|
|
72
|
+
logger.formatter = config.log_formatter
|
|
73
|
+
config.logger = ActiveSupport::TaggedLogging.new(logger)
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
# Do not dump schema after migrations.
|
|
77
|
+
config.active_record.dump_schema_after_migration = false
|
|
78
|
+
end
|