diff options
author | Xavier Noria <fxn@hashref.com> | 2015-10-12 20:41:14 +0200 |
---|---|---|
committer | Xavier Noria <fxn@hashref.com> | 2015-11-08 22:49:49 -0800 |
commit | 785adabc4b8d892b6e06fca2f259e9c5147e9ca5 (patch) | |
tree | 3f6aa360466928f1ecbe59870944d879abb454c4 /railties/lib | |
parent | 823d3a8de0ccfe2301e51ac1e06e106035edb8e6 (diff) | |
download | rails-785adabc4b8d892b6e06fca2f259e9c5147e9ca5.tar.gz rails-785adabc4b8d892b6e06fca2f259e9c5147e9ca5.tar.bz2 rails-785adabc4b8d892b6e06fca2f259e9c5147e9ca5.zip |
implements an evented file update checker [Puneet Agarwal]
This is the implementation of the file update checker written
by Puneet Agarwal for GSoC 2015 (except for the tiny version
of the listen gem, which was 3.0.2 in the original patch).
Puneet's branch became too out of sync with upstream. This is
the final work in one single clean commit.
Credit goes in the first line using a convention understood
by the contrib app.
Diffstat (limited to 'railties/lib')
-rw-r--r-- | railties/lib/rails/application/configuration.rb | 2 | ||||
-rw-r--r-- | railties/lib/rails/generators/rails/app/templates/Gemfile | 3 |
2 files changed, 4 insertions, 1 deletions
diff --git a/railties/lib/rails/application/configuration.rb b/railties/lib/rails/application/configuration.rb index 785671f70b..6d68eea220 100644 --- a/railties/lib/rails/application/configuration.rb +++ b/railties/lib/rails/application/configuration.rb @@ -44,7 +44,7 @@ module Rails @railties_order = [:all] @relative_url_root = ENV["RAILS_RELATIVE_URL_ROOT"] @reload_classes_only_on_change = true - @file_watcher = ActiveSupport::FileUpdateChecker + @file_watcher = (defined?(Listen) && Listen::Adapter.select()!=Listen::Adapter::Polling)? ActiveSupport::FileEventedUpdateChecker : ActiveSupport::FileUpdateChecker @exceptions_app = nil @autoflush_log = true @log_formatter = ActiveSupport::Logger::SimpleFormatter.new diff --git a/railties/lib/rails/generators/rails/app/templates/Gemfile b/railties/lib/rails/generators/rails/app/templates/Gemfile index 975be07622..87ef60288d 100644 --- a/railties/lib/rails/generators/rails/app/templates/Gemfile +++ b/railties/lib/rails/generators/rails/app/templates/Gemfile @@ -53,3 +53,6 @@ end # Windows does not include zoneinfo files, so bundle the tzinfo-data gem gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby] + +# Uncomment this, to increase the performance +# gem 'listen', '~> 3.0.3' |