为什么警卫停止? [英] Why is guard stopping?
问题描述
我有一个Rails应用程序,我刚刚对其进行了防护和最小化,而我的gaurd文件是
I have a rails application that I just threw guard and minitest and my gaurd file is
guard 'minitest', :cli => '--drb --format doc --color' do
# with Minitest::Unit
watch(%r|^test/(.*)\/?test_(.*)\.rb|)
watch(%r|^lib/(.*)([^/]+)\.rb|) { |m| "test/#{m[1]}test_#{m[2]}.rb" }
watch(%r|^test/test_helper\.rb|) { "test" }
# Rails
watch(%r|^app/controllers/(.*)\.rb|) { |m| "test/functional/#{m[1]}_test.rb" }
watch(%r|^app/helpers/(.*)\.rb|) { |m| "test/helpers/#{m[1]}_test.rb" }
watch(%r|^app/models/(.*)\.rb|) { |m| "test/unit/#{m[1]}_test.rb" }
end
但是当我守卫时,我会得到一个命令提示符
but when i run guard i get a command prompt
bundle exec guard
22:14:12 - INFO - Guard uses TerminalTitle to send notifications.
22:14:12 - INFO - Guard is now watching at '/Users/trace/Sites/application'
1.9.3 (main):0 > 2 + 2
=> 4
为什么我会收到此提示.任何想法...这是我正在使用的一些宝石
Why am i getting this prompt. Any ideas... here are some of the gems i am using
更新...
当我运行all minitest
时,测试就会运行...但是为什么我必须运行它...任何想法
when i run all minitest
then the tests run...but why do i have to run that...any ideas
推荐答案
您所看到的是Guard交互器,该交互器使用了 Pry .通常,提示看起来有些不同,因此我假设您有一个具有某些配置的~/.pryrc
文件.在昨天发布的Guard 1.5.3中,Guard忽略了~/.pryrc
并仅对~/.guardrc
进行Pry配置评估,因此常规Pry配置与Guard Pry交互器分开了.
What your seeing is the Guard interactor, which makes use of Pry. Normally the prompt looks a bit different, so I assume you've a ~/.pryrc
file with some configuration. With Guard 1.5.3, released yesterday, Guard ignores ~/.pryrc
and only evaluates ~/.guardrc
for the Pry configuration, so the normal Pry configuration is separated from the Guard Pry interactor.
当您看到此提示时,这意味着Guard正在等待并且无事可做.现在,您可以开始工作,并且Guard会根据您的文件修改和观察程序配置自动以minitest开始测试您的应用程序,或者您可以手动触发操作.
When you're seeing this prompt, it means that Guard is waiting and has nothing to do. You can now start working and Guard automatically starts testing your app with minitest according to your file modifications and watcher configuration, or you can manually trigger an action.
您可以使用help guard
获取可用操作的列表.根据您的Guard插件和Guardfile
中的组,会生成一些命令.这是我的一个项目的示例:
You can get a list of the available actions with help guard
. Some commands are generated depending on your Guard plugins and groups within your Guardfile
. Here's an example of one of my projects:
$ bundle exec guard
09:58:14 - INFO - Guard uses GNTP to send notifications.
09:58:14 - INFO - Guard is now watching at '/Users/michi/Repositories/extranett'
09:58:15 - INFO - Guard::Jasmine starts Unicorn test server on port 8888 in development environment.
09:58:17 - INFO - Waiting for Jasmine test runner at http://dnndev.me:8888/jasmine
09:58:23 - INFO - Run all Jasmine suites
09:58:23 - INFO - Run Jasmine suite at http://dnndev.me:8888/jasmine
09:58:41 - INFO - Finished in 8.853 seconds
09:58:41 - INFO - 896 specs, 0 failures
09:58:41 - INFO - Done.
09:58:41 - INFO - Guard::RSpec is running
09:58:41 - INFO - LiveReload 1.6 is waiting for a browser to connect.
[1] guard(main)> help guard
Guard
all Run all plugins.
backend Run all backend
change Trigger a file change.
coffeescript Run all coffeescript
frontend Run all frontend
jasmine Run all jasmine
livereload Run all livereload
notification Toggles the notifications.
pause Toggles the file listener.
reload Reload all plugins.
rspec Run all rspec
show Show all Guard plugins.
[2] guard(main)> exit
09:59:39 - INFO - Guard::Jasmine stops server.
09:59:39 - INFO - Bye bye...
这篇关于为什么警卫停止?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!