rack-action_logger 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +39 -4
- data/lib/rack/action_logger/emit_adapter.rb +12 -0
- data/lib/rack/action_logger/version.rb +1 -1
- data/lib/rack/action_logger.rb +0 -2
- data/rack-action_logger.gemspec +1 -1
- metadata +2 -145
- 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 +0 -8
- data/example/rails4/.gitignore +0 -48
- data/example/rails4/.rakeTasks +0 -7
- data/example/rails4/Gemfile +0 -53
- data/example/rails4/Gemfile.lock +0 -192
- data/example/rails4/README.rdoc +0 -28
- data/example/rails4/Rakefile +0 -6
- data/example/rails4/app/assets/images/.keep +0 -0
- data/example/rails4/app/assets/javascripts/application.js +0 -16
- data/example/rails4/app/assets/javascripts/hello.coffee +0 -3
- data/example/rails4/app/assets/stylesheets/application.css +0 -15
- data/example/rails4/app/assets/stylesheets/hello.scss +0 -3
- data/example/rails4/app/controllers/application_controller.rb +0 -7
- data/example/rails4/app/controllers/concerns/.keep +0 -0
- data/example/rails4/app/controllers/hello_controller.rb +0 -6
- data/example/rails4/app/helpers/application_helper.rb +0 -2
- data/example/rails4/app/helpers/hello_helper.rb +0 -2
- 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 +0 -2
- data/example/rails4/app/views/layouts/application.html.erb +0 -14
- data/example/rails4/bin/bundle +0 -3
- data/example/rails4/bin/rails +0 -4
- data/example/rails4/bin/rake +0 -4
- data/example/rails4/bin/rspec +0 -17
- data/example/rails4/bin/setup +0 -29
- data/example/rails4/config/application.rb +0 -37
- data/example/rails4/config/boot.rb +0 -3
- data/example/rails4/config/database.yml +0 -25
- data/example/rails4/config/environment.rb +0 -5
- data/example/rails4/config/environments/development.rb +0 -41
- data/example/rails4/config/environments/production.rb +0 -79
- data/example/rails4/config/environments/test.rb +0 -42
- data/example/rails4/config/initializers/assets.rb +0 -11
- data/example/rails4/config/initializers/backtrace_silencers.rb +0 -7
- data/example/rails4/config/initializers/cookies_serializer.rb +0 -3
- data/example/rails4/config/initializers/filter_parameter_logging.rb +0 -4
- data/example/rails4/config/initializers/fluent_logger.rb +0 -1
- data/example/rails4/config/initializers/inflections.rb +0 -16
- data/example/rails4/config/initializers/mime_types.rb +0 -4
- data/example/rails4/config/initializers/rack-action_logger.rb +0 -6
- data/example/rails4/config/initializers/session_store.rb +0 -3
- data/example/rails4/config/initializers/wrap_parameters.rb +0 -14
- data/example/rails4/config/locales/en.yml +0 -23
- data/example/rails4/config/routes.rb +0 -3
- data/example/rails4/config/secrets.yml +0 -22
- data/example/rails4/config.ru +0 -4
- data/example/rails4/db/schema.rb +0 -16
- data/example/rails4/db/seeds.rb +0 -7
- data/example/rails4/lib/assets/.keep +0 -0
- data/example/rails4/lib/tasks/.keep +0 -0
- data/example/rails4/public/404.html +0 -67
- data/example/rails4/public/422.html +0 -67
- data/example/rails4/public/500.html +0 -66
- data/example/rails4/public/favicon.ico +0 -0
- data/example/rails4/public/robots.txt +0 -5
- data/example/rails4/spec/controllers/hello_controller_spec.rb +0 -10
- data/example/rails4/spec/rails_helper.rb +0 -57
- data/example/rails4/spec/spec_helper.rb +0 -99
- data/example/rails4/vendor/assets/javascripts/.keep +0 -0
- data/example/rails4/vendor/assets/stylesheets/.keep +0 -0
- data/example/rails5/.generators +0 -8
- data/example/rails5/.gitignore +0 -48
- data/example/rails5/.rakeTasks +0 -7
- data/example/rails5/Gemfile +0 -54
- data/example/rails5/Gemfile.lock +0 -205
- data/example/rails5/README.md +0 -24
- data/example/rails5/Rakefile +0 -6
- data/example/rails5/app/assets/config/manifest.js +0 -3
- data/example/rails5/app/assets/images/.keep +0 -0
- data/example/rails5/app/assets/javascripts/application.js +0 -16
- data/example/rails5/app/assets/javascripts/cable.js +0 -13
- data/example/rails5/app/assets/javascripts/channels/.keep +0 -0
- data/example/rails5/app/assets/javascripts/hello.coffee +0 -3
- data/example/rails5/app/assets/stylesheets/application.css +0 -15
- data/example/rails5/app/assets/stylesheets/hello.scss +0 -3
- data/example/rails5/app/channels/application_cable/channel.rb +0 -4
- data/example/rails5/app/channels/application_cable/connection.rb +0 -4
- data/example/rails5/app/controllers/application_controller.rb +0 -5
- data/example/rails5/app/controllers/concerns/.keep +0 -0
- data/example/rails5/app/controllers/hello_controller.rb +0 -6
- data/example/rails5/app/helpers/application_helper.rb +0 -2
- data/example/rails5/app/helpers/hello_helper.rb +0 -2
- data/example/rails5/app/jobs/application_job.rb +0 -2
- data/example/rails5/app/mailers/application_mailer.rb +0 -4
- data/example/rails5/app/models/application_record.rb +0 -3
- data/example/rails5/app/models/concerns/.keep +0 -0
- data/example/rails5/app/views/hello/index.html.erb +0 -2
- data/example/rails5/app/views/layouts/application.html.erb +0 -14
- data/example/rails5/app/views/layouts/mailer.html.erb +0 -13
- data/example/rails5/app/views/layouts/mailer.text.erb +0 -1
- data/example/rails5/bin/bundle +0 -3
- data/example/rails5/bin/rails +0 -4
- data/example/rails5/bin/rake +0 -17
- data/example/rails5/bin/rspec +0 -17
- data/example/rails5/bin/setup +0 -34
- data/example/rails5/bin/update +0 -29
- data/example/rails5/config/application.rb +0 -13
- data/example/rails5/config/boot.rb +0 -3
- data/example/rails5/config/cable.yml +0 -9
- data/example/rails5/config/database.yml +0 -25
- data/example/rails5/config/environment.rb +0 -5
- data/example/rails5/config/environments/development.rb +0 -54
- data/example/rails5/config/environments/production.rb +0 -86
- data/example/rails5/config/environments/test.rb +0 -42
- data/example/rails5/config/initializers/application_controller_renderer.rb +0 -6
- data/example/rails5/config/initializers/assets.rb +0 -11
- data/example/rails5/config/initializers/backtrace_silencers.rb +0 -7
- data/example/rails5/config/initializers/cookies_serializer.rb +0 -5
- data/example/rails5/config/initializers/filter_parameter_logging.rb +0 -4
- data/example/rails5/config/initializers/fluent_logger.rb +0 -1
- data/example/rails5/config/initializers/inflections.rb +0 -16
- data/example/rails5/config/initializers/mime_types.rb +0 -4
- data/example/rails5/config/initializers/new_framework_defaults.rb +0 -24
- data/example/rails5/config/initializers/rack-action_logger.rb +0 -6
- data/example/rails5/config/initializers/session_store.rb +0 -3
- data/example/rails5/config/initializers/wrap_parameters.rb +0 -14
- data/example/rails5/config/locales/en.yml +0 -23
- data/example/rails5/config/puma.rb +0 -47
- data/example/rails5/config/routes.rb +0 -3
- data/example/rails5/config/secrets.yml +0 -22
- data/example/rails5/config/spring.rb +0 -6
- data/example/rails5/config.ru +0 -5
- data/example/rails5/db/schema.rb +0 -15
- data/example/rails5/db/seeds.rb +0 -7
- data/example/rails5/lib/assets/.keep +0 -0
- data/example/rails5/lib/tasks/.keep +0 -0
- data/example/rails5/public/404.html +0 -67
- data/example/rails5/public/422.html +0 -67
- data/example/rails5/public/500.html +0 -66
- 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 +0 -5
- data/example/rails5/spec/controllers/hello_controller_spec.rb +0 -10
- data/example/rails5/spec/rails_helper.rb +0 -57
- data/example/rails5/spec/spec_helper.rb +0 -99
- data/example/rails5/vendor/assets/javascripts/.keep +0 -0
- data/example/rails5/vendor/assets/stylesheets/.keep +0 -0
@@ -1,23 +0,0 @@
|
|
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"
|
@@ -1,47 +0,0 @@
|
|
1
|
-
# Puma can serve each request in a thread from an internal thread pool.
|
2
|
-
# The `threads` method setting takes two numbers a minimum and maximum.
|
3
|
-
# Any libraries that use thread pools should be configured to match
|
4
|
-
# the maximum value specified for Puma. Default is set to 5 threads for minimum
|
5
|
-
# and maximum, this matches the default thread size of Active Record.
|
6
|
-
#
|
7
|
-
threads_count = ENV.fetch("RAILS_MAX_THREADS") { 5 }.to_i
|
8
|
-
threads threads_count, threads_count
|
9
|
-
|
10
|
-
# Specifies the `port` that Puma will listen on to receive requests, default is 3000.
|
11
|
-
#
|
12
|
-
port ENV.fetch("PORT") { 3000 }
|
13
|
-
|
14
|
-
# Specifies the `environment` that Puma will run in.
|
15
|
-
#
|
16
|
-
environment ENV.fetch("RAILS_ENV") { "development" }
|
17
|
-
|
18
|
-
# Specifies the number of `workers` to boot in clustered mode.
|
19
|
-
# Workers are forked webserver processes. If using threads and workers together
|
20
|
-
# the concurrency of the application would be max `threads` * `workers`.
|
21
|
-
# Workers do not work on JRuby or Windows (both of which do not support
|
22
|
-
# processes).
|
23
|
-
#
|
24
|
-
# workers ENV.fetch("WEB_CONCURRENCY") { 2 }
|
25
|
-
|
26
|
-
# Use the `preload_app!` method when specifying a `workers` number.
|
27
|
-
# This directive tells Puma to first boot the application and load code
|
28
|
-
# before forking the application. This takes advantage of Copy On Write
|
29
|
-
# process behavior so workers use less memory. If you use this option
|
30
|
-
# you need to make sure to reconnect any threads in the `on_worker_boot`
|
31
|
-
# block.
|
32
|
-
#
|
33
|
-
# preload_app!
|
34
|
-
|
35
|
-
# The code in the `on_worker_boot` will be called if you are using
|
36
|
-
# clustered mode by specifying a number of `workers`. After each worker
|
37
|
-
# process is booted this block will be run, if you are using `preload_app!`
|
38
|
-
# option you will want to use this block to reconnect to any threads
|
39
|
-
# or connections that may have been created at application boot, Ruby
|
40
|
-
# cannot share connections between processes.
|
41
|
-
#
|
42
|
-
# on_worker_boot do
|
43
|
-
# ActiveRecord::Base.establish_connection if defined?(ActiveRecord)
|
44
|
-
# end
|
45
|
-
|
46
|
-
# Allow puma to be restarted by `rails restart` command.
|
47
|
-
plugin :tmp_restart
|
@@ -1,22 +0,0 @@
|
|
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 `rails 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: acdae7cecc44715a50ad07d3b639e68a23d10864bfdd5b91b20dade7ef14d3bedecf87fa33f0bf8e650f7f6c7c85a8328c419e33504d507fac4728e3ce96b800
|
15
|
-
|
16
|
-
test:
|
17
|
-
secret_key_base: 8762de063618668bbf695c8fee7a9d0ea61b20ce3f03ad620e083767f0d872e4271e74aaa108e8e737c96dd9d4604a22b7b15a519834b93b91da391cc080c701
|
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"] %>
|
data/example/rails5/config.ru
DELETED
data/example/rails5/db/schema.rb
DELETED
@@ -1,15 +0,0 @@
|
|
1
|
-
# This file is auto-generated from the current state of the database. Instead
|
2
|
-
# of editing this file, please use the migrations feature of Active Record to
|
3
|
-
# incrementally modify your database, and then regenerate this schema definition.
|
4
|
-
#
|
5
|
-
# Note that this schema.rb definition is the authoritative source for your
|
6
|
-
# database schema. If you need to create the application database on another
|
7
|
-
# system, you should be using db:schema:load, not running all the migrations
|
8
|
-
# from scratch. The latter is a flawed and unsustainable approach (the more migrations
|
9
|
-
# you'll amass, the slower it'll run and the greater likelihood for issues).
|
10
|
-
#
|
11
|
-
# It's strongly recommended that you check this file into your version control system.
|
12
|
-
|
13
|
-
ActiveRecord::Schema.define(version: 0) do
|
14
|
-
|
15
|
-
end
|
data/example/rails5/db/seeds.rb
DELETED
@@ -1,7 +0,0 @@
|
|
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 rails db:seed command (or created alongside the database with db:setup).
|
3
|
-
#
|
4
|
-
# Examples:
|
5
|
-
#
|
6
|
-
# movies = Movie.create([{ name: 'Star Wars' }, { name: 'Lord of the Rings' }])
|
7
|
-
# Character.create(name: 'Luke', movie: movies.first)
|
File without changes
|
File without changes
|
@@ -1,67 +0,0 @@
|
|
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>
|
@@ -1,67 +0,0 @@
|
|
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>
|
@@ -1,66 +0,0 @@
|
|
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
|
File without changes
|
File without changes
|
@@ -1,57 +0,0 @@
|
|
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
|
@@ -1,99 +0,0 @@
|
|
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
|