Rails 4.2.7 guard-rspec 4.7.3Guard-rspec và ember không làm việc tốt với nhau
Kể từ khi tôi cài đặt ember-cli-ray, ứng dụng ember ngăn chặn bảo vệ-spec để chạy và gây ra hàng trăm lỗi . Dưới đây là một lỗi:
Directory: /home/sylvain/dev/placedemarche/marketadmin/tmp/broccoli_merge_trees-output_path-rlX3b4rm.tmp/marketadmin/tests/unit
is already being watched through: /home/sylvain/dev/placedemarche/marketadmin/tmp/broccoli_persistent_filterbabel__babel_marketadmin-output_path-Nv8C3Z67.tmp/marketadmin/tests/unit
MORE INFO: https://github.com/guard/listen/wiki/Duplicate-directory-errors
** ERROR: directory is already being watched! **
Tôi thử nhiều thứ trong guardfile, thậm chí loại bỏ tất cả các đồng hồ:
guard 'rspec',:cli => "--drb --format progress",all_after_pass: false do
# ignore /marketadmin/
# watch(%r{^spec/(.+)_spec\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
# watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
# watch('spec/spec_helper.rb') { "spec" }
# # Rails example
# watch(%r{^app/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
# watch(%r{^app/(.*)(\.erb|\.haml)$}) { |m| "spec/#{m[1]}#{m[2]}_spec.rb" }
# watch(%r{^app/controllers/(.+)_(controller)\.rb$}) { |m| ["spec/routing/#{m[1]}_routing_spec.rb", "spec/#{m[2]}s/#{m[1]}_#{m[2]}_spec.rb", "spec/acceptance/#{m[1]}_spec.rb"] }
# watch(%r{^spec/support/(.+)\.rb$}) { "spec" }
# watch('config/routes.rb') { "spec/routing" }
# watch('app/controllers/application_controller.rb') { "spec/controllers" }
# # Capybara request specs
# watch(%r{^app/views/(.+)/.*\.(erb|haml)$}) { |m| "spec/requests/#{m[1]}_spec.rb" }
end
Tôi đã thử nhiều phiên bản của bỏ qua, nhưng nó vẫn thất bại.
Vấn đề về cơ bản là thư mục tmp ember sử dụng để tạo ứng dụng xem trước khiến bảo vệ trở nên điên rồ. Và có vẻ như người bảo vệ bỏ qua không thực sự bảo vệ tránh thư mục, nó vẫn quét nó.
Làm cách nào để làm cho tệp bảo vệ bỏ qua thư mục ember để tôi có thể khôi phục rspec-guard?
EDIT
tôi đã chỉnh sửa guardfile như sau:
guard 'rspec',:cli => "--drb --format progress",all_after_pass: false do
ignore(%r{^marketadmin/(.+)})
end
Nó vẫn không thành công với các lỗi sau (có quá nhiều lỗi tôi đã phải thiết lập bộ nhớ thiết bị đầu cuối tới 30 000 dòng, 20 000 là không đủ):
18:24:39 - INFO - Guard::RSpec is running
18:24:39 - DEBUG - Hook :start_end executed for Guard::RSpec
D, [2017-08-24T18:25:00.166155 #20128] DEBUG -- : Waiting for processing to start...
18:25:00 - INFO - Guard is now watching at '/home/sylvain/dev/placedemarche'
18:25:00 - DEBUG - Start interactor
** ERROR: directory is already being watched! **
Directory: /home/sylvain/dev/placedemarche/marketadmin/tmp/funnel-input_base_path-WVhWKrYs.tmp
is already being watched through: /home/sylvain/dev/placedemarche/marketadmin/node_modules/qunit-notifications
MORE INFO: https://github.com/guard/listen/wiki/Duplicate-directory-errors
** ERROR: directory is already being watched! **
Directory: /home/sylvain/dev/placedemarche/marketadmin/tmp/funnel-input_base_path-ULeE6XMF.tmp
is already being watched through: /home/sylvain/dev/placedemarche/marketadmin/app
MORE INFO: https://github.com/guard/listen/wiki/Duplicate-directory-errors
Tôi đã rất ngạc nhiên khi thấy rằng bạn không thể thay đổi tập tin theo dõi glob trong Ember-cli hoặc xây dựng ember trừ khi tôi nhầm. – BookOfGreg
glob tập tin là gì? Vấn đề là trong spec bảo vệ trong dự án có chứa đường ray. – Syl
Bạn có thể yêu cầu xem 'ignore /.*/ 'để xem liệu bạn có thể chặn mọi thứ không? – BookOfGreg