Commit 29a7f151 authored by Benjamin Neff's avatar Benjamin Neff

Use config.assets.quiet instead of quiet_assets gem

The quiet_assets gem doesn't support rails 5, but sprockets 3 now has a
config.assets.quiet option, which deprecates the quiet_assets gem. But
the logging gem has a no-op silence method, that's why the quiet option
doesn't work out-of-the-box. I added a little hack to use the silence
method from ActiveSupport, which is also used from the original rails
logger.
parent 1360dd42
......@@ -312,7 +312,4 @@ group :development, :test do
gem "jasmine-jquery-rails", "2.0.3"
gem "rails-assets-jasmine-ajax", "3.3.1", source: "https://rails-assets.org"
gem "sinon-rails", "1.15.0"
# silence assets
gem "quiet_assets", "1.1.0"
end
......@@ -463,8 +463,6 @@ GEM
byebug (~> 9.0)
pry (~> 0.10)
public_suffix (2.0.5)
quiet_assets (1.1.0)
railties (>= 3.1, < 5.0)
rack (1.6.8)
rack-cors (1.0.1)
rack-google-analytics (1.2.0)
......@@ -826,7 +824,6 @@ DEPENDENCIES
pronto-scss (= 0.9.1)
pry
pry-byebug
quiet_assets (= 1.1.0)
rack-cors (= 1.0.1)
rack-google-analytics (= 1.2.0)
rack-piwik (= 0.3.0)
......
......@@ -32,6 +32,9 @@ Diaspora::Application.configure do
# Expands the lines which load the assets
config.assets.debug = true
# No assets request logging
config.assets.quiet = true
# Set the logging destination(s)
config.log_to = %w[stdout file]
......
......@@ -16,6 +16,9 @@ Diaspora::Application.configure do
config.serve_static_files = true
config.static_cache_control = "public, max-age=3600"
# No assets request logging
config.assets.quiet = true
# Show full error reports and disable caching
config.consider_all_requests_local = true
config.action_controller.perform_caching = false
......
......@@ -103,3 +103,10 @@ Logging::Rails.configure do |config|
end
end
end
# Include LoggerSilence from ActiveSupport. This is needed to silent assets
# requests with `config.assets.quiet`, because the default silence method of
# the logging gem is no-op. See: https://github.com/TwP/logging/issues/11
Logging::Logger.send :alias_method, :local_level, :level
Logging::Logger.send :alias_method, :local_level=, :level=
Logging::Logger.send :include, LoggerSilence
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment