buoys 2.0.1 → 2.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Rakefile +2 -0
- data/lib/buoys/buoy.rb +2 -2
- data/lib/buoys/version.rb +1 -1
- data/test/buoys_buoy_test.rb +12 -0
- data/test/dummy/Rakefile +1 -1
- data/test/dummy/app/assets/config/manifest.js +3 -1
- data/test/dummy/app/assets/javascripts/application.js +3 -1
- data/test/dummy/app/assets/javascripts/cable.js +13 -0
- data/test/dummy/app/assets/stylesheets/application.css +3 -3
- data/test/dummy/app/channels/application_cable/channel.rb +4 -0
- data/test/dummy/app/channels/application_cable/connection.rb +4 -0
- data/test/dummy/app/controllers/application_controller.rb +0 -5
- data/test/dummy/app/helpers/application_helper.rb +0 -2
- data/test/dummy/app/jobs/application_job.rb +2 -0
- data/test/dummy/app/mailers/application_mailer.rb +4 -0
- data/test/dummy/app/models/application_record.rb +3 -0
- data/test/dummy/app/models/item.rb +1 -1
- data/test/dummy/app/models/user.rb +1 -1
- data/test/dummy/app/views/layouts/application.html.erb +10 -9
- data/test/dummy/app/views/layouts/mailer.html.erb +13 -0
- data/test/dummy/app/views/layouts/mailer.text.erb +1 -0
- data/test/dummy/bin/bundle +1 -1
- data/test/dummy/bin/rails +1 -1
- data/test/dummy/bin/setup +20 -13
- data/test/dummy/bin/update +31 -0
- data/test/dummy/bin/yarn +11 -0
- data/test/dummy/config/application.rb +9 -21
- data/test/dummy/config/boot.rb +2 -4
- data/test/dummy/config/cable.yml +10 -0
- data/test/dummy/config/database.yml +1 -1
- data/test/dummy/config/environment.rb +1 -3
- data/test/dummy/config/environments/development.rb +31 -13
- data/test/dummy/config/environments/production.rb +31 -18
- data/test/dummy/config/environments/test.rb +10 -13
- data/test/dummy/config/initializers/application_controller_renderer.rb +8 -0
- data/test/dummy/config/initializers/assets.rb +6 -5
- data/test/dummy/config/initializers/backtrace_silencers.rb +0 -2
- data/test/dummy/config/initializers/content_security_policy.rb +25 -0
- data/test/dummy/config/initializers/cookies_serializer.rb +2 -2
- data/test/dummy/config/initializers/filter_parameter_logging.rb +0 -2
- data/test/dummy/config/initializers/inflections.rb +0 -2
- data/test/dummy/config/initializers/mime_types.rb +0 -2
- data/test/dummy/config/initializers/wrap_parameters.rb +2 -4
- data/test/dummy/config/locales/en.yml +10 -0
- data/test/dummy/config/puma.rb +37 -0
- data/test/dummy/config/routes.rb +2 -2
- data/test/dummy/config/spring.rb +6 -0
- data/test/dummy/config/storage.yml +34 -0
- data/test/dummy/config.ru +2 -1
- data/test/dummy/db/development.sqlite3 +0 -0
- data/test/dummy/db/test.sqlite3 +0 -0
- data/test/dummy/log/development.log +105 -0
- data/test/dummy/log/test.log +396 -267
- data/test/dummy/package.json +5 -0
- data/test/dummy/public/404.html +6 -6
- data/test/dummy/public/422.html +6 -6
- data/test/dummy/public/500.html +6 -6
- data/test/dummy/public/apple-touch-icon-precomposed.png +0 -0
- data/test/dummy/public/apple-touch-icon.png +0 -0
- data/test/dummy/tmp/development_secret.txt +1 -0
- data/test/test_helper.rb +4 -5
- metadata +88 -49
- data/test/dummy/README.rdoc +0 -28
- data/test/dummy/config/initializers/session_store.rb +0 -5
- data/test/dummy/config/secrets.yml +0 -22
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9e9c604499d92dd5cc1a735a47f15c4a25d96db6486c8d2528b4df5fc372da9c
|
4
|
+
data.tar.gz: 9f5920b1f5cbc085364d1c6baf23ad21f2467ec2ec3958f4a7d2f7a5b41db861
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4849d2279a185fc9a34c0326e21469ffad41a01195d287c2371023bdfc1a5d9c4f4a568e4ee2651d8490d445da380d48cc23fcb1153fdc828d39a09111ff8257
|
7
|
+
data.tar.gz: c6871638d0efadbb643cf81bf99e61ef7860aaf400b60a3ff29360f0b533c330c8c5b213dbf897b7e8221bbfabd9f0721e6e8cc319a11541bd591614d15f5f9e
|
data/Rakefile
CHANGED
data/lib/buoys/buoy.rb
CHANGED
@@ -40,8 +40,8 @@ module Buoys
|
|
40
40
|
end
|
41
41
|
alias parent pre_buoy
|
42
42
|
|
43
|
-
def method_missing(method, *args, &block)
|
44
|
-
context.send(method, *args, &block)
|
43
|
+
def method_missing(method, *args, **kwargs, &block)
|
44
|
+
context.send(method, *args, **kwargs, &block)
|
45
45
|
end
|
46
46
|
end
|
47
47
|
end
|
data/lib/buoys/version.rb
CHANGED
data/test/buoys_buoy_test.rb
CHANGED
@@ -33,4 +33,16 @@ class BuoysBuoyTest < ActiveSupport::TestCase
|
|
33
33
|
assert_equal links[0].text, 'Account'
|
34
34
|
assert_equal links[0].url, 'http://example.com/account'
|
35
35
|
end
|
36
|
+
|
37
|
+
test 'delegate unknown methods to view context' do
|
38
|
+
def @view_context.hello(arg, kwarg:, &block)
|
39
|
+
[arg, kwarg, block]
|
40
|
+
end
|
41
|
+
|
42
|
+
arg, kwarg, block = Buoys::Buoy.new(@view_context, :account).hello('hello', kwarg: ',') { 'world' }
|
43
|
+
|
44
|
+
assert_equal arg, 'hello'
|
45
|
+
assert_equal kwarg, ','
|
46
|
+
assert_equal block.call, 'world'
|
47
|
+
end
|
36
48
|
end
|
data/test/dummy/Rakefile
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# Add your own tasks in files placed in lib/tasks ending in .rake,
|
2
2
|
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
|
3
3
|
|
4
|
-
|
4
|
+
require_relative 'config/application'
|
5
5
|
|
6
6
|
Rails.application.load_tasks
|
@@ -5,9 +5,11 @@
|
|
5
5
|
// or any plugin's vendor/assets/javascripts directory can be referenced here using a relative path.
|
6
6
|
//
|
7
7
|
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
|
8
|
-
// compiled file.
|
8
|
+
// compiled file. JavaScript code in this file should be added after the last require_* statement.
|
9
9
|
//
|
10
10
|
// Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details
|
11
11
|
// about supported directives.
|
12
12
|
//
|
13
|
+
//= require rails-ujs
|
14
|
+
//= require activestorage
|
13
15
|
//= require_tree .
|
@@ -0,0 +1,13 @@
|
|
1
|
+
// Action Cable provides the framework to deal with WebSockets in Rails.
|
2
|
+
// You can generate new channels where WebSocket features live using the `rails generate channel` command.
|
3
|
+
//
|
4
|
+
//= require action_cable
|
5
|
+
//= require_self
|
6
|
+
//= require_tree ./channels
|
7
|
+
|
8
|
+
(function() {
|
9
|
+
this.App || (this.App = {});
|
10
|
+
|
11
|
+
App.cable = ActionCable.createConsumer();
|
12
|
+
|
13
|
+
}).call(this);
|
@@ -6,9 +6,9 @@
|
|
6
6
|
* or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path.
|
7
7
|
*
|
8
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
|
10
|
-
*
|
11
|
-
* file per style scope.
|
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
12
|
*
|
13
13
|
*= require_tree .
|
14
14
|
*= require_self
|
@@ -1,14 +1,15 @@
|
|
1
1
|
<!DOCTYPE html>
|
2
2
|
<html>
|
3
|
-
<head>
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
<%= csrf_meta_tags %>
|
8
|
-
</head>
|
9
|
-
<body>
|
3
|
+
<head>
|
4
|
+
<title>Dummy</title>
|
5
|
+
<%= csrf_meta_tags %>
|
6
|
+
<%= csp_meta_tag %>
|
10
7
|
|
11
|
-
<%=
|
8
|
+
<%= stylesheet_link_tag 'application', media: 'all' %>
|
9
|
+
<%= javascript_include_tag 'application' %>
|
10
|
+
</head>
|
12
11
|
|
13
|
-
|
12
|
+
<body>
|
13
|
+
<%= yield %>
|
14
|
+
</body>
|
14
15
|
</html>
|
@@ -0,0 +1 @@
|
|
1
|
+
<%= yield %>
|
data/test/dummy/bin/bundle
CHANGED
data/test/dummy/bin/rails
CHANGED
data/test/dummy/bin/setup
CHANGED
@@ -1,29 +1,36 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
-
require '
|
2
|
+
require 'fileutils'
|
3
|
+
include FileUtils
|
3
4
|
|
4
5
|
# path to your application root.
|
5
|
-
APP_ROOT =
|
6
|
+
APP_ROOT = File.expand_path('..', __dir__)
|
6
7
|
|
7
|
-
|
8
|
+
def system!(*args)
|
9
|
+
system(*args) || abort("\n== Command #{args} failed ==")
|
10
|
+
end
|
11
|
+
|
12
|
+
chdir APP_ROOT do
|
8
13
|
# This script is a starting point to setup your application.
|
9
|
-
# Add necessary setup steps to this file
|
14
|
+
# Add necessary setup steps to this file.
|
15
|
+
|
16
|
+
puts '== Installing dependencies =='
|
17
|
+
system! 'gem install bundler --conservative'
|
18
|
+
system('bundle check') || system!('bundle install')
|
10
19
|
|
11
|
-
|
12
|
-
system
|
13
|
-
system "bundle check || bundle install"
|
20
|
+
# Install JavaScript dependencies if using Yarn
|
21
|
+
# system('bin/yarn')
|
14
22
|
|
15
23
|
# puts "\n== Copying sample files =="
|
16
|
-
# unless File.exist?(
|
17
|
-
#
|
24
|
+
# unless File.exist?('config/database.yml')
|
25
|
+
# cp 'config/database.yml.sample', 'config/database.yml'
|
18
26
|
# end
|
19
27
|
|
20
28
|
puts "\n== Preparing database =="
|
21
|
-
system
|
29
|
+
system! 'bin/rails db:setup'
|
22
30
|
|
23
31
|
puts "\n== Removing old logs and tempfiles =="
|
24
|
-
system
|
25
|
-
system "rm -rf tmp/cache"
|
32
|
+
system! 'bin/rails log:clear tmp:clear'
|
26
33
|
|
27
34
|
puts "\n== Restarting application server =="
|
28
|
-
system
|
35
|
+
system! 'bin/rails restart'
|
29
36
|
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
require 'fileutils'
|
3
|
+
include FileUtils
|
4
|
+
|
5
|
+
# path to your application root.
|
6
|
+
APP_ROOT = File.expand_path('..', __dir__)
|
7
|
+
|
8
|
+
def system!(*args)
|
9
|
+
system(*args) || abort("\n== Command #{args} failed ==")
|
10
|
+
end
|
11
|
+
|
12
|
+
chdir APP_ROOT do
|
13
|
+
# This script is a way to update your development environment automatically.
|
14
|
+
# Add necessary update steps to this file.
|
15
|
+
|
16
|
+
puts '== Installing dependencies =='
|
17
|
+
system! 'gem install bundler --conservative'
|
18
|
+
system('bundle check') || system!('bundle install')
|
19
|
+
|
20
|
+
# Install JavaScript dependencies if using Yarn
|
21
|
+
# system('bin/yarn')
|
22
|
+
|
23
|
+
puts "\n== Updating database =="
|
24
|
+
system! 'bin/rails db:migrate'
|
25
|
+
|
26
|
+
puts "\n== Removing old logs and tempfiles =="
|
27
|
+
system! 'bin/rails log:clear tmp:clear'
|
28
|
+
|
29
|
+
puts "\n== Restarting application server =="
|
30
|
+
system! 'bin/rails restart'
|
31
|
+
end
|
data/test/dummy/bin/yarn
ADDED
@@ -0,0 +1,11 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
APP_ROOT = File.expand_path('..', __dir__)
|
3
|
+
Dir.chdir(APP_ROOT) do
|
4
|
+
begin
|
5
|
+
exec "yarnpkg", *ARGV
|
6
|
+
rescue Errno::ENOENT
|
7
|
+
$stderr.puts "Yarn executable was not detected in the system."
|
8
|
+
$stderr.puts "Download Yarn at https://yarnpkg.com/en/docs/install"
|
9
|
+
exit 1
|
10
|
+
end
|
11
|
+
end
|
@@ -1,31 +1,19 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
require File.expand_path('../boot', __FILE__)
|
1
|
+
require_relative 'boot'
|
4
2
|
|
5
3
|
require 'rails/all'
|
6
4
|
|
7
5
|
Bundler.require(*Rails.groups)
|
8
|
-
require
|
6
|
+
require "buoys"
|
9
7
|
|
10
8
|
module Dummy
|
11
9
|
class Application < Rails::Application
|
12
|
-
#
|
13
|
-
|
14
|
-
# -- all .rb files in that directory are automatically loaded.
|
15
|
-
|
16
|
-
# Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
|
17
|
-
# Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
|
18
|
-
# config.time_zone = 'Central Time (US & Canada)'
|
10
|
+
# Initialize configuration defaults for originally generated Rails version.
|
11
|
+
config.load_defaults 5.2
|
19
12
|
|
20
|
-
#
|
21
|
-
#
|
22
|
-
#
|
23
|
-
|
24
|
-
|
25
|
-
# Do not swallow errors in after_commit/after_rollback callbacks.
|
26
|
-
if Gem::Version.new(Rails.version) >= Gem::Version.new('4.2.0') &&
|
27
|
-
Gem::Version.new(Rails.version) <= Gem::Version.new('5.0.0')
|
28
|
-
config.active_record.raise_in_transactional_callbacks = true
|
29
|
-
end
|
13
|
+
# Settings in config/environments/* take precedence over those specified here.
|
14
|
+
# Application configuration can go into files in config/initializers
|
15
|
+
# -- all .rb files in that directory are automatically loaded after loading
|
16
|
+
# the framework and any gems in your application.
|
30
17
|
end
|
31
18
|
end
|
19
|
+
|
data/test/dummy/config/boot.rb
CHANGED
@@ -1,7 +1,5 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
1
|
# Set up gems listed in the Gemfile.
|
4
|
-
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('
|
2
|
+
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../../Gemfile', __dir__)
|
5
3
|
|
6
4
|
require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE'])
|
7
|
-
$LOAD_PATH.unshift File.expand_path('
|
5
|
+
$LOAD_PATH.unshift File.expand_path('../../../lib', __dir__)
|
@@ -1,5 +1,3 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
1
|
Rails.application.configure do
|
4
2
|
# Settings specified here will take precedence over those in config/application.rb.
|
5
3
|
|
@@ -11,33 +9,53 @@ Rails.application.configure do
|
|
11
9
|
# Do not eager load code on boot.
|
12
10
|
config.eager_load = false
|
13
11
|
|
14
|
-
# Show full error reports
|
15
|
-
config.consider_all_requests_local
|
16
|
-
|
12
|
+
# Show full error reports.
|
13
|
+
config.consider_all_requests_local = true
|
14
|
+
|
15
|
+
# Enable/disable caching. By default caching is disabled.
|
16
|
+
# Run rails dev:cache to toggle caching.
|
17
|
+
if Rails.root.join('tmp', 'caching-dev.txt').exist?
|
18
|
+
config.action_controller.perform_caching = true
|
19
|
+
|
20
|
+
config.cache_store = :memory_store
|
21
|
+
config.public_file_server.headers = {
|
22
|
+
'Cache-Control' => "public, max-age=#{2.days.to_i}"
|
23
|
+
}
|
24
|
+
else
|
25
|
+
config.action_controller.perform_caching = false
|
26
|
+
|
27
|
+
config.cache_store = :null_store
|
28
|
+
end
|
29
|
+
|
30
|
+
# Store uploaded files on the local file system (see config/storage.yml for options)
|
31
|
+
config.active_storage.service = :local
|
17
32
|
|
18
33
|
# Don't care if the mailer can't send.
|
19
34
|
config.action_mailer.raise_delivery_errors = false
|
20
35
|
|
36
|
+
config.action_mailer.perform_caching = false
|
37
|
+
|
21
38
|
# Print deprecation notices to the Rails logger.
|
22
39
|
config.active_support.deprecation = :log
|
23
40
|
|
24
41
|
# Raise an error on page load if there are pending migrations.
|
25
42
|
config.active_record.migration_error = :page_load
|
26
43
|
|
44
|
+
# Highlight code that triggered database queries in logs.
|
45
|
+
config.active_record.verbose_query_logs = true
|
46
|
+
|
27
47
|
# Debug mode disables concatenation and preprocessing of assets.
|
28
48
|
# This option may cause significant delays in view rendering with a large
|
29
49
|
# number of complex assets.
|
30
50
|
config.assets.debug = true
|
31
51
|
|
32
|
-
#
|
33
|
-
|
34
|
-
config.assets.digest = true
|
35
|
-
|
36
|
-
# Adds additional error checking when serving assets at runtime.
|
37
|
-
# Checks for improperly declared sprockets dependencies.
|
38
|
-
# Raises helpful error messages.
|
39
|
-
config.assets.raise_runtime_errors = true
|
52
|
+
# Suppress logger output for asset requests.
|
53
|
+
config.assets.quiet = true
|
40
54
|
|
41
55
|
# Raises error for missing translations
|
42
56
|
# config.action_view.raise_on_missing_translations = true
|
57
|
+
|
58
|
+
# Use an evented file watcher to asynchronously detect changes in source code,
|
59
|
+
# routes, locales, etc. This feature depends on the listen gem.
|
60
|
+
# config.file_watcher = ActiveSupport::EventedFileUpdateChecker
|
43
61
|
end
|
@@ -1,5 +1,3 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
1
|
Rails.application.configure do
|
4
2
|
# Settings specified here will take precedence over those in config/application.rb.
|
5
3
|
|
@@ -16,15 +14,13 @@ Rails.application.configure do
|
|
16
14
|
config.consider_all_requests_local = false
|
17
15
|
config.action_controller.perform_caching = true
|
18
16
|
|
19
|
-
#
|
20
|
-
#
|
21
|
-
#
|
22
|
-
# NGINX, varnish or squid.
|
23
|
-
# config.action_dispatch.rack_cache = true
|
17
|
+
# Ensures that a master key has been made available in either ENV["RAILS_MASTER_KEY"]
|
18
|
+
# or in config/master.key. This key is used to decrypt credentials (and other encrypted files).
|
19
|
+
# config.require_master_key = true
|
24
20
|
|
25
21
|
# Disable serving static files from the `/public` folder by default since
|
26
22
|
# Apache or NGINX already handles this.
|
27
|
-
config.
|
23
|
+
config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present?
|
28
24
|
|
29
25
|
# Compress JavaScripts and CSS.
|
30
26
|
config.assets.js_compressor = :uglifier
|
@@ -33,16 +29,23 @@ Rails.application.configure do
|
|
33
29
|
# Do not fallback to assets pipeline if a precompiled asset is missed.
|
34
30
|
config.assets.compile = false
|
35
31
|
|
36
|
-
# Asset digests allow you to set far-future HTTP expiration dates on all assets,
|
37
|
-
# yet still be able to expire them through the digest params.
|
38
|
-
config.assets.digest = true
|
39
|
-
|
40
32
|
# `config.assets.precompile` and `config.assets.version` have moved to config/initializers/assets.rb
|
41
33
|
|
34
|
+
# Enable serving of images, stylesheets, and JavaScripts from an asset server.
|
35
|
+
# config.action_controller.asset_host = 'http://assets.example.com'
|
36
|
+
|
42
37
|
# Specifies the header that your server uses for sending files.
|
43
38
|
# config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache
|
44
39
|
# config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX
|
45
40
|
|
41
|
+
# Store uploaded files on the local file system (see config/storage.yml for options)
|
42
|
+
config.active_storage.service = :local
|
43
|
+
|
44
|
+
# Mount Action Cable outside main process or domain
|
45
|
+
# config.action_cable.mount_path = nil
|
46
|
+
# config.action_cable.url = 'wss://example.com/cable'
|
47
|
+
# config.action_cable.allowed_request_origins = [ 'http://example.com', /http:\/\/example.*/ ]
|
48
|
+
|
46
49
|
# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
|
47
50
|
# config.force_ssl = true
|
48
51
|
|
@@ -51,16 +54,16 @@ Rails.application.configure do
|
|
51
54
|
config.log_level = :debug
|
52
55
|
|
53
56
|
# Prepend all log lines with the following tags.
|
54
|
-
|
55
|
-
|
56
|
-
# Use a different logger for distributed setups.
|
57
|
-
# config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
|
57
|
+
config.log_tags = [ :request_id ]
|
58
58
|
|
59
59
|
# Use a different cache store in production.
|
60
60
|
# config.cache_store = :mem_cache_store
|
61
61
|
|
62
|
-
#
|
63
|
-
# config.
|
62
|
+
# Use a real queuing backend for Active Job (and separate queues per environment)
|
63
|
+
# config.active_job.queue_adapter = :resque
|
64
|
+
# config.active_job.queue_name_prefix = "dummy_#{Rails.env}"
|
65
|
+
|
66
|
+
config.action_mailer.perform_caching = false
|
64
67
|
|
65
68
|
# Ignore bad email addresses and do not raise email delivery errors.
|
66
69
|
# Set this to true and configure the email server for immediate delivery to raise delivery errors.
|
@@ -76,6 +79,16 @@ Rails.application.configure do
|
|
76
79
|
# Use default logging formatter so that PID and timestamp are not suppressed.
|
77
80
|
config.log_formatter = ::Logger::Formatter.new
|
78
81
|
|
82
|
+
# Use a different logger for distributed setups.
|
83
|
+
# require 'syslog/logger'
|
84
|
+
# config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new 'app-name')
|
85
|
+
|
86
|
+
if ENV["RAILS_LOG_TO_STDOUT"].present?
|
87
|
+
logger = ActiveSupport::Logger.new(STDOUT)
|
88
|
+
logger.formatter = config.log_formatter
|
89
|
+
config.logger = ActiveSupport::TaggedLogging.new(logger)
|
90
|
+
end
|
91
|
+
|
79
92
|
# Do not dump schema after migrations.
|
80
93
|
config.active_record.dump_schema_after_migration = false
|
81
94
|
end
|
@@ -1,5 +1,3 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
1
|
Rails.application.configure do
|
4
2
|
# Settings specified here will take precedence over those in config/application.rb.
|
5
3
|
|
@@ -14,14 +12,11 @@ Rails.application.configure do
|
|
14
12
|
# preloads Rails for running tests, you may have to set it to true.
|
15
13
|
config.eager_load = false
|
16
14
|
|
17
|
-
# Configure
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
config.serve_static_files = true
|
23
|
-
config.static_cache_control = 'public, max-age=3600'
|
24
|
-
end
|
15
|
+
# Configure public file server for tests with Cache-Control for performance.
|
16
|
+
config.public_file_server.enabled = true
|
17
|
+
config.public_file_server.headers = {
|
18
|
+
'Cache-Control' => "public, max-age=#{1.hour.to_i}"
|
19
|
+
}
|
25
20
|
|
26
21
|
# Show full error reports and disable caching.
|
27
22
|
config.consider_all_requests_local = true
|
@@ -33,14 +28,16 @@ Rails.application.configure do
|
|
33
28
|
# Disable request forgery protection in test environment.
|
34
29
|
config.action_controller.allow_forgery_protection = false
|
35
30
|
|
31
|
+
# Store uploaded files on the local file system in a temporary directory
|
32
|
+
config.active_storage.service = :test
|
33
|
+
|
34
|
+
config.action_mailer.perform_caching = false
|
35
|
+
|
36
36
|
# Tell Action Mailer not to deliver emails to the real world.
|
37
37
|
# The :test delivery method accumulates sent emails in the
|
38
38
|
# ActionMailer::Base.deliveries array.
|
39
39
|
config.action_mailer.delivery_method = :test
|
40
40
|
|
41
|
-
# Randomize the order test cases are executed.
|
42
|
-
config.active_support.test_order = :random
|
43
|
-
|
44
41
|
# Print deprecation notices to the stderr.
|
45
42
|
config.active_support.deprecation = :stderr
|
46
43
|
|