Sha256: 825739684877fff74f13e212e31b31dc0c7da9f79a40d750dedc77211408a0fd

Contents?: true

Size: 1.65 KB

Versions: 34

Compression:

Stored size: 1.65 KB

Contents

# frozen_string_literal: true

require 'eac_ruby_utils/core_ext'

module EacRailsBase0App
  class Application < Rails::Application
    module Development
      common_concern do
        next unless ::Rails.env.development?

        setup('assets', 'cache', 'general', 'letter_opener', 'log')
      end

      module ClassMethods
        def setup_assets
          config.assets.debug = true
          config.assets.quiet = true
        end

        def setup_cache
          if Rails.root.join('tmp/caching-dev.txt').exist?
            config.action_controller.perform_caching = true
            config.cache_store = :memory_store
            config.public_file_server.headers = {
              'Cache-Control' => "public, max-age=#{2.days.seconds.to_i}"
            }
          else
            config.action_controller.perform_caching = false
            config.cache_store = :null_store
          end
        end

        def setup_general
          config.cache_classes = false
          config.eager_load = false
          config.consider_all_requests_local = true
          config.action_mailer.raise_delivery_errors = false
          config.action_mailer.perform_caching = false
          config.active_record.migration_error = :page_load
          config.file_watcher = ActiveSupport::EventedFileUpdateChecker
        end

        def setup_letter_opener
          require 'letter_opener'
          config.action_mailer.delivery_method = :letter_opener
          config.action_mailer.perform_deliveries = true
        end

        def setup_log
          config.active_support.deprecation = :log
          config.logger = new_stdout_logger
        end
      end
    end
  end
end

Version data entries

34 entries across 34 versions & 1 rubygems

Version Path
eac_rails_base0-0.68.1 lib/eac_rails_base0/app_base/application/development.rb
eac_rails_base0-0.68.0 lib/eac_rails_base0/app_base/application/development.rb
eac_rails_base0-0.67.0 lib/eac_rails_base0/app_base/application/development.rb
eac_rails_base0-0.66.0 lib/eac_rails_base0/app_base/application/development.rb
eac_rails_base0-0.65.0 lib/eac_rails_base0/app_base/application/development.rb
eac_rails_base0-0.64.0 lib/eac_rails_base0/app_base/application/development.rb
eac_rails_base0-0.63.1 lib/eac_rails_base0/app_base/application/development.rb
eac_rails_base0-0.63.0 lib/eac_rails_base0/app_base/application/development.rb
eac_rails_base0-0.62.0 lib/eac_rails_base0/app_base/application/development.rb
eac_rails_base0-0.61.1 lib/eac_rails_base0/app_base/application/development.rb
eac_rails_base0-0.61.0 lib/eac_rails_base0/app_base/application/development.rb
eac_rails_base0-0.60.4 lib/eac_rails_base0/app_base/application/development.rb
eac_rails_base0-0.60.3 lib/eac_rails_base0/app_base/application/development.rb
eac_rails_base0-0.60.2 lib/eac_rails_base0/app_base/application/development.rb
eac_rails_base0-0.60.1 lib/eac_rails_base0/app_base/application/development.rb
eac_rails_base0-0.60.0 lib/eac_rails_base0/app_base/application/development.rb
eac_rails_base0-0.59.0 lib/eac_rails_base0/app_base/application/development.rb
eac_rails_base0-0.58.0 lib/eac_rails_base0/app_base/application/development.rb
eac_rails_base0-0.57.0 lib/eac_rails_base0/app_base/application/development.rb
eac_rails_base0-0.56.0 lib/eac_rails_base0/app_base/application/development.rb