mwilden-metric_fu 1.1.3 → 1.1.5
Sign up to get free protection for your applications and to get access to all the features.
- data/HISTORY +8 -0
- data/lib/base/configuration.rb +5 -1
- data/lib/generators/flog.rb +2 -6
- data/lib/generators/rcov.rb +8 -0
- data/vendor/saikuro/saikuro.rb +8 -3
- metadata +1 -1
data/HISTORY
CHANGED
data/lib/base/configuration.rb
CHANGED
@@ -129,7 +129,11 @@ module MetricFu
|
|
129
129
|
"--no-color",
|
130
130
|
"--profile",
|
131
131
|
"--rails",
|
132
|
-
"--exclude /gems/,/Library/,/usr/,spec"]
|
132
|
+
"--exclude /gems/,/Library/,/usr/,spec,features"],
|
133
|
+
:feature_files => ['features/*.feature'],
|
134
|
+
:cucumber_executable => '/usr/bin/cucumber',
|
135
|
+
:cucumber_opts => ["--format profile"]}
|
136
|
+
|
133
137
|
|
134
138
|
@graph_theme = { :colors => %w(orange purple green white red blue pink yellow),
|
135
139
|
:marker_color => 'blue',
|
data/lib/generators/flog.rb
CHANGED
@@ -3,12 +3,8 @@ module MetricFu
|
|
3
3
|
class Flog < Generator
|
4
4
|
attr_reader :pages
|
5
5
|
|
6
|
-
def self.flog_command
|
7
|
-
File.dirname(__FILE__) + '/../../vendor/flog/flog'
|
8
|
-
end
|
9
|
-
|
10
6
|
def self.verify_dependencies!
|
11
|
-
|
7
|
+
`flog --help`
|
12
8
|
raise 'sudo gem install flog # if you want the flog tasks' unless $?.success?
|
13
9
|
end
|
14
10
|
|
@@ -23,7 +19,7 @@ module MetricFu
|
|
23
19
|
output_dir = "#{metric_dir}/#{filename.split("/")[0..-2].join("/")}"
|
24
20
|
mkdir_p(output_dir, :verbose => false) unless File.directory?(output_dir)
|
25
21
|
if MetricFu::MD5Tracker.file_changed?(filename, metric_dir)
|
26
|
-
|
22
|
+
`flog -ad #{filename} > #{metric_dir}/#{filename.split('.')[0]}.txt`
|
27
23
|
end
|
28
24
|
end
|
29
25
|
end
|
data/lib/generators/rcov.rb
CHANGED
@@ -37,6 +37,14 @@ module MetricFu
|
|
37
37
|
rcov_opts = MetricFu.rcov[:rcov_opts].join(' ')
|
38
38
|
output = ">> #{MetricFu::Rcov.metric_directory}/rcov.txt"
|
39
39
|
`rcov #{test_files} #{rcov_opts} #{output}`
|
40
|
+
|
41
|
+
if MetricFu.rcov[:run_cucumber]
|
42
|
+
cucumber_opts = MetricFu.rcov[:cucumber_opts].join(' ')
|
43
|
+
cucumber_executable = MetricFu.rcov[:cucumber_executable]
|
44
|
+
feature_files = FileList[*MetricFu.rcov[:feature_files]].join(' ')
|
45
|
+
`rcov #{rcov_opts} #{cucumber_executable} -- #{cucumber_opts} #{feature_files} #{output}`
|
46
|
+
end
|
47
|
+
|
40
48
|
rescue LoadError
|
41
49
|
if RUBY_PLATFORM =~ /java/
|
42
50
|
puts 'running in jruby - rcov tasks not available'
|
data/vendor/saikuro/saikuro.rb
CHANGED
@@ -1105,9 +1105,14 @@ if __FILE__ == $0
|
|
1105
1105
|
require 'getoptlong'
|
1106
1106
|
require 'fileutils'
|
1107
1107
|
require 'find'
|
1108
|
-
|
1109
|
-
|
1110
|
-
|
1108
|
+
begin
|
1109
|
+
require 'rdoc/ri/ri_paths'
|
1110
|
+
require 'rdoc/usage'
|
1111
|
+
rescue LoadError
|
1112
|
+
# these requires cause problems in Ruby 1.9x that I'm not really sure how to fix
|
1113
|
+
require 'rdoc/ri/paths'
|
1114
|
+
#Still not sure what the equivalent of rdoc/usage is. I know it has been removed from 1.9
|
1115
|
+
end
|
1111
1116
|
include ResultIndexGenerator
|
1112
1117
|
|
1113
1118
|
#Returns the path without the file
|