booties 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (123) hide show
  1. checksums.yaml +5 -5
  2. data/README.md +172 -0
  3. data/Rakefile +5 -4
  4. data/app/controllers/booties/application_controller.rb +4 -1
  5. data/app/helpers/booties/application_helper.rb +3 -26
  6. data/app/helpers/booties/badge_helper.rb +6 -3
  7. data/app/helpers/booties/breadcrumb_helper.rb +29 -0
  8. data/app/helpers/booties/button_helper.rb +10 -8
  9. data/app/helpers/booties/dropdown_helper.rb +71 -0
  10. data/app/helpers/booties/flag_helper.rb +7 -4
  11. data/app/helpers/booties/modal_helper.rb +4 -1
  12. data/app/helpers/booties/panel_helper.rb +3 -1
  13. data/app/helpers/booties/popover_helper.rb +28 -19
  14. data/app/helpers/booties/tooltip_helper.rb +12 -8
  15. data/config/routes.rb +2 -0
  16. data/lib/booties.rb +3 -1
  17. data/lib/booties/engine.rb +7 -1
  18. data/lib/booties/modal.rb +13 -12
  19. data/lib/booties/panel.rb +21 -18
  20. data/lib/booties/utils.rb +8 -10
  21. data/lib/booties/version.rb +3 -1
  22. data/lib/tasks/booties_tasks.rake +2 -0
  23. data/test/dummy/Rakefile +1 -1
  24. data/test/dummy/app/assets/javascripts/application.js +0 -13
  25. data/test/dummy/app/assets/stylesheets/application.css +0 -15
  26. data/test/dummy/app/channels/application_cable/channel.rb +4 -0
  27. data/test/dummy/app/channels/application_cable/connection.rb +4 -0
  28. data/test/dummy/app/controllers/application_controller.rb +0 -4
  29. data/test/dummy/app/controllers/samples_controller.rb +28 -0
  30. data/test/dummy/app/jobs/application_job.rb +2 -0
  31. data/test/dummy/app/views/layouts/application.html.erb +9 -11
  32. data/test/dummy/app/views/samples/badges.html.erb +2 -0
  33. data/test/dummy/app/views/{home → samples}/breadcrumbs.html.erb +2 -1
  34. data/test/dummy/app/views/samples/buttons.html.erb +2 -0
  35. data/test/dummy/app/views/samples/dropdowns.html.erb +6 -0
  36. data/test/dummy/app/views/samples/flags.html.erb +2 -0
  37. data/test/dummy/app/views/samples/modals.html.erb +12 -0
  38. data/test/dummy/app/views/samples/panels.html.erb +14 -0
  39. data/test/dummy/app/views/samples/popovers.html.erb +9 -0
  40. data/test/dummy/app/views/samples/tooltips.html.erb +3 -0
  41. data/test/dummy/bin/bundle +1 -1
  42. data/test/dummy/bin/rails +1 -1
  43. data/test/dummy/bin/setup +17 -13
  44. data/test/dummy/bin/update +28 -0
  45. data/test/dummy/config.ru +2 -1
  46. data/test/dummy/config/application.rb +13 -12
  47. data/test/dummy/config/boot.rb +2 -2
  48. data/test/dummy/config/environment.rb +1 -1
  49. data/test/dummy/config/environments/development.rb +24 -16
  50. data/test/dummy/config/environments/production.rb +23 -28
  51. data/test/dummy/config/environments/test.rb +5 -11
  52. data/test/dummy/config/initializers/application_controller_renderer.rb +8 -0
  53. data/test/dummy/config/initializers/content_security_policy.rb +25 -0
  54. data/test/dummy/config/initializers/cookies_serializer.rb +2 -0
  55. data/test/dummy/config/initializers/wrap_parameters.rb +6 -1
  56. data/test/dummy/config/locales/en.yml +10 -0
  57. data/test/dummy/config/puma.rb +34 -0
  58. data/test/dummy/config/routes.rb +16 -8
  59. data/test/dummy/config/spring.rb +6 -0
  60. data/test/dummy/log/test.log +11202 -19551
  61. data/test/dummy/public/404.html +6 -6
  62. data/test/dummy/public/422.html +6 -6
  63. data/test/dummy/public/500.html +6 -6
  64. data/test/dummy/public/apple-touch-icon-precomposed.png +0 -0
  65. data/test/dummy/public/apple-touch-icon.png +0 -0
  66. data/test/dummy/tmp/cache/assets/sprockets/v3.0/33/33EUCQBNqL6TOaGyMFn9wz2v39pHMJ4LOUUFUteIHHM.cache +1 -0
  67. data/test/dummy/tmp/cache/assets/sprockets/v3.0/3N/3NnKgR2TsTI1qCXKZpts0uJzp2dRJcoYp3nnFU6YE4o.cache +2 -0
  68. data/test/dummy/tmp/cache/assets/sprockets/v3.0/7Q/7Q2gtOOyCVPFrfYz4KjmXJsM_m8Yra4MjgsQmfVGxZY.cache +1 -0
  69. data/test/dummy/tmp/cache/assets/sprockets/v3.0/8c/8cROjTzeZZQaOFNLPKGuMtXO7EHxNfiEa72qt65UoF4.cache +1 -0
  70. data/test/dummy/tmp/cache/assets/sprockets/v3.0/F6/F6RhC2MbCvVanNZZe44hqlJNKAdIrH4NUzRxj5N2_EQ.cache +1 -0
  71. data/test/dummy/tmp/cache/assets/sprockets/v3.0/Fc/FcMeZRcfG4LrhIhl3xrAg3EhSZInU4efHmUrjIs4keE.cache +0 -0
  72. data/test/dummy/tmp/cache/assets/sprockets/v3.0/H3/H3dfPRbxbWIB6dQXrQ6xA9nDJqy4dOq1ujslocGVY9U.cache +1 -0
  73. data/test/dummy/tmp/cache/assets/sprockets/v3.0/LK/LKisVDbQmzgRQKdFoNH5tRbTr72CrlM_2q7MZczv2Pg.cache +1 -0
  74. data/test/dummy/tmp/cache/assets/sprockets/v3.0/Mj/MjwYGG9GkHD1fwwH2bg66EBYl3zCA_mqeDF9otey4-U.cache +3 -0
  75. data/test/dummy/tmp/cache/assets/sprockets/v3.0/Pc/Pce9HMZhc6XmsNfLUN84Enw7mySJ7ZYzys9mXmCVXqA.cache +0 -0
  76. data/test/dummy/tmp/cache/assets/sprockets/v3.0/Po/PoftKmjB8lzW06EMKeru1CsqVtULc0MsiTysT2JNqvU.cache +0 -0
  77. data/test/dummy/tmp/cache/assets/sprockets/v3.0/Su/SuILTE3Es0N_r-36Ddu2E6h49WcwH_-RsZyG4SPwKFQ.cache +0 -0
  78. data/test/dummy/tmp/cache/assets/sprockets/v3.0/cJ/cJG59MHf0x4qJKYES0pa0nLpOFpFF7YwrrvIVKIixyA.cache +0 -0
  79. data/test/dummy/tmp/cache/assets/sprockets/v3.0/fw/fwPYklzExHPpgeuv53ew_8OIpJVRyaHj2Jtj2JP9j5A.cache +0 -0
  80. data/test/dummy/tmp/cache/assets/sprockets/v3.0/jc/jc_TR7ZZTSFDDRKdgc-KnZskUESr2rLOqcYZej83LvU.cache +0 -0
  81. data/test/dummy/tmp/cache/assets/sprockets/v3.0/rV/rVy4-idUuK0Va9FLw3G8pYeZFwJAwmvs_bQcbq6_Cd0.cache +1 -0
  82. data/test/dummy/tmp/cache/assets/sprockets/v3.0/rY/rYyeRvy3oIuNfWeDhoriNlAlVjN4Wg4A3_9_OTDFin4.cache +1 -0
  83. data/test/dummy/tmp/cache/assets/sprockets/v3.0/tY/tYFbDrMNElXwgmisit50aNXJvRU2zlIFk5g-EJ1CQTc.cache +0 -0
  84. data/test/helpers/booties/badge_helper_test.rb +7 -5
  85. data/test/helpers/booties/breadcrumb_helper_test.rb +13 -0
  86. data/test/helpers/booties/button_helper_test.rb +14 -12
  87. data/test/helpers/booties/dropdown_helper_test.rb +43 -0
  88. data/test/helpers/booties/flag_helper_test.rb +7 -5
  89. data/test/helpers/booties/modal_helper_test.rb +9 -7
  90. data/test/helpers/booties/panel_helper_test.rb +4 -2
  91. data/test/helpers/booties/popover_helper_test.rb +33 -42
  92. data/test/helpers/booties/tooltip_helper_test.rb +19 -40
  93. data/test/integration/samples_test.rb +103 -0
  94. data/test/lib/booties/modal_test.rb +193 -0
  95. data/test/{booties → lib/booties}/panel_test.rb +40 -22
  96. data/test/lib/booties/utils_test.rb +41 -0
  97. data/test/stub_view.rb +14 -7
  98. data/test/test_helper.rb +10 -11
  99. metadata +124 -98
  100. data/app/assets/javascripts/booties/application.js +0 -13
  101. data/app/assets/stylesheets/booties/application.css +0 -15
  102. data/test/booties/modal_test.rb +0 -170
  103. data/test/booties/utils_test.rb +0 -26
  104. data/test/dummy/README.rdoc +0 -28
  105. data/test/dummy/app/assets/javascripts/home.js +0 -2
  106. data/test/dummy/app/assets/stylesheets/home.css +0 -4
  107. data/test/dummy/app/controllers/home_controller.rb +0 -25
  108. data/test/dummy/app/helpers/home_helper.rb +0 -2
  109. data/test/dummy/app/views/home/badge.html.erb +0 -3
  110. data/test/dummy/app/views/home/button.html.erb +0 -2
  111. data/test/dummy/app/views/home/flag.html.erb +0 -5
  112. data/test/dummy/app/views/home/modal.html.erb +0 -16
  113. data/test/dummy/app/views/home/panel.html.erb +0 -25
  114. data/test/dummy/app/views/home/popover.html.erb +0 -7
  115. data/test/dummy/app/views/home/tooltip.html.erb +0 -7
  116. data/test/dummy/config/initializers/assets.rb +0 -11
  117. data/test/dummy/config/initializers/session_store.rb +0 -3
  118. data/test/dummy/config/locales/booties.yml +0 -4
  119. data/test/dummy/config/secrets.yml +0 -22
  120. data/test/dummy/log/development.log +0 -420
  121. data/test/dummy/test/controllers/home_controller_test.rb +0 -108
  122. data/test/helpers/booties/application_helper_test.rb +0 -11
  123. data/test/integration/navigation_test.rb +0 -9
