tabular-text 0.0.2 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (72) hide show
  1. checksums.yaml +5 -5
  2. data/lib/tabular-text/handler.rb +2 -2
  3. data/lib/tabular-text/version.rb +1 -1
  4. data/test/dummy/{README.rdoc → README.md} +1 -5
  5. data/test/dummy/Rakefile +2 -2
  6. data/test/dummy/app/assets/config/manifest.js +2 -0
  7. data/test/dummy/app/assets/stylesheets/application.css +7 -5
  8. data/test/dummy/app/channels/application_cable/channel.rb +4 -0
  9. data/test/dummy/app/channels/application_cable/connection.rb +4 -0
  10. data/test/dummy/app/controllers/application_controller.rb +0 -3
  11. data/test/dummy/app/javascript/channels/consumer.js +6 -0
  12. data/test/dummy/app/javascript/channels/index.js +5 -0
  13. data/test/dummy/app/javascript/packs/application.js +17 -0
  14. data/test/dummy/app/jobs/application_job.rb +7 -0
  15. data/test/dummy/app/mailers/application_mailer.rb +4 -0
  16. data/test/dummy/app/models/application_record.rb +3 -0
  17. data/test/dummy/app/views/layouts/application.html.erb +10 -9
  18. data/test/dummy/app/views/layouts/mailer.html.erb +13 -0
  19. data/test/dummy/app/views/layouts/mailer.text.erb +1 -0
  20. data/test/dummy/bin/rails +1 -1
  21. data/test/dummy/bin/setup +36 -0
  22. data/test/dummy/bin/yarn +11 -0
  23. data/test/dummy/config.ru +2 -1
  24. data/test/dummy/config/application.rb +9 -16
  25. data/test/dummy/config/boot.rb +2 -4
  26. data/test/dummy/config/cable.yml +10 -0
  27. data/test/dummy/config/credentials.yml.enc +1 -0
  28. data/test/dummy/config/database.yml +25 -0
  29. data/test/dummy/config/environment.rb +2 -2
  30. data/test/dummy/config/environments/development.rb +40 -4
  31. data/test/dummy/config/environments/production.rb +64 -32
  32. data/test/dummy/config/environments/test.rb +22 -9
  33. data/test/dummy/config/initializers/application_controller_renderer.rb +8 -0
  34. data/test/dummy/config/initializers/assets.rb +14 -0
  35. data/test/dummy/config/initializers/content_security_policy.rb +30 -0
  36. data/test/dummy/config/initializers/cookies_serializer.rb +5 -0
  37. data/test/dummy/config/initializers/mime_types.rb +0 -1
  38. data/test/dummy/config/initializers/wrap_parameters.rb +2 -2
  39. data/test/dummy/config/locales/en.yml +11 -1
  40. data/test/dummy/config/master.key +1 -0
  41. data/test/dummy/config/puma.rb +38 -0
  42. data/test/dummy/config/routes.rb +1 -55
  43. data/test/dummy/config/spring.rb +6 -0
  44. data/test/dummy/config/storage.yml +34 -0
  45. data/test/dummy/db/seeds.rb +3 -3
  46. data/test/dummy/db/test.sqlite3 +0 -0
  47. data/test/dummy/log/test.log +1066 -202
  48. data/test/dummy/package.json +11 -0
  49. data/test/dummy/public/404.html +24 -15
  50. data/test/dummy/public/422.html +24 -15
  51. data/test/dummy/public/500.html +23 -14
  52. data/test/dummy/public/apple-touch-icon-precomposed.png +0 -0
  53. data/test/dummy/public/apple-touch-icon.png +0 -0
  54. data/test/dummy/public/robots.txt +1 -5
  55. data/test/dummy/test/application_system_test_case.rb +5 -0
  56. data/test/dummy/test/channels/application_cable/connection_test.rb +11 -0
  57. data/test/dummy/test/test_helper.rb +4 -6
  58. data/test/dummy/tmp/development_secret.txt +1 -0
  59. data/test/integration/navigation_test.rb +6 -6
  60. data/test/test_helper.rb +2 -1
  61. metadata +104 -66
  62. data/test/dummy/Gemfile +0 -45
  63. data/test/dummy/Gemfile.lock +0 -119
  64. data/test/dummy/app/assets/javascripts/application.js +0 -16
  65. data/test/dummy/app/views/home/index.txt.tab +0 -3
  66. data/test/dummy/bin/bundle +0 -3
  67. data/test/dummy/config/initializers/secret_token.rb +0 -12
  68. data/test/dummy/config/initializers/session_store.rb +0 -3
  69. data/test/dummy/db/development.sqlite3 +0 -0
  70. data/test/dummy/db/schema.rb +0 -16
  71. data/test/dummy/log/development.log +0 -3
  72. data/test/dummy/script/rails +0 -6
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 5ab69b082880ca891e67301a01aa45c601687a95
4
- data.tar.gz: 91a9500a36554b577a923007eefad1d4fd51726b
2
+ SHA256:
3
+ metadata.gz: 3c6ffe18bd56b6d37097bdb404b229727471fb026ad4ece34cac374ed2fe2547
4
+ data.tar.gz: e735eff8cbf065628da999a15024471ca2062e657e39220c5dbe79def6d46f64
5
5
  SHA512:
