Permalink
Browse files

enables the evented monitor in new applications

  • Loading branch information...
fxn committed Feb 9, 2016
1 parent b5eb242 commit de6ad5665d2679944a9ee9407826ba88395a1003
View
@@ -1,3 +1,8 @@
* New applications are generated with the evented file system monitor enabled
on Linux and Mac OS X.
*Xavier Noria*
* Add dummy files for apple-touch-icon.png and apple-touch-icon.png. GH#23427
*Alexey Zabelin*
@@ -390,6 +390,10 @@ def spring_install?
!options[:skip_spring] && !options.dev? && Process.respond_to?(:fork) && !RUBY_PLATFORM.include?("cygwin")
end
def os_supports_listen_out_of_the_box?
RbConfig::CONFIG['host_os'] =~ /darwin|linux/
end
def run_bundle
bundle_command('install') if bundle_install?
end
@@ -38,6 +38,9 @@ group :development do
gem 'web-console', '~> 3.0'
<%- end -%>
<%- end -%>
<% if os_supports_listen_out_of_the_box? -%>
gem 'listen', '~> 3.0.5'
<% end -%>
<% if spring_install? -%>
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
gem 'spring'
@@ -58,5 +58,5 @@ Rails.application.configure do
# Use an evented file watcher to asynchronously detect changes in source code,
# routes, locales, etc. This feature depends on the listen gem.
# config.file_watcher = ActiveSupport::EventedFileUpdateChecker
<%= '# ' unless os_supports_listen_out_of_the_box? %>config.file_watcher = ActiveSupport::EventedFileUpdateChecker

This comment has been minimized.

Show comment
Hide comment
@rubys

rubys Feb 10, 2016

Contributor

Since this may fail on environments that load the application from a VBox shared folder or a NFS, and causes race conditions with the awdwr test suite, perhaps adding something like

unless ENV['RAILS_DISABLE_LISTEN']

... would be in order? This could then be both a documented part of Rails and something added automatically by rails-dev-box.

@rubys

rubys Feb 10, 2016

Contributor

Since this may fail on environments that load the application from a VBox shared folder or a NFS, and causes race conditions with the awdwr test suite, perhaps adding something like

unless ENV['RAILS_DISABLE_LISTEN']

... would be in order? This could then be both a documented part of Rails and something added automatically by rails-dev-box.

end
@@ -479,6 +479,28 @@ def test_inclusion_of_a_debugger
end
end
def test_inclusion_of_listen_related_gems
run_generator
if RbConfig::CONFIG['host_os'] =~ /darwin|linux/
assert_gem 'listen'
else
assert_file 'Gemfile' do |content|
assert_no_match(/listen/, content)
end
end
end
def test_evented_file_update_checker_config
run_generator
assert_file 'config/environments/development.rb' do |content|
if RbConfig::CONFIG['host_os'] =~ /darwin|linux/
assert_match(/^\s*config.file_watcher = ActiveSupport::EventedFileUpdateChecker/, content)
else
assert_match(/^\s*# config.file_watcher = ActiveSupport::EventedFileUpdateChecker/, content)
end
end
end
def test_template_from_dir_pwd
FileUtils.cd(Rails.root)
assert_match(/It works from file!/, run_generator([destination_root, "-m", "lib/template.rb"]))

1 comment on commit de6ad56

@rubys

This comment has been minimized.

Show comment
Hide comment
@rubys

rubys Feb 10, 2016

Contributor

This commit causes the Agile Web Development with Rails tests to fail, see #23590 for details.

Contributor

rubys commented on de6ad56 Feb 10, 2016

This commit causes the Agile Web Development with Rails tests to fail, see #23590 for details.

Please sign in to comment.