-
-
Notifications
You must be signed in to change notification settings - Fork 74
/
Rakefile
70 lines (53 loc) · 1.46 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
67
68
69
70
# -*- ruby -*-
require 'rubygems'
require 'hoe'
Hoe.add_include_dirs("../../ruby_parser/dev/lib",
"../../RubyInline/dev/lib",
"../../sexp_processor/dev/lib",
"../../ZenTest/dev/lib",
"../../path_expander/dev/lib",
"lib")
Hoe.plugin :seattlerb
Hoe.plugin :isolate
Hoe.plugin :rdoc
Hoe.plugin :bundler
Hoe.spec 'flog' do
developer 'Ryan Davis', '[email protected]'
self.flog_method = :max_method
self.flog_threshold = timebomb 150, 50, '2013-11-01', '2012-11-01'
license "MIT"
dependency "sexp_processor", "~> 4.8"
dependency "ruby_parser", ["~> 3.1", "> 3.1.0"]
dependency "path_expander", "~> 1.0"
dependency "minitest", "~> 5.0", :dev
end
task :debug do
require "flog_cli"
class FlogCLI
def_delegators :@flog, :flog_ruby
end
file = ENV["F"]
ruby = ENV["R"]
details = ENV["D"]
continue = ENV["C"]
flog = FlogCLI.new :parser => RubyParser
flog.option[:details] = true if details
flog.option[:continue] = true if continue
if file then
if File.directory? file then # quick hack to get directory scanning going
argv = [file]
argv.unshift "-v" if ENV["V"]
FlogCLI.run argv, flog.option
exit 0
end
flog.flog file
elsif ruby
flog.flog_ruby ruby, "-"
flog.calculate_total_scores
else
flog.flog
flog.calculate_total_scores
end
flog.report
end
# vim: syntax=ruby