Merge pull request #1901 from tsigo/quiet_assets_gem
Add quiet_assets gem, remove initializer
This commit is contained in:
commit
b4be3c7351
3
Gemfile
3
Gemfile
|
@ -114,8 +114,9 @@ group :assets do
|
||||||
end
|
end
|
||||||
|
|
||||||
group :development do
|
group :development do
|
||||||
gem "letter_opener"
|
|
||||||
gem "annotate", git: "https://github.com/ctran/annotate_models.git"
|
gem "annotate", git: "https://github.com/ctran/annotate_models.git"
|
||||||
|
gem "letter_opener"
|
||||||
|
gem 'quiet_assets', '1.0.1'
|
||||||
gem 'rack-mini-profiler'
|
gem 'rack-mini-profiler'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -262,6 +262,8 @@ GEM
|
||||||
posix-spawn (~> 0.3.6)
|
posix-spawn (~> 0.3.6)
|
||||||
yajl-ruby (~> 1.1.0)
|
yajl-ruby (~> 1.1.0)
|
||||||
pyu-ruby-sasl (0.0.3.3)
|
pyu-ruby-sasl (0.0.3.3)
|
||||||
|
quiet_assets (1.0.1)
|
||||||
|
railties (~> 3.1)
|
||||||
rack (1.4.1)
|
rack (1.4.1)
|
||||||
rack-cache (1.2)
|
rack-cache (1.2)
|
||||||
rack (>= 0.4)
|
rack (>= 0.4)
|
||||||
|
@ -456,6 +458,7 @@ DEPENDENCIES
|
||||||
pg
|
pg
|
||||||
pry
|
pry
|
||||||
pygments.rb (= 0.3.1)
|
pygments.rb (= 0.3.1)
|
||||||
|
quiet_assets (= 1.0.1)
|
||||||
rack-mini-profiler
|
rack-mini-profiler
|
||||||
rails (= 3.2.8)
|
rails (= 3.2.8)
|
||||||
rails-dev-tweaks
|
rails-dev-tweaks
|
||||||
|
|
|
@ -1,13 +0,0 @@
|
||||||
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
|
|
Loading…
Reference in a new issue