6
- metadata.gz: 4d857b96cdaa3ba35cc07b42d4f41865064212947642e89478c54ab43d6cacce41f2db3a584e740220c52c8936d84039336bb508d587245e629de16fe94eb5ee
7
- data.tar.gz: 42f70dabbb2f34c404c5b3bc292c43455c9e339f31e6911697a71a5b7a92d9c87060d19d0f90d2bb995a3c26b9f6c1f4ec8348471c4d1fa8f0cd63f30203a20b
6
+ metadata.gz: '04149bb4c97e07e8f86f25a259dafbde99a696b9fe66cbfa6685cc6a43d9275a391a2c8a14e877a892174437960b245fe62232b2a944e12bba63205d100533e7'
7
+ data.tar.gz: e202f06902e89c37ae243a5a60618e126b8e240241b2ebd5c0c68ce82f8e15c86034d164b7e9b49bb404c80e07878a26f158c70ca0849b2e4ffed175e53a2455
@@ -1,9 +1,9 @@
1
1
  module TabularText
2
2
  class Handler
3
- def self.call(template)
3
+ def self.call(_template, source)
4
4
  <<-TEMPLATE
5
5
  builder = TabularText::Builder.new
6
- #{template.source}
6
+ #{source}
7
7
  builder.render
8
8
  TEMPLATE
9
9
  end
@@ -1,3 +1,3 @@
1
1
  module TabularText
2
- VERSION = "0.0.2"
2
+ VERSION = "0.1.0"
3
3
  end
@@ -1,4 +1,4 @@
1
- == README
1
+ # README
2
2
 
3
3
  This README would normally document whatever steps are necessary to get the
4
4
  application up and running.
@@ -22,7 +22,3 @@ Things you may want to cover:
22
22
  * Deployment instructions
23
23
 
24
24
  * ...
25
-
26
-
27
- Please feel free to use a different markup language if you do not plan to run
28
- <tt>rake doc:app</tt>.
@@ -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
- require File.expand_path('../config/application', __FILE__)
4
+ require_relative 'config/application'
5
5
 
6
- Dummy::Application.load_tasks
6
+ Rails.application.load_tasks
@@ -0,0 +1,2 @@
1
+ //= link_tree ../images
2
+ //= link_directory ../stylesheets .css
@@ -2,12 +2,14 @@
2
2
  * This is a manifest file that'll be compiled into application.css, which will include all the files
3
3
  * listed below.
4
4
  *
5
- * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
6
- * or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
5
+ * Any CSS and SCSS file within this directory, lib/assets/stylesheets, or any plugin's
6
+ * vendor/assets/stylesheets directory can be referenced here using a relative path.
7
7
  *
8
- * You're free to add application-wide styles to this file and they'll appear at the top of the
9
- * compiled file, but it's generally better to create a new file per style scope.
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 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.
10
12
  *
11
- *= require_self
12
13
  *= require_tree .
14
+ *= require_self
13
15
  */