@@ -0,0 +1,2 @@
1
+ <%= badge '101' %>
2
+ <%= badge '42', class: 'foo' %>
@@ -1,4 +1,5 @@
1
1
  <% breadcrumbs do %>
2
- <li>Foo</li>
2
+ <li><a href="#">Foo</a></li>
3
3
  <li class="active">Bar</li>
4
4
  <% end %>
5
+ <%= yield :breadcrumbs %>
@@ -0,0 +1,2 @@
1
+ <%= btn_link_to 'Foo', '#' %>
2
+ <%= btn_link_to 'Bar', '#', context: :danger, class: 'btn-xs', data: { method: 'delete' } %>
@@ -0,0 +1,6 @@
1
+ <%= link_to_dropdown do %>
2
+ Foo
3
+ <% end %>
4
+ <%= dropdown_menu do %>
5
+ <li><a href="#">Foo</a></li>
6
+ <% end %>
@@ -0,0 +1,2 @@
1
+ <%= flag 'Foo' %>
2
+ <%= flag 'Bar', context: :primary, class: 'foo' %>
@@ -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 %>
@@ -0,0 +1,9 @@
1
+ <%= popover 'Text', content: 'Lorem ipsum dolor sit amet', tag: :button %>
2
+ <%=
3
+ popover 'Text',
4
+ title: 'Lorem ipsum dolor sit amet',
5
+ content: 'Occaecati corrupti atque quasi sit',
6
+ container: 'body',
7
+ placement: :right,
8
+ trigger: :focus
9
+ %>
@@ -0,0 +1,3 @@
1
+ <%= tooltip title: 'Lorem ipsum dolor sit amet' do %>
2
+ Lorem ipsum&hellip;
3
+ <% end %>
@@ -1,3 +1,3 @@
1
1
  #!/usr/bin/env ruby
