ruby 守卫 : Is the directory being watched stored in some variable?

标签 ruby guard

我正在使用 Guard 自动监视目录并使用 Guard-Shell 执行一些 bash 脚本,问题是我将 Guardfile 放在与正在监视的文件夹不同的文件夹中,所以我必须使用 guard 和 guard -w/directory/being/watched.

我的问题是,是否有一个可从 Guardfile 访问的变量会告诉我正在监视的目录?

谢谢。

最佳答案

据此:

https://github.com/guard/guard/wiki/Correctly-using-the---watchdir-option

解决方案是在被监视的目录中运行 guard,但在不同的目录中指定 Guardfile:

cd /directory/being/watched
BUNDLE_GEMFILE=/projects/foo/Gemfile bundle exec guard -G /projects/foo/Guardfile

关于 ruby 守卫 : Is the directory being watched stored in some variable?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9072275/

相关文章:

Laravel:参数 2 传递给 Illuminate\Auth\SessionGuard::__construct()

ruby - 如何在 Windows 上使用 Thin 启动和停止 Sinatra 应用程序?

ruby-on-rails - 使用 rails 的 bundler 问题(mac 用户)

ruby - 更改 HTTP header 、Ruby、Linux

ruby - 如何在子目录中创建 Guard 监视文件

css - LESS CSS 守卫表达式匹配字符串

ruby - 如何在不转换为不同编码的情况下替换 Ruby 中的 UTF-8 错误?

ruby - 安装 libv8 3.11.8.3 时出错

c - 什么是 c 包含文件和保护?

ruby - 测试不会自动运行