aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib
diff options
context:
space:
mode:
authorXavier Noria <fxn@hashref.com>2015-11-11 07:09:36 +0100
committerXavier Noria <fxn@hashref.com>2015-11-11 07:09:36 +0100
commitd0ae8adfb715cc647b1d0c1c385a8e649cf87445 (patch)
tree4ebdb712cae3ae7cf3f131946816e16d3efb1d7d /railties/lib
parent2af7338bdf32790a28e388a99dada84db0af1b5f (diff)
parent1583c8290a0bbb44ae684974e8fdd459f548f0f4 (diff)
downloadrails-d0ae8adfb715cc647b1d0c1c385a8e649cf87445.tar.gz
rails-d0ae8adfb715cc647b1d0c1c385a8e649cf87445.tar.bz2
rails-d0ae8adfb715cc647b1d0c1c385a8e649cf87445.zip
Merge branch 'fxn-master'
Diffstat (limited to 'railties/lib')
-rw-r--r--railties/lib/rails/application/configuration.rb10
-rw-r--r--railties/lib/rails/generators/rails/app/templates/Gemfile4
2 files changed, 13 insertions, 1 deletions
diff --git a/railties/lib/rails/application/configuration.rb b/railties/lib/rails/application/configuration.rb
index 785671f70b..6d89caf514 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 = file_update_checker
@exceptions_app = nil
@autoflush_log = true
@log_formatter = ActiveSupport::Logger::SimpleFormatter.new
@@ -181,6 +181,14 @@ module Rails
end
private
+ def file_update_checker
+ if defined?(Listen) && Listen::Adapter.select() != Listen::Adapter::Polling
+ ActiveSupport::FileEventedUpdateChecker
+ else
+ ActiveSupport::FileUpdateChecker
+ end
+ end
+
class Custom #:nodoc:
def initialize
@configurations = Hash.new
diff --git a/railties/lib/rails/generators/rails/app/templates/Gemfile b/railties/lib/rails/generators/rails/app/templates/Gemfile
index 975be07622..4f3f59cc22 100644
--- a/railties/lib/rails/generators/rails/app/templates/Gemfile
+++ b/railties/lib/rails/generators/rails/app/templates/Gemfile
@@ -48,6 +48,10 @@ group :development do
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
gem 'spring'
<% end -%>
+
+ # Loading the listen gem enables an evented file system monitor. Check
+ # https://github.com/guard/listen#listen-adapters if on Windows or *BSD.
+ # gem 'listen', '~> 3.0.4'
end
<% end -%>