File: Guardfile

package info (click to toggle)
ruby-guard 2.18.1-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,344 kB
  • sloc: ruby: 9,256; makefile: 6
file content (51 lines) | stat: -rw-r--r-- 1,553 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
scope(groups: %w(specs))

directories %w(spec lib config features man)

watch ("config/Guardfile") { UI.info "Exiting guard because config changed"; exit 0 }

group :specs, halt_on_fail: true do
  guard :rspec, cmd: "bundle exec rspec", failed_mode: :keep do
    require "guard/rspec/dsl"
    dsl = Guard::RSpec::Dsl.new(self)

    # Feel free to open issues for suggestions and improvements

    # RSpec files
    rspec = dsl.rspec
    watch(rspec.spec_helper) { rspec.spec_dir }
    watch(rspec.spec_support) { rspec.spec_dir }
    watch(rspec.spec_files)

    # Ruby files
    ruby = dsl.ruby
    dsl.watch_spec_files_for(ruby.lib_files)

    #  watch("lib/guard/notifier.rb")           { "spec/guard/notifiers" }
    #  watch("lib/guard/interactor.rb")         { "spec/guard/commands" }
    #  watch(%r{^lib/guard/(guard|plugin).rb$}) { "spec/guard/plugin" }
  end

  guard :rubocop, all_on_start: false, cli: "--rails -c .rubocop.yml" do
    watch(%r{.+\.rb$}) { |m| m[0] }
    watch(%r{(?:.+/)?\.rubocop\.yml$}) { |m| File.dirname(m[0]) }
  end

  guard "cucumber", keep_failed: true, all_on_start: false, cmd_additional_args: '--profile guard' do
    watch(%r{^features/.+\.feature$})
    watch(%r{^features/support/.+$})          { "features" }
    watch(%r{^features/step_definitions/(.+)_steps\.rb$}) do |m|
      Dir[File.join("**/#{m[1]}.feature")][0] || "features"
    end
  end
end

if !defined?(JRUBY_VERSION)
  if ENV["CI"] != "true"
    group :docs do
      guard :ronn do
        watch(%r{^man/.+\.ronn?$})
      end
    end
  end
end