Sha256: 6efaadd44658dc6f0d95fe1f64d03f2b025ed522ef4140aa17d04e936acf7866

Contents?: true

Size: 509 Bytes

Versions: 7

Compression:

Stored size: 509 Bytes

Contents

# https://gist.github.com/2409513
# https://github.com/evrone/quiet_assets

if Rails.env.development?

  Rails.application.assets.logger = Logger.new('/dev/null')

  Rails::Rack::Logger.class_eval do
    def call_with_quiet_assets(env)
      previous_level = Rails.logger.level
      Rails.logger.level = Logger::ERROR if env['PATH_INFO'] =~ %r{^/assets/}
      call_without_quiet_assets(env)
    ensure
      Rails.logger.level = previous_level
    end
    alias_method_chain :call, :quiet_assets
  end

end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
advert_selector-2.0.1 test/dummy/config/initializers/silence_assets.rb
advert_selector-2.0.0 test/dummy/config/initializers/silence_assets.rb
advert_selector-1.0.4 test/dummy/config/initializers/silence_assets.rb
advert_selector-1.0.3 test/dummy/config/initializers/silence_assets.rb
advert_selector-1.0.2 test/dummy/config/initializers/silence_assets.rb
advert_selector-1.0.1 test/dummy/config/initializers/silence_assets.rb
advert_selector-1.0.0 test/dummy/config/initializers/silence_assets.rb