@@ -0,0 +1,4 @@
1
+ module ApplicationCable
2
+ class Channel < ActionCable::Channel::Base
3
+ end
4
+ end
@@ -0,0 +1,4 @@
1
+ module ApplicationCable
2
+ class Connection < ActionCable::Connection::Base
3
+ end
4
+ end
@@ -1,5 +1,2 @@
1
1
  class ApplicationController < ActionController::Base
2
- # Prevent CSRF attacks by raising an exception.
3
- # For APIs, you may want to use :null_session instead.
4
- protect_from_forgery with: :exception
5
2
  end
@@ -0,0 +1,6 @@
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
+ import { createConsumer } from "@rails/actioncable"
5
+
6
+ export default createConsumer()
@@ -0,0 +1,5 @@
1
+ // Load all the channels within this directory and all subdirectories.
2
+ // Channel files must be named *_channel.js.
3
+
4
+ const channels = require.context('.', true, /_channel\.js$/)
5
+ channels.keys().forEach(channels)
@@ -0,0 +1,17 @@
1
+ // This file is automatically compiled by Webpack, along with any other files
2
+ // present in this directory. You're encouraged to place your actual application logic in
3
+ // a relevant structure within app/javascript and only use these pack files to reference
4
+ // that code so it'll be compiled.
5
+
6
+ require("@rails/ujs").start()
7
+ require("turbolinks").start()
8
+ require("@rails/activestorage").start()
9
+ require("channels")
10
+
11
+
12
+ // Uncomment to copy all static images under ../images to the output folder and reference
13
+ // them with the image_pack_tag helper in views (e.g <%= image_pack_tag 'rails.png' %>)
14
+ // or the `imagePath` JavaScript helper below.
15
+ //
16
+ // const images = require.context('../images', true)
17
+ // const imagePath = (name) => images(name, true)
@@ -0,0 +1,7 @@
1
+ class ApplicationJob < ActiveJob::Base
2
+ # Automatically retry jobs that encountered a deadlock
3
+ # retry_on ActiveRecord::Deadlocked
4
+
5
+ # Most jobs are safe to ignore if the underlying records are no longer available
6
+ # discard_on ActiveJob::DeserializationError
7
+ end
@@ -0,0 +1,4 @@
1
+ class ApplicationMailer < ActionMailer::Base
2
+ default from: 'from@example.com'
3
+ layout 'mailer'
4
+ end
@@ -0,0 +1,3 @@
1
+ class ApplicationRecord < ActiveRecord::Base
2
+ self.abstract_class = true
3
+ end
@@ -1,14 +1,15 @@
1
1
  <!DOCTYPE html>
2
2
  <html>
3
- <head>
4
- <title>Dummy</title>
5
- <%= stylesheet_link_tag "application", media: "all", "data-turbolinks-track" => true %>
6
- <%= javascript_include_tag "application", "data-turbolinks-track" => true %>
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
- <%= yield %>
8
+ <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %>
9
+ <%= javascript_pack_tag 'application', 'data-turbolinks-track': 'reload' %>
10
+ </head>
12
11
 
13
- </body>
12
+ <body>
13
+ <%= yield %>
14
+ </body>
14
15
  </html>
@@ -0,0 +1,13 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5
+ <style>
6
+ /* Email styles need to be inline */
7
+ </style>
8
+ </head>
9
+
10
+ <body>
11
+ <%= yield %>
12
+ </body>
13
+ </html>
@@ -0,0 +1 @@
1
+ <%= yield %>
@@ -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'
@@ -0,0 +1,36 @@
1
+ #!/usr/bin/env ruby
2
+ require 'fileutils'
3
+
4
+ # path to your application root.
5
+ APP_ROOT = File.expand_path('..', __dir__)
6
+
7
+ def system!(*args)
8
+ system(*args) || abort("\n== Command #{args} failed ==")
9
+ end
10
+
11
+ FileUtils.chdir APP_ROOT do
12
+ # This script is a way to setup or update your development environment automatically.
13
+ # This script is idempotent, so that you can run it at anytime and get an expectable outcome.
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')
19
+
20
+ # Install JavaScript dependencies
21
+ # system('bin/yarn')
22
+
23
+ # puts "\n== Copying sample files =="
24
+ # unless File.exist?('config/database.yml')
25
+ # FileUtils.cp 'config/database.yml.sample', 'config/database.yml'
26
+ # end
27
+
28
+ puts "\n== Preparing database =="
29
+ system! 'bin/rails db:prepare'
30
+
31
+ puts "\n== Removing old logs and tempfiles =="
32
+ system! 'bin/rails log:clear tmp:clear'
33
+
34
+ puts "\n== Restarting application server =="
35
+ system! 'bin/rails restart'
36
+ end
@@ -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,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,26 +1,19 @@
1
- require File.expand_path('../boot', __FILE__)
1
+ require_relative 'boot'
2
2
 
