2014-01-28 1 views
0

guardfile에 4 개 이상의 guard gem이 있습니다. 가드를 실행하면 특정 가드 보석을 Guardfile에서 제거하지 않고 비활성화해야합니다. 어떻게 비활성화해야합니까?Guardfile에서 guard gem을 비활성화하는 방법

다음 질문은 rspec이 첫 번째 오류를 발견하면 실행중인 테스트를 중지합니다. 한 번에 모든 rspec 오류를 실행할 수있는 방법이 있습니까?

가드 보석은 필수적이고 쉽게 구현할 수 있습니까?

내 Guardfile

# A sample Guardfile 
# More info at https://github.com/guard/guard#readme 
guard 'migrate' do 
    watch(%r{^db/migrate/(\d+).+\.rb}) 
    watch('db/seeds.rb') 
end 

guard :annotate do 
    watch('db/schema.rb') 

    # Uncomment the following line if you also want to run annotate anytime 
    # a model file changes 
    watch('app/models/*.rb') 

    # Uncomment the following line if you are running routes annotation 
    # with the ":routes => true" option 
    watch('config/routes.rb') 
end 

guard :bundler do 
    watch('Gemfile') 
    # Uncomment next line if your Gemfile contains the `gemspec' command. 
    # watch(/^.+\.gemspec/) 
end 

guard :rspec do 
    watch(%r{^spec/.+_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|\.slim)$})   { |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 features specs 
    watch(%r{^app/views/(.+)/.*\.(erb|haml|slim)$})  { |m| "spec/features/#{m[1]}_spec.rb" } 

    # Turnip features and steps 
    watch(%r{^spec/acceptance/(.+)\.feature$}) 
    watch(%r{^spec/acceptance/steps/(.+)_steps\.rb$}) { |m| Dir[File.join("**/#{m[1]}.feature")][0] || 'spec/acceptance' } 
end 

guard :rubocop do 
    watch(%r{.+\.rb$}) 
    watch(%r{(?:.+/)?\.rubocop\.yml$}) { |m| File.dirname(m[0]) } 
end 

### Guard::Sidekiq 
# available options: 
# - :verbose 
# - :queue (defaults to "default") can be an array 
# - :concurrency (defaults to 1) 
# - :timeout 
# - :environment (corresponds to RAILS_ENV for the Sidekiq worker) 
guard 'sidekiq', :environment => 'development' do 
    watch(%r{^workers/(.+)\.rb$}) 
end 

guard 'rails' do 
    watch('Gemfile.lock') 
    watch(%r{^(config|lib)/.*}) 
end 


# Sample guardfile block for Guard::Haml 
# You can use some options to change guard-haml configuration 
# output: 'public'     set output directory for compiled files 
# input: 'src'      set input directory with haml files 
# run_at_start: true     compile files when guard starts 
# notifications: true    send notifictions to Growl/libnotify/Notifu 
# haml_options: { ugly: true } pass options to the Haml engine 

guard 'puma' do 
    watch('Gemfile.lock') 
    watch(%r{^config|lib|api/.*}) 
end 

guard 'rake', :task => 'build' do 
    watch(%r{^my_file.rb}) 
end 
+0

보호 파일이란 무엇입니까? 그것을 –

+0

으로 지정하면'guard '에서'rspec'을 다시 실행하여 엔터 버튼을 누르지 만,'Gemfile'에서 하나 이상의'guard'를 가질 필요는 없습니다 – bjhaid

답변