forked from emjei/flay
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
60 lines (46 loc) · 1.3 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
# -*- ruby -*-
require "rubygems"
require "hoe"
Hoe::add_include_dirs("../../sexp_processor/dev/lib",
"../../ruby_parser/dev/lib",
"../../ruby2ruby/dev/lib",
"../../ZenTest/dev/lib",
"lib")
Hoe.plugin :seattlerb
Hoe.plugin :isolate
Hoe.plugin :bundler
Hoe.spec "flay" do
developer "Ryan Davis", "[email protected]"
license "MIT"
dependency "sexp_processor", "~> 4.0"
dependency "ruby_parser", "~> 3.0"
dependency "erubis", "~> 2.7.0"
dependency "minitest", "~> 5.8.0", :dev
dependency "ruby2ruby", "~> 2.2.0", :dev
self.flay_threshold = 250
end
task :debug => :isolate do
require "flay"
file = ENV["F"]
mass = ENV["M"]
diff = ENV["D"]
libr = ENV["L"]
ver = ENV["V"]
opts = Flay.parse_options
opts[:mass] = mass.to_i if mass
opts[:diff] = diff.to_i if diff
opts[:liberal] = true if libr
opts[:verbose] = true if ver
flay = Flay.new opts
flay.process(*Flay.expand_dirs_to_files(file))
flay.report
end
task :run do
file = ENV["F"]
fuzz = ENV["Z"] && "-f #{ENV["Z"]}"
mass = ENV["M"] && "-m #{ENV["M"]}"
diff = ENV["D"] && "-d"
libr = ENV["L"] && "-l"
ruby "#{Hoe::RUBY_FLAGS} bin/flay #{mass} #{fuzz} #{diff} #{libr} #{file}"
end
# vim: syntax=ruby