forked from seattlerb/debride
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRakefile
66 lines (48 loc) · 1.53 KB
/
Rakefile
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# -*- ruby -*-
require "rubygems"
require "hoe"
Hoe::add_include_dirs("../../sexp_processor/dev/lib",
"../../ruby_parser/dev/lib",
"../../ruby2ruby/dev/lib",
"../../ZenTest/dev/lib",
"../../debride-erb/dev/lib",
"../../path_expander/dev/lib",
"lib")
Hoe.plugin :isolate
Hoe.plugin :seattlerb
Hoe.plugin :rdoc
Hoe.plugin :cov
Hoe.spec "debride" do
developer "Ryan Davis", "[email protected]"
license "MIT"
dependency "sexp_processor", "~> 4.17"
dependency "ruby_parser", "~> 3.20"
dependency "path_expander", "~> 1.0"
end
def run dir, whitelist
abort "Specify dir to scan with D=<path>" unless dir
ENV["GEM_HOME"] = "tmp/isolate"
ENV["GEM_PATH"] = "#{Gem.paths.path.join ":"}:../../debride-erb/dev/tmp/isolate"
Gem.paths = ENV
whitelist = whitelist && ["--whitelist", whitelist]
verbose = ENV["V"] && "-v"
exclude = ENV["E"] && ["--exclude", ENV["E"]]
minimum = ENV["M"] && ["--minimum", ENV["M"]]
require "debride"
args = ["--rails", verbose, minimum, whitelist, exclude, dir].flatten.compact
Debride.run(args).report
end
task :run => :isolate do
run ENV["D"], ENV["W"]
end
task :rails => :isolate do
ENV["GEM_HOME"] = "tmp/isolate/ruby-2.0.0"
ENV["GEM_PATH"] = "../../debride-erb/dev/tmp/isolate/ruby-2.0.0"
d = File.expand_path "~/Work/git/seattlerb.org"
run d, "#{d}/whitelist.txt"
end
task :debug do
f = ENV["F"]
run f, nil
end
# vim: syntax=ruby