-
Notifications
You must be signed in to change notification settings - Fork 0
/
.autotest
43 lines (38 loc) · 1.16 KB
/
.autotest
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
# for an introduction to autotest and the meaning of this file, see
# http://ph7spot.com/musings/getting-started-with-autotest
require 'autotest/restart'
require 'redgreen/autotest'
require 'autotest/fsevent'
require 'ruby-debug'
Autotest.add_hook :initialize do |autotest|
# filenames will look like "./.git" so note we can't use word boundaries
# to say something like \b\.git\b. It does use Find.prune so it will
# not descend into matched directory names.
regexp_patterns = [
%r|/.autotest$|,
%r|/bin$|,
%r|/.git$|,
%r|/.gitignore$|,
%r|.+\.gemspec$|,
%r|/coverage$|,
%r|.+\.md$|,
%r|.+\.opts$|,
%r|/pkg$|,
%r|/Rakefile\.rb$|,
%r|/.+\.txt$|,
%r|/tmp\..*|,
%r|/Thorfile|
]
regexp_patterns.each do |exception|
autotest.add_exception(exception)
end
autotest.clear_mappings # ! know what you are doing! read the source
autotest.add_mapping(/^lib\/(.*\.rb)$/) do |filename, md|
basename = File.basename md[1]
dirname = File.dirname md[1]
autotest.files_matching %r|^spec/#{dirname}/spec_#{basename}$|
end
autotest.add_mapping(%r|^spec/.*\bspec_.*rb$|) do |filename, _|
filename
end
end