"Fossies" - the Fresh Open Source Software Archive

Member "discourse-2.8.3/config/initializers/002-freedom_patches.rb" (14 Apr 2022, 515 Bytes) of package /linux/www/discourse-2.8.3.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Ruby source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    1 # frozen_string_literal: true
    2 
    3 # Multisite freedom patch defines RailsMultisite::DiscoursePatches.config which is used  by 200-first_middlewares.rb
    4 # Therefore it can not be postponed with .to_prepare
    5 RUN_WITHOUT_PREPARE = ["#{Rails.root}/lib/freedom_patches/rails_multisite.rb"]
    6 RUN_WITHOUT_PREPARE.each { |path| require(path) }
    7 
    8 Rails.application.reloader.to_prepare do
    9   Dir["#{Rails.root}/lib/freedom_patches/*.rb"].each do |f|
   10     next if RUN_WITHOUT_PREPARE.any? { |path| path == f }
   11     require(f)
   12   end
   13 end