2
- ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
2
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__)
3
3
  load Gem.bin_path('bundler', 'bundle')
@@ -1,4 +1,4 @@
1
1
  #!/usr/bin/env ruby
2
- APP_PATH = File.expand_path('../../config/application', __FILE__)
2
+ APP_PATH = File.expand_path('../config/application', __dir__)
3
3
  require_relative '../config/boot'
4
4
  require 'rails/commands'
@@ -1,29 +1,33 @@
1
1
  #!/usr/bin/env ruby
2
- require 'pathname'
2
+ require 'fileutils'
3
+ include FileUtils
3
4
 
4
5
  # path to your application root.
5
- APP_ROOT = Pathname.new File.expand_path('../../', __FILE__)
6
+ APP_ROOT = File.expand_path('..', __dir__)
6
7
 
7
- Dir.chdir APP_ROOT do
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 "== Installing dependencies =="
12
- system "gem install bundler --conservative"
13
- system "bundle check || bundle install"
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?("config/database.yml")
17
- # system "cp config/database.yml.sample config/database.yml"
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 "bin/rake db:setup"
26
+ system! 'bin/rails db:setup'
22
27
 
23
28
  puts "\n== Removing old logs and tempfiles =="
24
- system "rm -f log/*"
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 "touch tmp/restart.txt"
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
@@ -1,4 +1,5 @@
1
1
  # This file is used by Rack-based servers to start the application.
