【问题标题】:Foreman running guard with color ouput带颜色输出的工头跑卫
【发布时间】:2012-02-27 15:00:16
【问题描述】:

我可以在我的工头 procfile 中运行警卫 - 但输出不像我想要的那样丰富多彩。我在输出中看到的唯一颜色来自 Foreman...

我想要一个管理 rspec、cucumber 和 jasmine 的保护文件 - 并且在这些测试运行时有漂亮的颜色输出。

工头似乎忽略了保护文件设置。知道如何改变吗?

【问题讨论】:

    标签: ruby-on-rails guard foreman


    【解决方案1】:

    将 --tty 选项添加到您的 rspec 保护 cli:

    guard "rspec", :version => 2, :cli => "--tty ...other options..."
    

    【讨论】:

    • 非常感谢!这很有帮助。事实证明,使用guard-rspec 仅使用--color 是不够的,您(至少我看到了)还必须指定--tty。这是在 OS X 上。
    【解决方案2】:

    对于guard-rspec 的 4.5.0 版,以下内容对我有用

    guard :rspec, cmd_additional_args: "--tty", cmd: ...other...
    

    【讨论】:

      【解决方案3】:

      编辑:更简单,在 Guardfile 中做

      guard :rspec, cmd: "rspec --force-color"
      
      # In case you do --profile and dot in regular .rspec, you may want to override further:
      guard :rspec, cmd: "rspec --force-color --no-profile --format documentation"
      

      /编辑

      我为此苦苦挣扎,并让它在 RSpec 3.8、rails 5.2 和 foreman 0.64 上运行

      必须完成两个配置才能使其工作。

      # In .rspec, add
      --color
      
      # In Guardfile, change to
      guard :rspec, cmd: "rspec --tty" do
      

      为什么需要 --color 和 tty 令人困惑,官方 rspec 文档说 tty 和 color 都是默认启用的。

      尾注:如果你在做这个,和工头一起跑卫,它告诉我很多关于你是什么样的开发人员。不多说了;)

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2017-09-20
        • 2014-03-08
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多