rack-action_logger 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +53 -0
- data/.rspec +2 -0
- data/.travis.yml +5 -0
- data/CODE_OF_CONDUCT.md +74 -0
- data/Gemfile +4 -0
- data/Gemfile.lock +51 -0
- data/LICENSE.txt +21 -0
- data/README.md +108 -0
- data/Rakefile +6 -0
- data/bin/console +14 -0
- data/bin/rspec +17 -0
- data/bin/setup +8 -0
- data/docs/action_log.png +0 -0
- data/docs/attributed_log.png +0 -0
- data/docs/request_log.png +0 -0
- data/docs/sample_log.png +0 -0
- data/example/rails4/.generators +8 -0
- data/example/rails4/.gitignore +48 -0
- data/example/rails4/.rakeTasks +7 -0
- data/example/rails4/Gemfile +53 -0
- data/example/rails4/Gemfile.lock +192 -0
- data/example/rails4/README.rdoc +28 -0
- data/example/rails4/Rakefile +6 -0
- data/example/rails4/app/assets/images/.keep +0 -0
- data/example/rails4/app/assets/javascripts/application.js +16 -0
- data/example/rails4/app/assets/javascripts/hello.coffee +3 -0
- data/example/rails4/app/assets/stylesheets/application.css +15 -0
- data/example/rails4/app/assets/stylesheets/hello.scss +3 -0
- data/example/rails4/app/controllers/application_controller.rb +7 -0
- data/example/rails4/app/controllers/concerns/.keep +0 -0
- data/example/rails4/app/controllers/hello_controller.rb +6 -0
- data/example/rails4/app/helpers/application_helper.rb +2 -0
- data/example/rails4/app/helpers/hello_helper.rb +2 -0
- data/example/rails4/app/mailers/.keep +0 -0
- data/example/rails4/app/models/.keep +0 -0
- data/example/rails4/app/models/concerns/.keep +0 -0
- data/example/rails4/app/views/hello/index.html.erb +2 -0
- data/example/rails4/app/views/layouts/application.html.erb +14 -0
- data/example/rails4/bin/bundle +3 -0
- data/example/rails4/bin/rails +4 -0
- data/example/rails4/bin/rake +4 -0
- data/example/rails4/bin/rspec +17 -0
- data/example/rails4/bin/setup +29 -0
- data/example/rails4/config/application.rb +37 -0
- data/example/rails4/config/boot.rb +3 -0
- data/example/rails4/config/database.yml +25 -0
- data/example/rails4/config/environment.rb +5 -0
- data/example/rails4/config/environments/development.rb +41 -0
- data/example/rails4/config/environments/production.rb +79 -0
- data/example/rails4/config/environments/test.rb +42 -0
- data/example/rails4/config/initializers/assets.rb +11 -0
- data/example/rails4/config/initializers/backtrace_silencers.rb +7 -0
- data/example/rails4/config/initializers/cookies_serializer.rb +3 -0
- data/example/rails4/config/initializers/filter_parameter_logging.rb +4 -0
- data/example/rails4/config/initializers/fluent_logger.rb +1 -0
- data/example/rails4/config/initializers/inflections.rb +16 -0
- data/example/rails4/config/initializers/mime_types.rb +4 -0
- data/example/rails4/config/initializers/rack-action_logger.rb +6 -0
- data/example/rails4/config/initializers/session_store.rb +3 -0
- data/example/rails4/config/initializers/wrap_parameters.rb +14 -0
- data/example/rails4/config/locales/en.yml +23 -0
- data/example/rails4/config/routes.rb +3 -0
- data/example/rails4/config/secrets.yml +22 -0
- data/example/rails4/config.ru +4 -0
- data/example/rails4/db/schema.rb +16 -0
- data/example/rails4/db/seeds.rb +7 -0
- data/example/rails4/lib/assets/.keep +0 -0
- data/example/rails4/lib/tasks/.keep +0 -0
- data/example/rails4/public/404.html +67 -0
- data/example/rails4/public/422.html +67 -0
- data/example/rails4/public/500.html +66 -0
- data/example/rails4/public/favicon.ico +0 -0
- data/example/rails4/public/robots.txt +5 -0
- data/example/rails4/spec/controllers/hello_controller_spec.rb +10 -0
- data/example/rails4/spec/rails_helper.rb +57 -0
- data/example/rails4/spec/spec_helper.rb +99 -0
- data/example/rails4/vendor/assets/javascripts/.keep +0 -0
- data/example/rails4/vendor/assets/stylesheets/.keep +0 -0
- data/example/rails5/.generators +8 -0
- data/example/rails5/.gitignore +48 -0
- data/example/rails5/.rakeTasks +7 -0
- data/example/rails5/Gemfile +54 -0
- data/example/rails5/Gemfile.lock +205 -0
- data/example/rails5/README.md +24 -0
- data/example/rails5/Rakefile +6 -0
- data/example/rails5/app/assets/config/manifest.js +3 -0
- data/example/rails5/app/assets/images/.keep +0 -0
- data/example/rails5/app/assets/javascripts/application.js +16 -0
- data/example/rails5/app/assets/javascripts/cable.js +13 -0
- data/example/rails5/app/assets/javascripts/channels/.keep +0 -0
- data/example/rails5/app/assets/javascripts/hello.coffee +3 -0
- data/example/rails5/app/assets/stylesheets/application.css +15 -0
- data/example/rails5/app/assets/stylesheets/hello.scss +3 -0
- data/example/rails5/app/channels/application_cable/channel.rb +4 -0
- data/example/rails5/app/channels/application_cable/connection.rb +4 -0
- data/example/rails5/app/controllers/application_controller.rb +5 -0
- data/example/rails5/app/controllers/concerns/.keep +0 -0
- data/example/rails5/app/controllers/hello_controller.rb +6 -0
- data/example/rails5/app/helpers/application_helper.rb +2 -0
- data/example/rails5/app/helpers/hello_helper.rb +2 -0
- data/example/rails5/app/jobs/application_job.rb +2 -0
- data/example/rails5/app/mailers/application_mailer.rb +4 -0
- data/example/rails5/app/models/application_record.rb +3 -0
- data/example/rails5/app/models/concerns/.keep +0 -0
- data/example/rails5/app/views/hello/index.html.erb +2 -0
- data/example/rails5/app/views/layouts/application.html.erb +14 -0
- data/example/rails5/app/views/layouts/mailer.html.erb +13 -0
- data/example/rails5/app/views/layouts/mailer.text.erb +1 -0
- data/example/rails5/bin/bundle +3 -0
- data/example/rails5/bin/rails +4 -0
- data/example/rails5/bin/rake +17 -0
- data/example/rails5/bin/rspec +17 -0
- data/example/rails5/bin/setup +34 -0
- data/example/rails5/bin/update +29 -0
- data/example/rails5/config/application.rb +13 -0
- data/example/rails5/config/boot.rb +3 -0
- data/example/rails5/config/cable.yml +9 -0
- data/example/rails5/config/database.yml +25 -0
- data/example/rails5/config/environment.rb +5 -0
- data/example/rails5/config/environments/development.rb +54 -0
- data/example/rails5/config/environments/production.rb +86 -0
- data/example/rails5/config/environments/test.rb +42 -0
- data/example/rails5/config/initializers/application_controller_renderer.rb +6 -0
- data/example/rails5/config/initializers/assets.rb +11 -0
- data/example/rails5/config/initializers/backtrace_silencers.rb +7 -0
- data/example/rails5/config/initializers/cookies_serializer.rb +5 -0
- data/example/rails5/config/initializers/filter_parameter_logging.rb +4 -0
- data/example/rails5/config/initializers/fluent_logger.rb +1 -0
- data/example/rails5/config/initializers/inflections.rb +16 -0
- data/example/rails5/config/initializers/mime_types.rb +4 -0
- data/example/rails5/config/initializers/new_framework_defaults.rb +24 -0
- data/example/rails5/config/initializers/rack-action_logger.rb +6 -0
- data/example/rails5/config/initializers/session_store.rb +3 -0
- data/example/rails5/config/initializers/wrap_parameters.rb +14 -0
- data/example/rails5/config/locales/en.yml +23 -0
- data/example/rails5/config/puma.rb +47 -0
- data/example/rails5/config/routes.rb +3 -0
- data/example/rails5/config/secrets.yml +22 -0
- data/example/rails5/config/spring.rb +6 -0
- data/example/rails5/config.ru +5 -0
- data/example/rails5/db/schema.rb +15 -0
- data/example/rails5/db/seeds.rb +7 -0
- data/example/rails5/lib/assets/.keep +0 -0
- data/example/rails5/lib/tasks/.keep +0 -0
- data/example/rails5/public/404.html +67 -0
- data/example/rails5/public/422.html +67 -0
- data/example/rails5/public/500.html +66 -0
- data/example/rails5/public/apple-touch-icon-precomposed.png +0 -0
- data/example/rails5/public/apple-touch-icon.png +0 -0
- data/example/rails5/public/favicon.ico +0 -0
- data/example/rails5/public/robots.txt +5 -0
- data/example/rails5/spec/controllers/hello_controller_spec.rb +10 -0
- data/example/rails5/spec/rails_helper.rb +57 -0
- data/example/rails5/spec/spec_helper.rb +99 -0
- data/example/rails5/vendor/assets/javascripts/.keep +0 -0
- data/example/rails5/vendor/assets/stylesheets/.keep +0 -0
- data/lib/rack/action_logger/configuration.rb +25 -0
- data/lib/rack/action_logger/container.rb +95 -0
- data/lib/rack/action_logger/context.rb +15 -0
- data/lib/rack/action_logger/controller_concerns/request_log.rb +18 -0
- data/lib/rack/action_logger/controller_concerns.rb +8 -0
- data/lib/rack/action_logger/emit_adapter/base.rb +18 -0
- data/lib/rack/action_logger/emit_adapter/fluent_adapter.rb +11 -0
- data/lib/rack/action_logger/emit_adapter/logger_adapter.rb +10 -0
- data/lib/rack/action_logger/emit_adapter/null_adapter.rb +7 -0
- data/lib/rack/action_logger/emitter.rb +44 -0
- data/lib/rack/action_logger/version.rb +5 -0
- data/lib/rack/action_logger.rb +30 -0
- data/rack-action_logger.gemspec +30 -0
- metadata +283 -0
@@ -0,0 +1,16 @@
|
|
1
|
+
# Be sure to restart your server when you modify this file.
|
2
|
+
|
3
|
+
# Add new inflection rules using the following format. Inflections
|
4
|
+
# are locale specific, and you may define rules for as many different
|
5
|
+
# locales as you wish. All of these examples are active by default:
|
6
|
+
# ActiveSupport::Inflector.inflections(:en) do |inflect|
|
7
|
+
# inflect.plural /^(ox)$/i, '\1en'
|
8
|
+
# inflect.singular /^(ox)en/i, '\1'
|
9
|
+
# inflect.irregular 'person', 'people'
|
10
|
+
# inflect.uncountable %w( fish sheep )
|
11
|
+
# end
|
12
|
+
|
13
|
+
# These inflection rules are supported but not enabled by default:
|
14
|
+
# ActiveSupport::Inflector.inflections(:en) do |inflect|
|
15
|
+
# inflect.acronym 'RESTful'
|
16
|
+
# end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
# Be sure to restart your server when you modify this file.
|
2
|
+
|
3
|
+
# This file contains settings for ActionController::ParamsWrapper which
|
4
|
+
# is enabled by default.
|
5
|
+
|
6
|
+
# Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
|
7
|
+
ActiveSupport.on_load(:action_controller) do
|
8
|
+
wrap_parameters format: [:json] if respond_to?(:wrap_parameters)
|
9
|
+
end
|
10
|
+
|
11
|
+
# To enable root element in JSON for ActiveRecord objects.
|
12
|
+
# ActiveSupport.on_load(:active_record) do
|
13
|
+
# self.include_root_in_json = true
|
14
|
+
# end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# Files in the config/locales directory are used for internationalization
|
2
|
+
# and are automatically loaded by Rails. If you want to use locales other
|
3
|
+
# than English, add the necessary files in this directory.
|
4
|
+
#
|
5
|
+
# To use the locales, use `I18n.t`:
|
6
|
+
#
|
7
|
+
# I18n.t 'hello'
|
8
|
+
#
|
9
|
+
# In views, this is aliased to just `t`:
|
10
|
+
#
|
11
|
+
# <%= t('hello') %>
|
12
|
+
#
|
13
|
+
# To use a different locale, set it with `I18n.locale`:
|
14
|
+
#
|
15
|
+
# I18n.locale = :es
|
16
|
+
#
|
17
|
+
# This would use the information in config/locales/es.yml.
|
18
|
+
#
|
19
|
+
# To learn more, please read the Rails Internationalization guide
|
20
|
+
# available at http://guides.rubyonrails.org/i18n.html.
|
21
|
+
|
22
|
+
en:
|
23
|
+
hello: "Hello world"
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# Be sure to restart your server when you modify this file.
|
2
|
+
|
3
|
+
# Your secret key is used for verifying the integrity of signed cookies.
|
4
|
+
# If you change this key, all old signed cookies will become invalid!
|
5
|
+
|
6
|
+
# Make sure the secret is at least 30 characters and all random,
|
7
|
+
# no regular words or you'll be exposed to dictionary attacks.
|
8
|
+
# You can use `rake secret` to generate a secure secret key.
|
9
|
+
|
10
|
+
# Make sure the secrets in this file are kept private
|
11
|
+
# if you're sharing your code publicly.
|
12
|
+
|
13
|
+
development:
|
14
|
+
secret_key_base: bbdac7456897f006ed57e669727e790c0f3674537fbda767e716037dfacbb3a49e40cf405a153d641a338c798263bb18e05d8e67cef87c45828aade581127169
|
15
|
+
|
16
|
+
test:
|
17
|
+
secret_key_base: 567e3cb8504f17fa71ee0cb8256037ac8d9e14d19cca0bec2f0c50f58758e8d9c31d6a5831ed01c52ba4139a6ece13a899e5b9f7b430746fcca16774ee2b5c86
|
18
|
+
|
19
|
+
# Do not keep production secrets in the repository,
|
20
|
+
# instead read values from the environment.
|
21
|
+
production:
|
22
|
+
secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# encoding: UTF-8
|
2
|
+
# This file is auto-generated from the current state of the database. Instead
|
3
|
+
# of editing this file, please use the migrations feature of Active Record to
|
4
|
+
# incrementally modify your database, and then regenerate this schema definition.
|
5
|
+
#
|
6
|
+
# Note that this schema.rb definition is the authoritative source for your
|
7
|
+
# database schema. If you need to create the application database on another
|
8
|
+
# system, you should be using db:schema:load, not running all the migrations
|
9
|
+
# from scratch. The latter is a flawed and unsustainable approach (the more migrations
|
10
|
+
# you'll amass, the slower it'll run and the greater likelihood for issues).
|
11
|
+
#
|
12
|
+
# It's strongly recommended that you check this file into your version control system.
|
13
|
+
|
14
|
+
ActiveRecord::Schema.define(version: 0) do
|
15
|
+
|
16
|
+
end
|
@@ -0,0 +1,7 @@
|
|
1
|
+
# This file should contain all the record creation needed to seed the database with its default values.
|
2
|
+
# The data can then be loaded with the rake db:seed (or created alongside the db with db:setup).
|
3
|
+
#
|
4
|
+
# Examples:
|
5
|
+
#
|
6
|
+
# cities = City.create([{ name: 'Chicago' }, { name: 'Copenhagen' }])
|
7
|
+
# Mayor.create(name: 'Emanuel', city: cities.first)
|
File without changes
|
File without changes
|
@@ -0,0 +1,67 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>The page you were looking for doesn't exist (404)</title>
|
5
|
+
<meta name="viewport" content="width=device-width,initial-scale=1">
|
6
|
+
<style>
|
7
|
+
body {
|
8
|
+
background-color: #EFEFEF;
|
9
|
+
color: #2E2F30;
|
10
|
+
text-align: center;
|
11
|
+
font-family: arial, sans-serif;
|
12
|
+
margin: 0;
|
13
|
+
}
|
14
|
+
|
15
|
+
div.dialog {
|
16
|
+
width: 95%;
|
17
|
+
max-width: 33em;
|
18
|
+
margin: 4em auto 0;
|
19
|
+
}
|
20
|
+
|
21
|
+
div.dialog > div {
|
22
|
+
border: 1px solid #CCC;
|
23
|
+
border-right-color: #999;
|
24
|
+
border-left-color: #999;
|
25
|
+
border-bottom-color: #BBB;
|
26
|
+
border-top: #B00100 solid 4px;
|
27
|
+
border-top-left-radius: 9px;
|
28
|
+
border-top-right-radius: 9px;
|
29
|
+
background-color: white;
|
30
|
+
padding: 7px 12% 0;
|
31
|
+
box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
|
32
|
+
}
|
33
|
+
|
34
|
+
h1 {
|
35
|
+
font-size: 100%;
|
36
|
+
color: #730E15;
|
37
|
+
line-height: 1.5em;
|
38
|
+
}
|
39
|
+
|
40
|
+
div.dialog > p {
|
41
|
+
margin: 0 0 1em;
|
42
|
+
padding: 1em;
|
43
|
+
background-color: #F7F7F7;
|
44
|
+
border: 1px solid #CCC;
|
45
|
+
border-right-color: #999;
|
46
|
+
border-left-color: #999;
|
47
|
+
border-bottom-color: #999;
|
48
|
+
border-bottom-left-radius: 4px;
|
49
|
+
border-bottom-right-radius: 4px;
|
50
|
+
border-top-color: #DADADA;
|
51
|
+
color: #666;
|
52
|
+
box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
|
53
|
+
}
|
54
|
+
</style>
|
55
|
+
</head>
|
56
|
+
|
57
|
+
<body>
|
58
|
+
<!-- This file lives in public/404.html -->
|
59
|
+
<div class="dialog">
|
60
|
+
<div>
|
61
|
+
<h1>The page you were looking for doesn't exist.</h1>
|
62
|
+
<p>You may have mistyped the address or the page may have moved.</p>
|
63
|
+
</div>
|
64
|
+
<p>If you are the application owner check the logs for more information.</p>
|
65
|
+
</div>
|
66
|
+
</body>
|
67
|
+
</html>
|
@@ -0,0 +1,67 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>The change you wanted was rejected (422)</title>
|
5
|
+
<meta name="viewport" content="width=device-width,initial-scale=1">
|
6
|
+
<style>
|
7
|
+
body {
|
8
|
+
background-color: #EFEFEF;
|
9
|
+
color: #2E2F30;
|
10
|
+
text-align: center;
|
11
|
+
font-family: arial, sans-serif;
|
12
|
+
margin: 0;
|
13
|
+
}
|
14
|
+
|
15
|
+
div.dialog {
|
16
|
+
width: 95%;
|
17
|
+
max-width: 33em;
|
18
|
+
margin: 4em auto 0;
|
19
|
+
}
|
20
|
+
|
21
|
+
div.dialog > div {
|
22
|
+
border: 1px solid #CCC;
|
23
|
+
border-right-color: #999;
|
24
|
+
border-left-color: #999;
|
25
|
+
border-bottom-color: #BBB;
|
26
|
+
border-top: #B00100 solid 4px;
|
27
|
+
border-top-left-radius: 9px;
|
28
|
+
border-top-right-radius: 9px;
|
29
|
+
background-color: white;
|
30
|
+
padding: 7px 12% 0;
|
31
|
+
box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
|
32
|
+
}
|
33
|
+
|
34
|
+
h1 {
|
35
|
+
font-size: 100%;
|
36
|
+
color: #730E15;
|
37
|
+
line-height: 1.5em;
|
38
|
+
}
|
39
|
+
|
40
|
+
div.dialog > p {
|
41
|
+
margin: 0 0 1em;
|
42
|
+
padding: 1em;
|
43
|
+
background-color: #F7F7F7;
|
44
|
+
border: 1px solid #CCC;
|
45
|
+
border-right-color: #999;
|
46
|
+
border-left-color: #999;
|
47
|
+
border-bottom-color: #999;
|
48
|
+
border-bottom-left-radius: 4px;
|
49
|
+
border-bottom-right-radius: 4px;
|
50
|
+
border-top-color: #DADADA;
|
51
|
+
color: #666;
|
52
|
+
box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
|
53
|
+
}
|
54
|
+
</style>
|
55
|
+
</head>
|
56
|
+
|
57
|
+
<body>
|
58
|
+
<!-- This file lives in public/422.html -->
|
59
|
+
<div class="dialog">
|
60
|
+
<div>
|
61
|
+
<h1>The change you wanted was rejected.</h1>
|
62
|
+
<p>Maybe you tried to change something you didn't have access to.</p>
|
63
|
+
</div>
|
64
|
+
<p>If you are the application owner check the logs for more information.</p>
|
65
|
+
</div>
|
66
|
+
</body>
|
67
|
+
</html>
|
@@ -0,0 +1,66 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>We're sorry, but something went wrong (500)</title>
|
5
|
+
<meta name="viewport" content="width=device-width,initial-scale=1">
|
6
|
+
<style>
|
7
|
+
body {
|
8
|
+
background-color: #EFEFEF;
|
9
|
+
color: #2E2F30;
|
10
|
+
text-align: center;
|
11
|
+
font-family: arial, sans-serif;
|
12
|
+
margin: 0;
|
13
|
+
}
|
14
|
+
|
15
|
+
div.dialog {
|
16
|
+
width: 95%;
|
17
|
+
max-width: 33em;
|
18
|
+
margin: 4em auto 0;
|
19
|
+
}
|
20
|
+
|
21
|
+
div.dialog > div {
|
22
|
+
border: 1px solid #CCC;
|
23
|
+
border-right-color: #999;
|
24
|
+
border-left-color: #999;
|
25
|
+
border-bottom-color: #BBB;
|
26
|
+
border-top: #B00100 solid 4px;
|
27
|
+
border-top-left-radius: 9px;
|
28
|
+
border-top-right-radius: 9px;
|
29
|
+
background-color: white;
|
30
|
+
padding: 7px 12% 0;
|
31
|
+
box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
|
32
|
+
}
|
33
|
+
|
34
|
+
h1 {
|
35
|
+
font-size: 100%;
|
36
|
+
color: #730E15;
|
37
|
+
line-height: 1.5em;
|
38
|
+
}
|
39
|
+
|
40
|
+
div.dialog > p {
|
41
|
+
margin: 0 0 1em;
|
42
|
+
padding: 1em;
|
43
|
+
background-color: #F7F7F7;
|
44
|
+
border: 1px solid #CCC;
|
45
|
+
border-right-color: #999;
|
46
|
+
border-left-color: #999;
|
47
|
+
border-bottom-color: #999;
|
48
|
+
border-bottom-left-radius: 4px;
|
49
|
+
border-bottom-right-radius: 4px;
|
50
|
+
border-top-color: #DADADA;
|
51
|
+
color: #666;
|
52
|
+
box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
|
53
|
+
}
|
54
|
+
</style>
|
55
|
+
</head>
|
56
|
+
|
57
|
+
<body>
|
58
|
+
<!-- This file lives in public/500.html -->
|
59
|
+
<div class="dialog">
|
60
|
+
<div>
|
61
|
+
<h1>We're sorry, but something went wrong.</h1>
|
62
|
+
</div>
|
63
|
+
<p>If you are the application owner check the logs for more information.</p>
|
64
|
+
</div>
|
65
|
+
</body>
|
66
|
+
</html>
|
File without changes
|
@@ -0,0 +1,57 @@
|
|
1
|
+
# This file is copied to spec/ when you run 'rails generate rspec:install'
|
2
|
+
ENV['RAILS_ENV'] ||= 'test'
|
3
|
+
require File.expand_path('../../config/environment', __FILE__)
|
4
|
+
# Prevent database truncation if the environment is production
|
5
|
+
abort("The Rails environment is running in production mode!") if Rails.env.production?
|
6
|
+
require 'spec_helper'
|
7
|
+
require 'rspec/rails'
|
8
|
+
# Add additional requires below this line. Rails is not loaded until this point!
|
9
|
+
|
10
|
+
# Requires supporting ruby files with custom matchers and macros, etc, in
|
11
|
+
# spec/support/ and its subdirectories. Files matching `spec/**/*_spec.rb` are
|
12
|
+
# run as spec files by default. This means that files in spec/support that end
|
13
|
+
# in _spec.rb will both be required and run as specs, causing the specs to be
|
14
|
+
# run twice. It is recommended that you do not name files matching this glob to
|
15
|
+
# end with _spec.rb. You can configure this pattern with the --pattern
|
16
|
+
# option on the command line or in ~/.rspec, .rspec or `.rspec-local`.
|
17
|
+
#
|
18
|
+
# The following line is provided for convenience purposes. It has the downside
|
19
|
+
# of increasing the boot-up time by auto-requiring all files in the support
|
20
|
+
# directory. Alternatively, in the individual `*_spec.rb` files, manually
|
21
|
+
# require only the support files necessary.
|
22
|
+
#
|
23
|
+
# Dir[Rails.root.join('spec/support/**/*.rb')].each { |f| require f }
|
24
|
+
|
25
|
+
# Checks for pending migration and applies them before tests are run.
|
26
|
+
# If you are not using ActiveRecord, you can remove this line.
|
27
|
+
ActiveRecord::Migration.maintain_test_schema!
|
28
|
+
|
29
|
+
RSpec.configure do |config|
|
30
|
+
# Remove this line if you're not using ActiveRecord or ActiveRecord fixtures
|
31
|
+
config.fixture_path = "#{::Rails.root}/spec/fixtures"
|
32
|
+
|
33
|
+
# If you're not using ActiveRecord, or you'd prefer not to run each of your
|
34
|
+
# examples within a transaction, remove the following line or assign false
|
35
|
+
# instead of true.
|
36
|
+
config.use_transactional_fixtures = true
|
37
|
+
|
38
|
+
# RSpec Rails can automatically mix in different behaviours to your tests
|
39
|
+
# based on their file location, for example enabling you to call `get` and
|
40
|
+
# `post` in specs under `spec/controllers`.
|
41
|
+
#
|
42
|
+
# You can disable this behaviour by removing the line below, and instead
|
43
|
+
# explicitly tag your specs with their type, e.g.:
|
44
|
+
#
|
45
|
+
# RSpec.describe UsersController, :type => :controller do
|
46
|
+
# # ...
|
47
|
+
# end
|
48
|
+
#
|
49
|
+
# The different available types are documented in the features, such as in
|
50
|
+
# https://relishapp.com/rspec/rspec-rails/docs
|
51
|
+
config.infer_spec_type_from_file_location!
|
52
|
+
|
53
|
+
# Filter lines from Rails gems in backtraces.
|
54
|
+
config.filter_rails_from_backtrace!
|
55
|
+
# arbitrary gems may also be filtered via:
|
56
|
+
# config.filter_gems_from_backtrace("gem name")
|
57
|
+
end
|
@@ -0,0 +1,99 @@
|
|
1
|
+
# This file was generated by the `rails generate rspec:install` command. Conventionally, all
|
2
|
+
# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
|
3
|
+
# The generated `.rspec` file contains `--require spec_helper` which will cause
|
4
|
+
# this file to always be loaded, without a need to explicitly require it in any
|
5
|
+
# files.
|
6
|
+
#
|
7
|
+
# Given that it is always loaded, you are encouraged to keep this file as
|
8
|
+
# light-weight as possible. Requiring heavyweight dependencies from this file
|
9
|
+
# will add to the boot time of your test suite on EVERY test run, even for an
|
10
|
+
# individual file that may not need all of that loaded. Instead, consider making
|
11
|
+
# a separate helper file that requires the additional dependencies and performs
|
12
|
+
# the additional setup, and require it from the spec files that actually need
|
13
|
+
# it.
|
14
|
+
#
|
15
|
+
# The `.rspec` file also contains a few flags that are not defaults but that
|
16
|
+
# users commonly want.
|
17
|
+
#
|
18
|
+
# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
|
19
|
+
RSpec.configure do |config|
|
20
|
+
# rspec-expectations config goes here. You can use an alternate
|
21
|
+
# assertion/expectation library such as wrong or the stdlib/minitest
|
22
|
+
# assertions if you prefer.
|
23
|
+
config.expect_with :rspec do |expectations|
|
24
|
+
# This option will default to `true` in RSpec 4. It makes the `description`
|
25
|
+
# and `failure_message` of custom matchers include text for helper methods
|
26
|
+
# defined using `chain`, e.g.:
|
27
|
+
# be_bigger_than(2).and_smaller_than(4).description
|
28
|
+
# # => "be bigger than 2 and smaller than 4"
|
29
|
+
# ...rather than:
|
30
|
+
# # => "be bigger than 2"
|
31
|
+
expectations.include_chain_clauses_in_custom_matcher_descriptions = true
|
32
|
+
end
|
33
|
+
|
34
|
+
# rspec-mocks config goes here. You can use an alternate test double
|
35
|
+
# library (such as bogus or mocha) by changing the `mock_with` option here.
|
36
|
+
config.mock_with :rspec do |mocks|
|
37
|
+
# Prevents you from mocking or stubbing a method that does not exist on
|
38
|
+
# a real object. This is generally recommended, and will default to
|
39
|
+
# `true` in RSpec 4.
|
40
|
+
mocks.verify_partial_doubles = true
|
41
|
+
end
|
42
|
+
|
43
|
+
# This option will default to `:apply_to_host_groups` in RSpec 4 (and will
|
44
|
+
# have no way to turn it off -- the option exists only for backwards
|
45
|
+
# compatibility in RSpec 3). It causes shared context metadata to be
|
46
|
+
# inherited by the metadata hash of host groups and examples, rather than
|
47
|
+
# triggering implicit auto-inclusion in groups with matching metadata.
|
48
|
+
config.shared_context_metadata_behavior = :apply_to_host_groups
|
49
|
+
|
50
|
+
# The settings below are suggested to provide a good initial experience
|
51
|
+
# with RSpec, but feel free to customize to your heart's content.
|
52
|
+
=begin
|
53
|
+
# This allows you to limit a spec run to individual examples or groups
|
54
|
+
# you care about by tagging them with `:focus` metadata. When nothing
|
55
|
+
# is tagged with `:focus`, all examples get run. RSpec also provides
|
56
|
+
# aliases for `it`, `describe`, and `context` that include `:focus`
|
57
|
+
# metadata: `fit`, `fdescribe` and `fcontext`, respectively.
|
58
|
+
config.filter_run_when_matching :focus
|
59
|
+
|
60
|
+
# Allows RSpec to persist some state between runs in order to support
|
61
|
+
# the `--only-failures` and `--next-failure` CLI options. We recommend
|
62
|
+
# you configure your source control system to ignore this file.
|
63
|
+
config.example_status_persistence_file_path = "spec/examples.txt"
|
64
|
+
|
65
|
+
# Limits the available syntax to the non-monkey patched syntax that is
|
66
|
+
# recommended. For more details, see:
|
67
|
+
# - http://rspec.info/blog/2012/06/rspecs-new-expectation-syntax/
|
68
|
+
# - http://www.teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/
|
69
|
+
# - http://rspec.info/blog/2014/05/notable-changes-in-rspec-3/#zero-monkey-patching-mode
|
70
|
+
config.disable_monkey_patching!
|
71
|
+
|
72
|
+
# Many RSpec users commonly either run the entire suite or an individual
|
73
|
+
# file, and it's useful to allow more verbose output when running an
|
74
|
+
# individual spec file.
|
75
|
+
if config.files_to_run.one?
|
76
|
+
# Use the documentation formatter for detailed output,
|
77
|
+
# unless a formatter has already been configured
|
78
|
+
# (e.g. via a command-line flag).
|
79
|
+
config.default_formatter = 'doc'
|
80
|
+
end
|
81
|
+
|
82
|
+
# Print the 10 slowest examples and example groups at the
|
83
|
+
# end of the spec run, to help surface which specs are running
|
84
|
+
# particularly slow.
|
85
|
+
config.profile_examples = 10
|
86
|
+
|
87
|
+
# Run specs in random order to surface order dependencies. If you find an
|
88
|
+
# order dependency and want to debug it, you can fix the order by providing
|
89
|
+
# the seed, which is printed after each run.
|
90
|
+
# --seed 1234
|
91
|
+
config.order = :random
|
92
|
+
|
93
|
+
# Seed global randomization in this process using the `--seed` CLI option.
|
94
|
+
# Setting this allows you to use `--seed` to deterministically reproduce
|
95
|
+
# test failures related to randomization by passing the same `--seed` value
|
96
|
+
# as the one that triggered the failure.
|
97
|
+
Kernel.srand config.seed
|
98
|
+
=end
|
99
|
+
end
|
File without changes
|
File without changes
|
@@ -0,0 +1,8 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<Settings><!--This file was automatically generated by Ruby plugin.
|
3
|
+
You are allowed to:
|
4
|
+
1. Reorder generators
|
5
|
+
2. Remove generators
|
6
|
+
3. Add installed generators
|
7
|
+
To add new installed generators automatically delete this file and reload the project.
|
8
|
+
--><GeneratorsGroup><Generator name="assets" /><Generator name="channel" /><Generator name="coffee:assets" /><Generator name="controller" /><Generator name="generator" /><Generator name="helper" /><Generator name="integration_test" /><Generator name="jbuilder" /><Generator name="job" /><Generator name="js:assets" /><Generator name="mailer" /><Generator name="migration" /><Generator name="model" /><Generator name="resource" /><Generator name="scaffold" /><Generator name="scaffold_controller" /><Generator name="task" /><Generator name="test_unit:generator" /><Generator name="test_unit:plugin" /></GeneratorsGroup></Settings>
|
@@ -0,0 +1,48 @@
|
|
1
|
+
|
2
|
+
# Created by https://www.gitignore.io/api/rails
|
3
|
+
|
4
|
+
### Rails ###
|
5
|
+
*.rbc
|
6
|
+
capybara-*.html
|
7
|
+
.rspec
|
8
|
+
/log
|
9
|
+
/tmp
|
10
|
+
/db/*.sqlite3
|
11
|
+
/db/*.sqlite3-journal
|
12
|
+
/public/system
|
13
|
+
/coverage/
|
14
|
+
/spec/tmp
|
15
|
+
**.orig
|
16
|
+
rerun.txt
|
17
|
+
pickle-email-*.html
|
18
|
+
|
19
|
+
# TODO Comment out this rule if you are OK with secrets being uploaded to the repo
|
20
|
+
config/initializers/secret_token.rb
|
21
|
+
|
22
|
+
# Only include if you have production secrets in this file, which is no longer a Rails default
|
23
|
+
# config/secrets.yml
|
24
|
+
|
25
|
+
# dotenv
|
26
|
+
# TODO Comment out this rule if environment variables can be committed
|
27
|
+
.env
|
28
|
+
|
29
|
+
## Environment normalization:
|
30
|
+
/.bundle
|
31
|
+
/vendor/bundle
|
32
|
+
|
33
|
+
# these should all be checked in to normalize the environment:
|
34
|
+
# Gemfile.lock, .ruby-version, .ruby-gemset
|
35
|
+
|
36
|
+
# unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
|
37
|
+
.rvmrc
|
38
|
+
|
39
|
+
# if using bower-rails ignore default bower_components path bower.json files
|
40
|
+
/vendor/assets/bower_components
|
41
|
+
*.bowerrc
|
42
|
+
bower.json
|
43
|
+
|
44
|
+
# Ignore pow environment settings
|
45
|
+
.powenv
|
46
|
+
|
47
|
+
# Ignore Byebug command history file.
|
48
|
+
.byebug_history
|
@@ -0,0 +1,7 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<Settings><!--This file was automatically generated by Ruby plugin.
|
3
|
+
You are allowed to:
|
4
|
+
1. Remove rake task
|
5
|
+
2. Add existing rake tasks
|
6
|
+
To add existing rake tasks automatically delete this file and reload the project.
|
7
|
+
--><RakeGroup description="" fullCmd="" taksId="rake" /></Settings>
|
@@ -0,0 +1,54 @@
|
|
1
|
+
source 'https://rubygems.org'
|
2
|
+
|
3
|
+
# Install developed gem
|
4
|
+
gem 'rack-action_logger', path: '../..'
|
5
|
+
|
6
|
+
gem 'fluent-logger'
|
7
|
+
|
8
|
+
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
|
9
|
+
gem 'rails', '~> 5.0.0', '>= 5.0.0.1'
|
10
|
+
# Use sqlite3 as the database for Active Record
|
11
|
+
gem 'sqlite3'
|
12
|
+
# Use Puma as the app server
|
13
|
+
gem 'puma', '~> 3.0'
|
14
|
+
# Use SCSS for stylesheets
|
15
|
+
gem 'sass-rails', '~> 5.0'
|
16
|
+
# Use Uglifier as compressor for JavaScript assets
|
17
|
+
gem 'uglifier', '>= 1.3.0'
|
18
|
+
# Use CoffeeScript for .coffee assets and views
|
19
|
+
gem 'coffee-rails', '~> 4.2'
|
20
|
+
# See https://github.com/rails/execjs#readme for more supported runtimes
|
21
|
+
# gem 'therubyracer', platforms: :ruby
|
22
|
+
|
23
|
+
# Use jquery as the JavaScript library
|
24
|
+
gem 'jquery-rails'
|
25
|
+
# Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks
|
26
|
+
gem 'turbolinks', '~> 5'
|
27
|
+
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
|
28
|
+
gem 'jbuilder', '~> 2.5'
|
29
|
+
# Use Redis adapter to run Action Cable in production
|
30
|
+
# gem 'redis', '~> 3.0'
|
31
|
+
# Use ActiveModel has_secure_password
|
32
|
+
# gem 'bcrypt', '~> 3.1.7'
|
33
|
+
|
34
|
+
# Use Capistrano for deployment
|
35
|
+
# gem 'capistrano-rails', group: :development
|
36
|
+
|
37
|
+
group :development, :test do
|
38
|
+
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
|
39
|
+
gem 'byebug', platform: :mri
|
40
|
+
|
41
|
+
gem 'rspec-rails'
|
42
|
+
end
|
43
|
+
|
44
|
+
group :development do
|
45
|
+
# Access an IRB console on exception pages or by using <%= console %> anywhere in the code.
|
46
|
+
gem 'web-console'
|
47
|
+
gem 'listen', '~> 3.0.5'
|
48
|
+
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
|
49
|
+
gem 'spring'
|
50
|
+
gem 'spring-watcher-listen', '~> 2.0.0'
|
51
|
+
end
|
52
|
+
|
53
|
+
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
|
54
|
+
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
|