2
2
 
3
- require ::File.expand_path('../config/environment', __FILE__)
3
+ require_relative 'config/environment'
4
+
4
5
  run Rails.application
@@ -1,10 +1,15 @@
1
- require File.expand_path('../boot', __FILE__)
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
- # Settings in config/environments/* take precedence over those specified here.
17
- # Application configuration should go into files in config/initializers
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
- # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
25
- # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
26
- # config.i18n.default_locale = :de
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
 
@@ -1,5 +1,5 @@
1
1
  # Set up gems listed in the Gemfile.
2
- ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../../../Gemfile', __FILE__)
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('../../../../lib', __FILE__)
5
+ $LOAD_PATH.unshift File.expand_path('../../../lib', __dir__)
@@ -1,5 +1,5 @@
1
1
  # Load the Rails application.
2
- require File.expand_path('../application', __FILE__)
2
+ require_relative 'application'
3
3
 
4
4
  # Initialize the Rails application.
5
5
  Rails.application.initialize!
@@ -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 and disable caching.
13
- config.consider_all_requests_local = true
14
- config.action_controller.perform_caching = false
12
+ # Show full error reports.
13
+ config.consider_all_requests_local = true
15
14
 
16
- # Don't care if the mailer can't send.
17
- config.action_mailer.raise_delivery_errors = false
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
- # Debug mode disables concatenation and preprocessing of assets.
23
- # This option may cause significant delays in view rendering with a large
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
- # Asset digests allow you to set far-future HTTP expiration dates on all assets,
28
- # yet still be able to expire them through the digest params.
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
- # Enable Rack::Cache to put a simple HTTP cache in front of your application
18
- # Add `rack-cache` to your Gemfile before enabling this.
19
- # For large-scale production use, consider using a caching reverse proxy like
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.serve_static_files = ENV['RAILS_SERVE_STATIC_FILES'].present?
23
+ config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present?
26
24
 
27
- # Compress JavaScripts and CSS.
28
- config.assets.js_compressor = :uglifier
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
- # config.log_tags = [ :subdomain, :uuid ]
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
- # Enable serving of images, stylesheets, and JavaScripts from an asset server.
61
- # config.action_controller.asset_host = 'http://assets.example.com'
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 static file server for tests with Cache-Control for performance.
16
- config.serve_static_files = true
17
- config.static_cache_control = 'public, max-age=3600'
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,8 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # ActiveSupport::Reloader.to_prepare do
4
+ # ApplicationController.renderer.defaults.merge!(
5
+ # http_host: 'example.org',
6
+ # https: false
7
+ # )
8
+ # end
@@ -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
@@ -1,3 +1,5 @@
1
1
  # Be sure to restart your server when you modify this file.
2
2
 
3
+ # Specify a serializer for the signed and encrypted cookie jars.
4
+ # Valid options are :json, :marshal, and :hybrid.
3
5
  Rails.application.config.action_dispatch.cookies_serializer = :json
@@ -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] if respond_to?(:wrap_parameters)
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