booties 0.1.0 → 0.2.0
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 +5 -5
- data/README.md +172 -0
- data/Rakefile +5 -4
- data/app/controllers/booties/application_controller.rb +4 -1
- data/app/helpers/booties/application_helper.rb +3 -26
- data/app/helpers/booties/badge_helper.rb +6 -3
- data/app/helpers/booties/breadcrumb_helper.rb +29 -0
- data/app/helpers/booties/button_helper.rb +10 -8
- data/app/helpers/booties/dropdown_helper.rb +71 -0
- data/app/helpers/booties/flag_helper.rb +7 -4
- data/app/helpers/booties/modal_helper.rb +4 -1
- data/app/helpers/booties/panel_helper.rb +3 -1
- data/app/helpers/booties/popover_helper.rb +28 -19
- data/app/helpers/booties/tooltip_helper.rb +12 -8
- data/config/routes.rb +2 -0
- data/lib/booties.rb +3 -1
- data/lib/booties/engine.rb +7 -1
- data/lib/booties/modal.rb +13 -12
- data/lib/booties/panel.rb +21 -18
- data/lib/booties/utils.rb +8 -10
- data/lib/booties/version.rb +3 -1
- data/lib/tasks/booties_tasks.rake +2 -0
- data/test/dummy/Rakefile +1 -1
- data/test/dummy/app/assets/javascripts/application.js +0 -13
- data/test/dummy/app/assets/stylesheets/application.css +0 -15
- 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 -4
- data/test/dummy/app/controllers/samples_controller.rb +28 -0
- data/test/dummy/app/jobs/application_job.rb +2 -0
- data/test/dummy/app/views/layouts/application.html.erb +9 -11
- data/test/dummy/app/views/samples/badges.html.erb +2 -0
- data/test/dummy/app/views/{home → samples}/breadcrumbs.html.erb +2 -1
- data/test/dummy/app/views/samples/buttons.html.erb +2 -0
- data/test/dummy/app/views/samples/dropdowns.html.erb +6 -0
- data/test/dummy/app/views/samples/flags.html.erb +2 -0
- data/test/dummy/app/views/samples/modals.html.erb +12 -0
- data/test/dummy/app/views/samples/panels.html.erb +14 -0
- data/test/dummy/app/views/samples/popovers.html.erb +9 -0
- data/test/dummy/app/views/samples/tooltips.html.erb +3 -0
- data/test/dummy/bin/bundle +1 -1
- data/test/dummy/bin/rails +1 -1
- data/test/dummy/bin/setup +17 -13
- data/test/dummy/bin/update +28 -0
- data/test/dummy/config.ru +2 -1
- data/test/dummy/config/application.rb +13 -12
- data/test/dummy/config/boot.rb +2 -2
- data/test/dummy/config/environment.rb +1 -1
- data/test/dummy/config/environments/development.rb +24 -16
- data/test/dummy/config/environments/production.rb +23 -28
- data/test/dummy/config/environments/test.rb +5 -11
- data/test/dummy/config/initializers/application_controller_renderer.rb +8 -0
- data/test/dummy/config/initializers/content_security_policy.rb +25 -0
- data/test/dummy/config/initializers/cookies_serializer.rb +2 -0
- data/test/dummy/config/initializers/wrap_parameters.rb +6 -1
- data/test/dummy/config/locales/en.yml +10 -0
- data/test/dummy/config/puma.rb +34 -0
- data/test/dummy/config/routes.rb +16 -8
- data/test/dummy/config/spring.rb +6 -0
- data/test/dummy/log/test.log +11202 -19551
- 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/cache/assets/sprockets/v3.0/33/33EUCQBNqL6TOaGyMFn9wz2v39pHMJ4LOUUFUteIHHM.cache +1 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/3N/3NnKgR2TsTI1qCXKZpts0uJzp2dRJcoYp3nnFU6YE4o.cache +2 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/7Q/7Q2gtOOyCVPFrfYz4KjmXJsM_m8Yra4MjgsQmfVGxZY.cache +1 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/8c/8cROjTzeZZQaOFNLPKGuMtXO7EHxNfiEa72qt65UoF4.cache +1 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/F6/F6RhC2MbCvVanNZZe44hqlJNKAdIrH4NUzRxj5N2_EQ.cache +1 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/Fc/FcMeZRcfG4LrhIhl3xrAg3EhSZInU4efHmUrjIs4keE.cache +0 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/H3/H3dfPRbxbWIB6dQXrQ6xA9nDJqy4dOq1ujslocGVY9U.cache +1 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/LK/LKisVDbQmzgRQKdFoNH5tRbTr72CrlM_2q7MZczv2Pg.cache +1 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/Mj/MjwYGG9GkHD1fwwH2bg66EBYl3zCA_mqeDF9otey4-U.cache +3 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/Pc/Pce9HMZhc6XmsNfLUN84Enw7mySJ7ZYzys9mXmCVXqA.cache +0 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/Po/PoftKmjB8lzW06EMKeru1CsqVtULc0MsiTysT2JNqvU.cache +0 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/Su/SuILTE3Es0N_r-36Ddu2E6h49WcwH_-RsZyG4SPwKFQ.cache +0 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/cJ/cJG59MHf0x4qJKYES0pa0nLpOFpFF7YwrrvIVKIixyA.cache +0 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/fw/fwPYklzExHPpgeuv53ew_8OIpJVRyaHj2Jtj2JP9j5A.cache +0 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/jc/jc_TR7ZZTSFDDRKdgc-KnZskUESr2rLOqcYZej83LvU.cache +0 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/rV/rVy4-idUuK0Va9FLw3G8pYeZFwJAwmvs_bQcbq6_Cd0.cache +1 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/rY/rYyeRvy3oIuNfWeDhoriNlAlVjN4Wg4A3_9_OTDFin4.cache +1 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/tY/tYFbDrMNElXwgmisit50aNXJvRU2zlIFk5g-EJ1CQTc.cache +0 -0
- data/test/helpers/booties/badge_helper_test.rb +7 -5
- data/test/helpers/booties/breadcrumb_helper_test.rb +13 -0
- data/test/helpers/booties/button_helper_test.rb +14 -12
- data/test/helpers/booties/dropdown_helper_test.rb +43 -0
- data/test/helpers/booties/flag_helper_test.rb +7 -5
- data/test/helpers/booties/modal_helper_test.rb +9 -7
- data/test/helpers/booties/panel_helper_test.rb +4 -2
- data/test/helpers/booties/popover_helper_test.rb +33 -42
- data/test/helpers/booties/tooltip_helper_test.rb +19 -40
- data/test/integration/samples_test.rb +103 -0
- data/test/lib/booties/modal_test.rb +193 -0
- data/test/{booties → lib/booties}/panel_test.rb +40 -22
- data/test/lib/booties/utils_test.rb +41 -0
- data/test/stub_view.rb +14 -7
- data/test/test_helper.rb +10 -11
- metadata +124 -98
- data/app/assets/javascripts/booties/application.js +0 -13
- data/app/assets/stylesheets/booties/application.css +0 -15
- data/test/booties/modal_test.rb +0 -170
- data/test/booties/utils_test.rb +0 -26
- data/test/dummy/README.rdoc +0 -28
- data/test/dummy/app/assets/javascripts/home.js +0 -2
- data/test/dummy/app/assets/stylesheets/home.css +0 -4
- data/test/dummy/app/controllers/home_controller.rb +0 -25
- data/test/dummy/app/helpers/home_helper.rb +0 -2
- data/test/dummy/app/views/home/badge.html.erb +0 -3
- data/test/dummy/app/views/home/button.html.erb +0 -2
- data/test/dummy/app/views/home/flag.html.erb +0 -5
- data/test/dummy/app/views/home/modal.html.erb +0 -16
- data/test/dummy/app/views/home/panel.html.erb +0 -25
- data/test/dummy/app/views/home/popover.html.erb +0 -7
- data/test/dummy/app/views/home/tooltip.html.erb +0 -7
- data/test/dummy/config/initializers/assets.rb +0 -11
- data/test/dummy/config/initializers/session_store.rb +0 -3
- data/test/dummy/config/locales/booties.yml +0 -4
- data/test/dummy/config/secrets.yml +0 -22
- data/test/dummy/log/development.log +0 -420
- data/test/dummy/test/controllers/home_controller_test.rb +0 -108
- data/test/helpers/booties/application_helper_test.rb +0 -11
- data/test/integration/navigation_test.rb +0 -9
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<%= modal 'foo', size: :large do |m| %>
|
|
2
|
+
<%= m.header do %>
|
|
3
|
+
Title
|
|
4
|
+
<% end %>
|
|
5
|
+
<%= m.body do %>
|
|
6
|
+
<p>Body</p>
|
|
7
|
+
<% end %>
|
|
8
|
+
<%= m.footer do %>
|
|
9
|
+
<%= m.dismiss 'Dismiss', class: 'btn btn-default' %>
|
|
10
|
+
<%= btn_link_to 'Confirm', '/bar', context: :primary %>
|
|
11
|
+
<% end %>
|
|
12
|
+
<% end %>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<%= panel do |p| %>
|
|
2
|
+
<%= p.heading p.title 'Title' %>
|
|
3
|
+
<%= p.body do %>
|
|
4
|
+
<p>Body</p>
|
|
5
|
+
<% end %>
|
|
6
|
+
<%= p.footer 'Footer' %>
|
|
7
|
+
<% end %>
|
|
8
|
+
|
|
9
|
+
<%= panel context: :info do |p| %>
|
|
10
|
+
<%= p.heading p.title 'Title' %>
|
|
11
|
+
<table>
|
|
12
|
+
<caption>Use table instead of .panel-body</caption>
|
|
13
|
+
</table>
|
|
14
|
+
<% end %>
|
data/test/dummy/bin/bundle
CHANGED
data/test/dummy/bin/rails
CHANGED
data/test/dummy/bin/setup
CHANGED
|
@@ -1,29 +1,33 @@
|
|
|
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.
|
|
10
15
|
|
|
11
|
-
puts
|
|
12
|
-
system
|
|
13
|
-
system
|
|
16
|
+
puts '== Installing dependencies =='
|
|
17
|
+
system! 'gem install bundler --conservative'
|
|
18
|
+
system('bundle check') || system!('bundle install')
|
|
14
19
|
|
|
15
20
|
# puts "\n== Copying sample files =="
|
|
16
|
-
# unless File.exist?(
|
|
17
|
-
#
|
|
21
|
+
# unless File.exist?('config/database.yml')
|
|
22
|
+
# cp 'config/database.yml.sample', 'config/database.yml'
|
|
18
23
|
# end
|
|
19
24
|
|
|
20
25
|
puts "\n== Preparing database =="
|
|
21
|
-
system
|
|
26
|
+
system! 'bin/rails db:setup'
|
|
22
27
|
|
|
23
28
|
puts "\n== Removing old logs and tempfiles =="
|
|
24
|
-
system
|
|
25
|
-
system "rm -rf tmp/cache"
|
|
29
|
+
system! 'bin/rails log:clear tmp:clear'
|
|
26
30
|
|
|
27
31
|
puts "\n== Restarting application server =="
|
|
28
|
-
system
|
|
32
|
+
system! 'bin/rails restart'
|
|
29
33
|
end
|
|
@@ -0,0 +1,28 @@
|
|
|
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
|
+
puts "\n== Updating database =="
|
|
21
|
+
system! 'bin/rails db:migrate'
|
|
22
|
+
|
|
23
|
+
puts "\n== Removing old logs and tempfiles =="
|
|
24
|
+
system! 'bin/rails log:clear tmp:clear'
|
|
25
|
+
|
|
26
|
+
puts "\n== Restarting application server =="
|
|
27
|
+
system! 'bin/rails restart'
|
|
28
|
+
end
|
data/test/dummy/config.ru
CHANGED
|
@@ -1,10 +1,15 @@
|
|
|
1
|
-
|
|
1
|
+
require_relative 'boot'
|
|
2
2
|
|
|
3
|
+
require "rails"
|
|
3
4
|
# Pick the frameworks you want:
|
|
5
|
+
# require "active_model/railtie"
|
|
6
|
+
# require "active_job/railtie"
|
|
4
7
|
# require "active_record/railtie"
|
|
8
|
+
# require "active_storage/engine"
|
|
5
9
|
require "action_controller/railtie"
|
|
6
|
-
require "action_mailer/railtie"
|
|
10
|
+
# require "action_mailer/railtie"
|
|
7
11
|
require "action_view/railtie"
|
|
12
|
+
# require "action_cable/engine"
|
|
8
13
|
# require "sprockets/railtie"
|
|
9
14
|
require "rails/test_unit/railtie"
|
|
10
15
|
|
|
@@ -13,17 +18,13 @@ require "booties"
|
|
|
13
18
|
|
|
14
19
|
module Dummy
|
|
15
20
|
class Application < Rails::Application
|
|
16
|
-
#
|
|
17
|
-
|
|
18
|
-
# -- all .rb files in that directory are automatically loaded.
|
|
19
|
-
|
|
20
|
-
# Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
|
|
21
|
-
# Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
|
|
22
|
-
# config.time_zone = 'Central Time (US & Canada)'
|
|
21
|
+
# Initialize configuration defaults for originally generated Rails version.
|
|
22
|
+
config.load_defaults 5.2
|
|
23
23
|
|
|
24
|
-
#
|
|
25
|
-
#
|
|
26
|
-
#
|
|
24
|
+
# Settings in config/environments/* take precedence over those specified here.
|
|
25
|
+
# Application configuration can go into files in config/initializers
|
|
26
|
+
# -- all .rb files in that directory are automatically loaded after loading
|
|
27
|
+
# the framework and any gems in your application.
|
|
27
28
|
end
|
|
28
29
|
end
|
|
29
30
|
|
data/test/dummy/config/boot.rb
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# Set up gems listed in the Gemfile.
|
|
2
|
-
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('
|
|
2
|
+
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../../Gemfile', __dir__)
|
|
3
3
|
|
|
4
4
|
require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE'])
|
|
5
|
-
$LOAD_PATH.unshift File.expand_path('
|
|
5
|
+
$LOAD_PATH.unshift File.expand_path('../../../lib', __dir__)
|
|
@@ -9,30 +9,38 @@ Rails.application.configure do
|
|
|
9
9
|
# Do not eager load code on boot.
|
|
10
10
|
config.eager_load = false
|
|
11
11
|
|
|
12
|
-
# Show full error reports
|
|
13
|
-
config.consider_all_requests_local
|
|
14
|
-
config.action_controller.perform_caching = false
|
|
12
|
+
# Show full error reports.
|
|
13
|
+
config.consider_all_requests_local = true
|
|
15
14
|
|
|
16
|
-
#
|
|
17
|
-
|
|
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
|
|
18
29
|
|
|
19
30
|
# Print deprecation notices to the Rails logger.
|
|
20
31
|
config.active_support.deprecation = :log
|
|
21
32
|
|
|
22
|
-
#
|
|
23
|
-
|
|
24
|
-
# number of complex assets.
|
|
25
|
-
config.assets.debug = true
|
|
33
|
+
# Raise an error on page load if there are pending migrations.
|
|
34
|
+
config.active_record.migration_error = :page_load
|
|
26
35
|
|
|
27
|
-
#
|
|
28
|
-
|
|
29
|
-
config.assets.digest = true
|
|
36
|
+
# Highlight code that triggered database queries in logs.
|
|
37
|
+
config.active_record.verbose_query_logs = true
|
|
30
38
|
|
|
31
|
-
# Adds additional error checking when serving assets at runtime.
|
|
32
|
-
# Checks for improperly declared sprockets dependencies.
|
|
33
|
-
# Raises helpful error messages.
|
|
34
|
-
config.assets.raise_runtime_errors = true
|
|
35
39
|
|
|
36
40
|
# Raises error for missing translations
|
|
37
41
|
# config.action_view.raise_on_missing_translations = true
|
|
42
|
+
|
|
43
|
+
# Use an evented file watcher to asynchronously detect changes in source code,
|
|
44
|
+
# routes, locales, etc. This feature depends on the listen gem.
|
|
45
|
+
# config.file_watcher = ActiveSupport::EventedFileUpdateChecker
|
|
38
46
|
end
|
|
@@ -14,28 +14,16 @@ Rails.application.configure do
|
|
|
14
14
|
config.consider_all_requests_local = false
|
|
15
15
|
config.action_controller.perform_caching = true
|
|
16
16
|
|
|
17
|
-
#
|
|
18
|
-
#
|
|
19
|
-
#
|
|
20
|
-
# NGINX, varnish or squid.
|
|
21
|
-
# 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
|
|
22
20
|
|
|
23
21
|
# Disable serving static files from the `/public` folder by default since
|
|
24
22
|
# Apache or NGINX already handles this.
|
|
25
|
-
config.
|
|
23
|
+
config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present?
|
|
26
24
|
|
|
27
|
-
#
|
|
28
|
-
config.
|
|
29
|
-
# config.assets.css_compressor = :sass
|
|
30
|
-
|
|
31
|
-
# Do not fallback to assets pipeline if a precompiled asset is missed.
|
|
32
|
-
config.assets.compile = false
|
|
33
|
-
|
|
34
|
-
# Asset digests allow you to set far-future HTTP expiration dates on all assets,
|
|
35
|
-
# yet still be able to expire them through the digest params.
|
|
36
|
-
config.assets.digest = true
|
|
37
|
-
|
|
38
|
-
# `config.assets.precompile` and `config.assets.version` have moved to config/initializers/assets.rb
|
|
25
|
+
# Enable serving of images, stylesheets, and JavaScripts from an asset server.
|
|
26
|
+
# config.action_controller.asset_host = 'http://assets.example.com'
|
|
39
27
|
|
|
40
28
|
# Specifies the header that your server uses for sending files.
|
|
41
29
|
# config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache
|
|
@@ -49,20 +37,14 @@ Rails.application.configure do
|
|
|
49
37
|
config.log_level = :debug
|
|
50
38
|
|
|
51
39
|
# Prepend all log lines with the following tags.
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
# Use a different logger for distributed setups.
|
|
55
|
-
# config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
|
|
40
|
+
config.log_tags = [ :request_id ]
|
|
56
41
|
|
|
57
42
|
# Use a different cache store in production.
|
|
58
43
|
# config.cache_store = :mem_cache_store
|
|
59
44
|
|
|
60
|
-
#
|
|
61
|
-
# config.
|
|
62
|
-
|
|
63
|
-
# Ignore bad email addresses and do not raise email delivery errors.
|
|
64
|
-
# Set this to true and configure the email server for immediate delivery to raise delivery errors.
|
|
65
|
-
# config.action_mailer.raise_delivery_errors = false
|
|
45
|
+
# Use a real queuing backend for Active Job (and separate queues per environment)
|
|
46
|
+
# config.active_job.queue_adapter = :resque
|
|
47
|
+
# config.active_job.queue_name_prefix = "dummy_#{Rails.env}"
|
|
66
48
|
|
|
67
49
|
# Enable locale fallbacks for I18n (makes lookups for any locale fall back to
|
|
68
50
|
# the I18n.default_locale when a translation cannot be found).
|
|
@@ -73,4 +55,17 @@ Rails.application.configure do
|
|
|
73
55
|
|
|
74
56
|
# Use default logging formatter so that PID and timestamp are not suppressed.
|
|
75
57
|
config.log_formatter = ::Logger::Formatter.new
|
|
58
|
+
|
|
59
|
+
# Use a different logger for distributed setups.
|
|
60
|
+
# require 'syslog/logger'
|
|
61
|
+
# config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new 'app-name')
|
|
62
|
+
|
|
63
|
+
if ENV["RAILS_LOG_TO_STDOUT"].present?
|
|
64
|
+
logger = ActiveSupport::Logger.new(STDOUT)
|
|
65
|
+
logger.formatter = config.log_formatter
|
|
66
|
+
config.logger = ActiveSupport::TaggedLogging.new(logger)
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
# Do not dump schema after migrations.
|
|
70
|
+
config.active_record.dump_schema_after_migration = false
|
|
76
71
|
end
|
|
@@ -12,9 +12,11 @@ Rails.application.configure do
|
|
|
12
12
|
# preloads Rails for running tests, you may have to set it to true.
|
|
13
13
|
config.eager_load = false
|
|
14
14
|
|
|
15
|
-
# Configure
|
|
16
|
-
config.
|
|
17
|
-
config.
|
|
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
|
+
}
|
|
18
20
|
|
|
19
21
|
# Show full error reports and disable caching.
|
|
20
22
|
config.consider_all_requests_local = true
|
|
@@ -26,14 +28,6 @@ Rails.application.configure do
|
|
|
26
28
|
# Disable request forgery protection in test environment.
|
|
27
29
|
config.action_controller.allow_forgery_protection = false
|
|
28
30
|
|
|
29
|
-
# Tell Action Mailer not to deliver emails to the real world.
|
|
30
|
-
# The :test delivery method accumulates sent emails in the
|
|
31
|
-
# ActionMailer::Base.deliveries array.
|
|
32
|
-
config.action_mailer.delivery_method = :test
|
|
33
|
-
|
|
34
|
-
# Randomize the order test cases are executed.
|
|
35
|
-
config.active_support.test_order = :random
|
|
36
|
-
|
|
37
31
|
# Print deprecation notices to the stderr.
|
|
38
32
|
config.active_support.deprecation = :stderr
|
|
39
33
|
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Be sure to restart your server when you modify this file.
|
|
2
|
+
|
|
3
|
+
# Define an application-wide content security policy
|
|
4
|
+
# For further information see the following documentation
|
|
5
|
+
# https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy
|
|
6
|
+
|
|
7
|
+
# Rails.application.config.content_security_policy do |policy|
|
|
8
|
+
# policy.default_src :self, :https
|
|
9
|
+
# policy.font_src :self, :https, :data
|
|
10
|
+
# policy.img_src :self, :https, :data
|
|
11
|
+
# policy.object_src :none
|
|
12
|
+
# policy.script_src :self, :https
|
|
13
|
+
# policy.style_src :self, :https
|
|
14
|
+
|
|
15
|
+
# # Specify URI for violation reports
|
|
16
|
+
# # policy.report_uri "/csp-violation-report-endpoint"
|
|
17
|
+
# end
|
|
18
|
+
|
|
19
|
+
# If you are using UJS then enable automatic nonce generation
|
|
20
|
+
# Rails.application.config.content_security_policy_nonce_generator = -> request { SecureRandom.base64(16) }
|
|
21
|
+
|
|
22
|
+
# Report CSP violations to a specified URI
|
|
23
|
+
# For further information see the following documentation:
|
|
24
|
+
# https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy-Report-Only
|
|
25
|
+
# Rails.application.config.content_security_policy_report_only = true
|
|
@@ -5,5 +5,10 @@
|
|
|
5
5
|
|
|
6
6
|
# Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
|
|
7
7
|
ActiveSupport.on_load(:action_controller) do
|
|
8
|
-
wrap_parameters format: [:json]
|
|
8
|
+
wrap_parameters format: [:json]
|
|
9
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
|