【问题标题】:Ruby Guard: Is the directory being watched stored in some variable?Ruby Guard:被监视的目录是否存储在某个变量中?
【发布时间】:2012-02-22 17:50:10
【问题描述】:

我正在使用 Guard 自动监视一个目录并使用 Guard-Shell 执行一些 bash 脚本,问题是我的 Guardfile 与正在监视的文件夹位于不同的文件夹中,所以我必须使用 Guard 和 @987654321 @。

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

谢谢。

【问题讨论】:

    标签: ruby guard


    【解决方案1】:

    据此:

    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
    

    【讨论】:

      猜你喜欢
      • 2013-08-31
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-10-20
      • 1970-01-01
      • 1970-01-01
      • 2011-11-23
      • 1970-01-01
      相关资源
      最近更新 更多