Guard不知道文件更改

时间:2013-11-26 19:09:47

标签: ruby-on-rails guard

我正在开发一个简单的gem,并计划使用Guard来运行我的规范。但是,似乎Guard并未意识到路径的变化。

(ruby-2.0.0-p247@spree-mercadopago)jperez@devartis11:~/avalancha/spree_mp$ bundle exec guard -d --watchdir /home/jperez/avalancha/spree_mp/
15:54:45 - DEBUG - Command execution: which notify-send
15:54:45 - DEBUG - Command execution: emacsclient --eval '1' 2> /dev/null || echo 'N/A'
15:54:45 - INFO - Guard is using NotifySend to send notifications.
15:54:45 - INFO - Guard is using TerminalTitle to send notifications.
15:54:45 - DEBUG - Command execution: hash stty
15:54:45 - DEBUG - Guard starts all plugins
15:54:45 - DEBUG - Hook :start_begin executed for Guard::RSpec
15:54:45 - INFO - Guard::RSpec is running
15:54:45 - INFO - Running all specs
15:54:45 - DEBUG - Command execution: bundle exec rspec --help
15:54:46 - DEBUG - Command execution: bundle exec rspec -f progress -r /home/jperez/.rvm/gems/ruby-2.0.0-p247@spree-mercadopago/gems/guard-rspec-2.5.4/lib/guard/rspec/formatter.rb -f Guard::RSpec::Formatter --failure-exit-code 2 spec 
No DRb server is running. Running in local process instead ...
..FFFFFFFFF**FFFFFFFFFFFFFFFFFFFFFFF

Pending:
  # ...
Failures:

  #...
Finished in 23.83 seconds
36 examples, 32 failures, 2 pending

Failed examples:

# Some examples...

15:55:13 - INFO - Guard is now watching at '/home/jperez/avalancha/spree_mp'
15:55:13 - DEBUG - Start interactor
[1] guard(main)> 

现在,如果我更改文件,则没有任何反应。虽然,如果我亲自通知它,它会做我期望的事情:

[1] guard(main)> c app/models/spree_mercado_pago_client.rb
Archivo modificado!!!!
HOLA
16:08:21 - DEBUG - Trying to run Guard::RSpec#run_on_modifications with ["spec/models/spree_mercado_pago_client_spec.rb"]
16:08:21 - DEBUG - Hook :run_on_changes_begin executed for Guard::RSpec
16:08:21 - INFO - Running: spec/models/spree_mercado_pago_client_spec.rb
16:08:21 - DEBUG - Command execution: bundle exec rspec -f progress -r /home/jperez/.rvm/gems/ruby-2.0.0-p247@spree-mercadopago/gems/guard-rspec-2.5.4/lib/guard/rspec/formatter.rb -f Guard::RSpec::Formatter --failure-exit-code 2 spec/models/spree_mercado_pago_client_spec.rb 
No DRb server is running. Running in local process instead ...
..FFFFFFFFF

这是我的Guardfile

# A sample Guardfile
# More info at https://github.com/guard/guard#readme

guard 'rspec', all_after_pass:false do
  watch(%r{.*}) do |m|
    puts "Modified file!!!!"
  end


  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$}) do |m|
    puts "DEBUGGING"
    "spec/#{m[1]}_spec.rb"
  end

  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 features specs
  watch(%r{^app/views/(.+)/.*\.(erb|haml)$})          { |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

这是我的Gemfile

source 'http://rubygems.org'

gem 'spree', '~> 2.1.0'
gem 'spree_auth_devise', :git => 'https://github.com/spree/spree_auth_devise.git', :branch => '2-1-stable'


group :test do
  gem 'spork'
  gem 'guard-rspec'
  gem 'guard-spork'
  gem 'capybara'
end

gemspec

编辑:我在Ubuntu 12.10中运行它

1 个答案:

答案 0 :(得分:0)

问题似乎是在当前目录中有一个指向我的gemset的符号链接。

不清楚是不是因为它是一个符号链接,还是因为它里面有大量的文件。