3
- require "action_controller/railtie"
4
- require "action_mailer/railtie"
5
- require "rails/test_unit/railtie"
6
- require "sprockets/railtie"
3
+ require 'rails/all'
7
4
 
8
5
  # Require the gems listed in Gemfile, including any gems
9
6
  # you've limited to :test, :development, or :production.
10
- Bundler.require(:default, Rails.env)
7
+ Bundler.require(*Rails.groups)
11
8
 
12
9
  module Dummy
13
10
  class Application < Rails::Application
14
- # Settings in config/environments/* take precedence over those specified here.
15
- # Application configuration should go into files in config/initializers
16
- # -- all .rb files in that directory are automatically loaded.
17
-
18
- # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
19
- # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
20
- # config.time_zone = 'Central Time (US & Canada)'
11
+ # Initialize configuration defaults for originally generated Rails version.
12
+ config.load_defaults 6.0
21
13
 
22
- # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
23
- # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
24
- # config.i18n.default_locale = :de
14
+ # Settings in config/environments/* take precedence over those specified here.
15
+ # Application configuration can go into files in config/initializers
16
+ # -- all .rb files in that directory are automatically loaded after loading
17
+ # the framework and any gems in your application.
25
18
  end
26
19
  end
@@ -1,5 +1,3 @@
1
- # Set up gems listed in the Gemfile.
2
- ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
3
-
4
- require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE'])
1
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__)
5
2
 
3
+ require 'bundler/setup' # Set up gems listed in the Gemfile.
@@ -0,0 +1,10 @@
1
+ development:
2
+ adapter: async
3
+
4
+ test:
5
+ adapter: test
6
+
7
+ production:
8
+ adapter: redis
9
+ url: <%= ENV.fetch("REDIS_URL") { "redis://localhost:6379/1" } %>
10
+ channel_prefix: dummy_production
@@ -0,0 +1 @@
1
+ qrzQC2Y8cY6Yrtq2vIRE+TIVrGk+8Z7aJZxVd7tIdRuYZcYQRAGNMoV/OD0YrXu2/YII6T2RAwg80pna9WxDBEtpUhNBRpUJNm5AcJ8xtMICHfGj0nKEY8DegP3dl+qksh0K/KqpMz1QdRXBc2tpOIFq/aWhSey4EIyDxdzL/JD5NEnVVWM5OVC5ByGQXbSwEnLlJdktnLyjpS3spwg3+EhtmpzlrNCgbILG6Y1aiaXCbVfv6QDv3G2ceWZmVRiNkplFagPgC9WqrbwmUKvz1dlbqW+HD+Yrunq5AILGrvYCz97DX33dtBcZgupfITF29bVJkFOXuqxG3l0xctQfY6u21XxqdAj3pIkWThKP9m1m+BmHtETWv0cLOhXGqPbFLNVYuJdTZLPRHEetbDBCY4nouKAKEHqNZHiy--7/qmUbB47ErDWHYO--GcKX+O1H0WQFxkBwf8QVRA==
@@ -0,0 +1,25 @@
1
+ # SQLite. Versions 3.8.0 and up are supported.
2
+ # gem install sqlite3
3
+ #
4
+ # Ensure the SQLite 3 gem is defined in your Gemfile
5
+ # gem 'sqlite3'
6
+ #
7
+ default: &default
8
+ adapter: sqlite3
9
+ pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
10
+ timeout: 5000
11
+
12
+ development:
13
+ <<: *default
14
+ database: db/development.sqlite3
15
+
16
+ # Warning: The database defined as "test" will be erased and
17
+ # re-generated from your development database when you run "rake".
18
+ # Do not set this db to the same as development or production.
19
+ test:
20
+ <<: *default
21
+ database: db/test.sqlite3
22
+
23
+ production:
24
+ <<: *default
25
+ database: db/production.sqlite3
@@ -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
- Dummy::Application.initialize!
5
+ Rails.application.initialize!
@@ -1,4 +1,4 @@
1
- Dummy::Application.configure do
1
+ Rails.application.configure do
2
2
  # Settings specified here will take precedence over those in config/application.rb.
