Commit d0146881f0a541c609f8d90d134ffc384a2b6d74
Exists in
master
and in
4 other branches
Merge pull request #1693 from SaitoWu/features/mr
Improve development experience.
Showing
3 changed files
with
18 additions
and
0 deletions
Show diff stats
Gemfile
| @@ -118,6 +118,7 @@ group :development do | @@ -118,6 +118,7 @@ group :development do | ||
| 118 | end | 118 | end |
| 119 | 119 | ||
| 120 | group :development, :test do | 120 | group :development, :test do |
| 121 | + gem 'rails-dev-tweaks' | ||
| 121 | gem 'spinach-rails' | 122 | gem 'spinach-rails' |
| 122 | gem "rspec-rails" | 123 | gem "rspec-rails" |
| 123 | gem "capybara" | 124 | gem "capybara" |
Gemfile.lock
| @@ -277,6 +277,9 @@ GEM | @@ -277,6 +277,9 @@ GEM | ||
| 277 | activesupport (= 3.2.8) | 277 | activesupport (= 3.2.8) |
| 278 | bundler (~> 1.0) | 278 | bundler (~> 1.0) |
| 279 | railties (= 3.2.8) | 279 | railties (= 3.2.8) |
| 280 | + rails-dev-tweaks (0.6.1) | ||
| 281 | + actionpack (~> 3.1) | ||
| 282 | + railties (~> 3.1) | ||
| 280 | railties (3.2.8) | 283 | railties (3.2.8) |
| 281 | actionpack (= 3.2.8) | 284 | actionpack (= 3.2.8) |
| 282 | activesupport (= 3.2.8) | 285 | activesupport (= 3.2.8) |
| @@ -447,6 +450,7 @@ DEPENDENCIES | @@ -447,6 +450,7 @@ DEPENDENCIES | ||
| 447 | pygments.rb (= 0.3.1) | 450 | pygments.rb (= 0.3.1) |
| 448 | rack-mini-profiler | 451 | rack-mini-profiler |
| 449 | rails (= 3.2.8) | 452 | rails (= 3.2.8) |
| 453 | + rails-dev-tweaks | ||
| 450 | raphael-rails (= 1.5.2) | 454 | raphael-rails (= 1.5.2) |
| 451 | rb-fsevent | 455 | rb-fsevent |
| 452 | rb-inotify | 456 | rb-inotify |
| @@ -0,0 +1,13 @@ | @@ -0,0 +1,13 @@ | ||
| 1 | +if Rails.env.development? | ||
| 2 | + Rails.application.assets.logger = Logger.new('/dev/null') | ||
| 3 | + Rails::Rack::Logger.class_eval do | ||
| 4 | + def call_with_quiet_assets(env) | ||
| 5 | + previous_level = Rails.logger.level | ||
| 6 | + Rails.logger.level = Logger::ERROR if env['PATH_INFO'] =~ %r{^/assets/} | ||
| 7 | + call_without_quiet_assets(env) | ||
| 8 | + ensure | ||
| 9 | + Rails.logger.level = previous_level | ||
| 10 | + end | ||
| 11 | + alias_method_chain :call, :quiet_assets | ||
| 12 | + end | ||
| 13 | +end |