Sha256: 0f7d42d753bf2e778f0e67f0f67b081dce03e8daa77a1b65271cf4e8b9dfa378
Contents?: true
Size: 1.61 KB
Versions: 9
Compression:
Stored size: 1.61 KB
Contents
# encoding: UTF-8 # frozen_string_literal: true # A sample Guardfile # More info at https://github.com/guard/guard#readme ## Uncomment and set this to only include directories you want to watch directories %w(lib lib/software_challenge_client spec) # the following seems to cause problems in certain ruby versions: # directories %w(lib lib/software_challenge_client spec).select do |d| # Dir.exist?(d) ? d : UI.warning("Directory #{d} does not exist") # end ## Note: if you are using the `directories` clause above and you are not ## watching the project directory ('.'), then you will want to move ## the Guardfile to a watched dir and symlink it back, e.g. # # $ mkdir config # $ mv Guardfile config/ # $ ln -s config/Guardfile . # # and, you'll have to watch "config/Guardfile" instead of "Guardfile" # This group allows to skip running RuboCop when RSpec failed. group :red_green_refactor, halt_on_fail: true do guard :rspec, cmd: 'rspec', all_after_pass: true, all_on_start: true do watch(%r{^lib/software_challenge_client/(.+)\.rb$}) do |match| spec_file = "spec/#{match[1]}_spec.rb" if File.exist?(spec_file) spec_file # run spec belonging to the file which was changed else 'spec' # run all specs end end watch(%r{^spec/.+_spec\.rb$}) # no block means the matched file is returned watch('lib/software_challenge_client.rb') { 'spec' } watch('spec/spec_helper.rb') { 'spec' } end # guard :rubocop, all_on_start: false do # # This never includes external ruby files because of the # # directory constraint at the top of this file: # watch(/.*.rb/) # end end
Version data entries
9 entries across 9 versions & 1 rubygems