3
3
 
4
4
  # In the development environment your application's code is reloaded on
@@ -9,18 +9,54 @@ Dummy::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
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
+ config.action_controller.enable_fragment_cache_logging = true
20
+
21
+ config.cache_store = :memory_store
22
+ config.public_file_server.headers = {
23
+ 'Cache-Control' => "public, max-age=#{2.days.to_i}"
24
+ }
25
+ else
26
+ config.action_controller.perform_caching = false
27
+
28
+ config.cache_store = :null_store
29
+ end
30
+
31
+ # Store uploaded files on the local file system (see config/storage.yml for options).
32
+ config.active_storage.service = :local
15
33
 
16
34
  # Don't care if the mailer can't send.
17
35
  config.action_mailer.raise_delivery_errors = false
18
36
 
37
+ config.action_mailer.perform_caching = false
38
+
19
39
  # Print deprecation notices to the Rails logger.
20
40
  config.active_support.deprecation = :log
21
41
 
42
+ # Raise an error on page load if there are pending migrations.
43
+ config.active_record.migration_error = :page_load
44
+
45
+ # Highlight code that triggered database queries in logs.
46
+ config.active_record.verbose_query_logs = true
47
+
22
48
  # Debug mode disables concatenation and preprocessing of assets.
23
49
  # This option may cause significant delays in view rendering with a large
24
50
  # number of complex assets.
25
51
  config.assets.debug = true
52
+
53
+ # Suppress logger output for asset requests.
54
+ config.assets.quiet = true
55
+
56
+ # Raises error for missing translations.
57
+ # config.action_view.raise_on_missing_translations = true
58
+
59
+ # Use an evented file watcher to asynchronously detect changes in source code,
60
+ # routes, locales, etc. This feature depends on the listen gem.
61
+ config.file_watcher = ActiveSupport::EventedFileUpdateChecker
26
62
  end
@@ -1,11 +1,11 @@
1
- Dummy::Application.configure do
1
+ Rails.application.configure do
2
2
  # Settings specified here will take precedence over those in config/application.rb.
3
3
 
4
4
  # Code is not reloaded between requests.
5
5
  config.cache_classes = true
6
6
 
7
7
  # Eager load code on boot. This eager loads most of Rails and
8
- # your application in memory, allowing both thread web servers
8
+ # your application in memory, allowing both threaded web servers
9
9
  # and those relying on copy on write to perform better.
10
10
  # Rake tasks automatically ignore this option for performance.
11
11
  config.eager_load = true
@@ -14,67 +14,99 @@ Dummy::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 nginx, varnish or squid.
20
- # 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
21
20
 
22
- # Disable Rails's static asset server (Apache or nginx will already do this).
23
- config.serve_static_assets = false
21
+ # Disable serving static files from the `/public` folder by default since
22
+ # Apache or NGINX already handles this.
23
+ config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present?
24
24
 
25
- # Compress JavaScripts and CSS.
26
- config.assets.js_compressor = :uglifier
25
+ # Compress CSS using a preprocessor.
27
26
  # config.assets.css_compressor = :sass
28
27
 
29
28
  # Do not fallback to assets pipeline if a precompiled asset is missed.
30
29
  config.assets.compile = false
31
30
 
32
- # Generate digests for assets URLs.
33
- config.assets.digest = true
34
-
35
- # Version of your assets, change this if you want to expire all your assets.
36
- config.assets.version = '1.0'
31
+ # Enable serving of images, stylesheets, and JavaScripts from an asset server.
32
+ # config.action_controller.asset_host = 'http://assets.example.com'
37
33
 
38
34
  # Specifies the header that your server uses for sending files.
39
- # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache
40
- # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx
35
+ # config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache
36
+ # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX
37
+
38
+ # Store uploaded files on the local file system (see config/storage.yml for options).
39
+ config.active_storage.service = :local
40
+
41
+ # Mount Action Cable outside main process or domain.
42
+ # config.action_cable.mount_path = nil
43
+ # config.action_cable.url = 'wss://example.com/cable'
44
+ # config.action_cable.allowed_request_origins = [ 'http://example.com', /http:\/\/example.*/ ]
41
45
 
42
46
  # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
43
47
  # config.force_ssl = true
44
48
 
45
- # Set to :debug to see everything in the log.
46
- config.log_level = :info
49
+ # Use the lowest log level to ensure availability of diagnostic information
50
+ # when problems arise.
51
+ config.log_level = :debug
47
52
 
48
53
  # Prepend all log lines with the following tags.
49
- # config.log_tags = [ :subdomain, :uuid ]
50
-
51
- # Use a different logger for distributed setups.
52
- # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
54
+ config.log_tags = [ :request_id ]
53
55
 
54
56
  # Use a different cache store in production.
55
57
  # config.cache_store = :mem_cache_store
56
58
 
57
- # Enable serving of images, stylesheets, and JavaScripts from an asset server.
58
- # config.action_controller.asset_host = "http://assets.example.com"
59
+ # Use a real queuing backend for Active Job (and separate queues per environment).
60
+ # config.active_job.queue_adapter = :resque
61
+ # config.active_job.queue_name_prefix = "dummy_production"
59
62
 
60
- # Precompile additional assets.
61
- # application.js, application.css, and all non-JS/CSS in app/assets folder are already added.
62
- # config.assets.precompile += %w( search.js )
63
+ config.action_mailer.perform_caching = false
63
64
 
64
65
  # Ignore bad email addresses and do not raise email delivery errors.
65
66
  # Set this to true and configure the email server for immediate delivery to raise delivery errors.
66
67
  # config.action_mailer.raise_delivery_errors = false
67
68
 
68
69
  # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
69
- # the I18n.default_locale when a translation can not be found).
70
+ # the I18n.default_locale when a translation cannot be found).
70
71
  config.i18n.fallbacks = true
71
72
 
72
73
  # Send deprecation notices to registered listeners.
73
74
  config.active_support.deprecation = :notify
74
75
 
75
- # Disable automatic flushing of the log to improve performance.
76
- # config.autoflush_log = false
77
-
78
76
  # Use default logging formatter so that PID and timestamp are not suppressed.
79
77
  config.log_formatter = ::Logger::Formatter.new
78
+
79
+ # Use a different logger for distributed setups.
80
+ # require 'syslog/logger'
81
+ # config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new 'app-name')
82
+
83
+ if ENV["RAILS_LOG_TO_STDOUT"].present?
84
+ logger = ActiveSupport::Logger.new(STDOUT)
85
+ logger.formatter = config.log_formatter
86
+ config.logger = ActiveSupport::TaggedLogging.new(logger)
87
+ end
88
+
89
+ # Do not dump schema after migrations.
90
+ config.active_record.dump_schema_after_migration = false
91
+
92
+ # Inserts middleware to perform automatic connection switching.
93
+ # The `database_selector` hash is used to pass options to the DatabaseSelector
94
+ # middleware. The `delay` is used to determine how long to wait after a write
95
+ # to send a subsequent read to the primary.
96
+ #
97
+ # The `database_resolver` class is used by the middleware to determine which
98
+ # database is appropriate to use based on the time delay.
99
+ #
100
+ # The `database_resolver_context` class is used by the middleware to set
101
+ # timestamps for the last write to the primary. The resolver uses the context
102
+ # class timestamps to determine how long to wait before reading from the
103
+ # replica.
104
+ #
105
+ # By default Rails will store a last write timestamp in the session. The
106
+ # DatabaseSelector middleware is designed as such you can define your own
107
+ # strategy for connection switching and pass that into the middleware through
108
+ # these configuration options.
109
+ # config.active_record.database_selector = { delay: 2.seconds }
110
+ # config.active_record.database_resolver = ActiveRecord::Middleware::DatabaseSelector::Resolver
111
+ # config.active_record.database_resolver_context = ActiveRecord::Middleware::DatabaseSelector::Resolver::Session
80
112
  end