metric_fu 4.4.3 → 4.4.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.metrics +1 -0
- data/CONTRIBUTORS +1 -0
- data/HISTORY.md +10 -1
- data/README.md +1 -0
- data/checksum/metric_fu-4.4.3.gem.sha512 +1 -0
- data/lib/metric_fu/io.rb +12 -4
- data/lib/metric_fu/metrics/generator.rb +2 -2
- data/lib/metric_fu/metrics/rcov/rcov.rb +27 -10
- data/lib/metric_fu/metrics/rcov/rcov_hotspot.rb +1 -1
- data/lib/metric_fu/reporting/templates/awesome/awesome_template.rb +0 -1
- data/lib/metric_fu/utility.rb +7 -0
- data/lib/metric_fu/version.rb +1 -1
- data/spec/metric_fu/configuration_spec.rb +37 -24
- data/spec/metric_fu/metrics/generator_spec.rb +2 -3
- data/spec/metric_fu/metrics/rcov/rcov_hotspot_spec.rb +17 -0
- data/spec/metric_fu/metrics/rcov/rcov_spec.rb +24 -19
- data/spec/spec_helper.rb +3 -3
- data/spec/support/suite.rb +14 -23
- metadata +5 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 8e516022008f58e6b2c1a6b80630159b8781a1ba
|
|
4
|
+
data.tar.gz: 4bdeda9dc9ce45911a0f8bd7685b02b5d2a0b84b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ca89e540f54237b18a66282491c3b2e46b5837c9619a9682b8d5e82a2c434f8dd793752d39e9464a94efdb8c2c0eb465d24a56e0bc84287ac6fe1de9ed78b5fd
|
|
7
|
+
data.tar.gz: 3a339a545cf614a37cfe8b963705e56bc28ffb73c100a4e6ea1b33fc610c9fafdca2f56b8ff5c6d23db4c8f0b6b037712bbb86bbdeed58222759c63e9c1a9e4f
|
data/.metrics
CHANGED
data/CONTRIBUTORS
CHANGED
data/HISTORY.md
CHANGED
|
@@ -10,7 +10,16 @@ As such, a _Feature_ would map to either major or minor. A _bug fix_ to a patch.
|
|
|
10
10
|
* Fixes
|
|
11
11
|
* Misc
|
|
12
12
|
|
|
13
|
-
### MetricFu [4.4.
|
|
13
|
+
### MetricFu [4.4.4 / 2013-09-27](https://github.com/metricfu/metric_fu/compare/v4.4.3...v4.4.4)
|
|
14
|
+
|
|
15
|
+
* Features
|
|
16
|
+
* Fixes
|
|
17
|
+
* Update rcov config instructions in README to include call to activate (Carlos Fernandez, #145)
|
|
18
|
+
* rcov hotspot analyzer (MetricFu::RcovHotspot) now overrides map_strategy instead of map (Carlos Fernandez, #145)
|
|
19
|
+
* Fix test failures relating to artifact directory missing (Benjamin Fleischer, #144)
|
|
20
|
+
* Misc
|
|
21
|
+
|
|
22
|
+
### MetricFu [4.4.3 / 2013-09-25](https://github.com/metricfu/metric_fu/compare/v4.4.2...v4.4.3)
|
|
14
23
|
|
|
15
24
|
* Features
|
|
16
25
|
* Fixes
|
data/README.md
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
6d7c86a7231183dc5cf3d13b03fa4174873ffa6202d0b3fa09b485acc0e076951d6c906a99816fa9908fed75fa513cfba1ce29fb3911f881a93fb0922a70ff8f
|
data/lib/metric_fu/io.rb
CHANGED
|
@@ -1,13 +1,21 @@
|
|
|
1
|
-
|
|
1
|
+
MetricFu.lib_require { 'utility' }
|
|
2
2
|
module MetricFu
|
|
3
3
|
module Io
|
|
4
4
|
# TODO: Move this module / functionality elsewhere and make less verbose
|
|
5
5
|
module FileSystem
|
|
6
6
|
|
|
7
7
|
# TODO: Use a better environmental variable name for the output / artiface dir. Set to a different default in tests.
|
|
8
|
+
@default_artifact_dir = 'tmp/metric_fu'
|
|
9
|
+
def self.default_artifact_dir
|
|
10
|
+
@default_artifact_dir
|
|
11
|
+
end
|
|
8
12
|
def self.artifact_dir
|
|
9
|
-
(ENV['CC_BUILD_ARTIFACTS'] ||
|
|
13
|
+
(ENV['CC_BUILD_ARTIFACTS'] || @artifact_dir)
|
|
14
|
+
end
|
|
15
|
+
def self.artifact_dir=(artifact_dir)
|
|
16
|
+
@artifact_dir = artifact_dir
|
|
10
17
|
end
|
|
18
|
+
self.artifact_dir = default_artifact_dir
|
|
11
19
|
|
|
12
20
|
module_function
|
|
13
21
|
|
|
@@ -46,7 +54,7 @@ module MetricFu
|
|
|
46
54
|
# due to behavior differences between ruby 1.8.7 and 1.9.3
|
|
47
55
|
# this is good enough for now
|
|
48
56
|
Array(*dirs).each do |dir|
|
|
49
|
-
|
|
57
|
+
MetricFu::Utility.mkdir_p dir
|
|
50
58
|
end
|
|
51
59
|
end
|
|
52
60
|
|
|
@@ -114,7 +122,7 @@ module MetricFu
|
|
|
114
122
|
def dir_for(path)
|
|
115
123
|
return nil if path.nil?
|
|
116
124
|
pathname = path_relative_to_base(path)
|
|
117
|
-
|
|
125
|
+
MetricFu::Utility.mkdir_p(pathname) unless File.directory?(pathname)
|
|
118
126
|
pathname
|
|
119
127
|
end
|
|
120
128
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
MetricFu.lib_require { 'utility' }
|
|
2
2
|
module MetricFu
|
|
3
3
|
|
|
4
4
|
# = Generator
|
|
@@ -58,7 +58,7 @@ module MetricFu
|
|
|
58
58
|
MetricFu::Metric.get_metric(metric).run_options[:output_directory] ||
|
|
59
59
|
begin
|
|
60
60
|
metric_directory = MetricFu::Io::FileSystem.scratch_directory(metric)
|
|
61
|
-
|
|
61
|
+
MetricFu::Utility.mkdir_p(metric_directory, :verbose => false)
|
|
62
62
|
end
|
|
63
63
|
end
|
|
64
64
|
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
require 'fileutils'
|
|
1
|
+
MetricFu.lib_require { 'utility' }
|
|
3
2
|
|
|
4
3
|
module MetricFu
|
|
5
4
|
|
|
6
|
-
class RcovGenerator < Generator
|
|
5
|
+
class RcovGenerator < MetricFu::Generator
|
|
7
6
|
NEW_FILE_MARKER = /^={80}$/.freeze
|
|
8
7
|
|
|
9
8
|
def self.metric
|
|
@@ -39,19 +38,20 @@ module MetricFu
|
|
|
39
38
|
@command = command
|
|
40
39
|
end
|
|
41
40
|
|
|
41
|
+
def reset_output_location
|
|
42
|
+
MetricFu::Utility.rm_rf(metric_directory, :verbose => false)
|
|
43
|
+
MetricFu::Utility.mkdir_p(metric_directory)
|
|
44
|
+
end
|
|
45
|
+
|
|
42
46
|
def default_command
|
|
43
|
-
|
|
44
|
-
Dir.mkdir(MetricFu::RcovGenerator.metric_directory)
|
|
45
|
-
output = ">> #{MetricFu::RcovGenerator.metric_directory}/rcov.txt"
|
|
47
|
+
reset_output_location
|
|
46
48
|
test_files = FileList[*options[:test_files]].join(' ')
|
|
47
49
|
rcov_opts = options[:rcov_opts].join(' ')
|
|
48
|
-
%Q(RAILS_ENV=#{options[:environment]} rcov #{test_files} #{rcov_opts} #{
|
|
50
|
+
%Q(RAILS_ENV=#{options[:environment]} rcov #{test_files} #{rcov_opts} >> #{default_output_file})
|
|
49
51
|
end
|
|
50
52
|
|
|
51
|
-
|
|
52
53
|
def analyze
|
|
53
|
-
|
|
54
|
-
output = File.open(output_file).read
|
|
54
|
+
output = load_output
|
|
55
55
|
output = output.split(NEW_FILE_MARKER)
|
|
56
56
|
|
|
57
57
|
output.shift # Throw away the first entry - it's the execution time etc.
|
|
@@ -140,5 +140,22 @@ module MetricFu
|
|
|
140
140
|
!(options[:external])
|
|
141
141
|
end
|
|
142
142
|
|
|
143
|
+
def load_output
|
|
144
|
+
File.read(output_file)
|
|
145
|
+
end
|
|
146
|
+
|
|
147
|
+
def output_file
|
|
148
|
+
if run_rcov?
|
|
149
|
+
default_output_file
|
|
150
|
+
else
|
|
151
|
+
options.fetch(:external)
|
|
152
|
+
end
|
|
153
|
+
end
|
|
154
|
+
|
|
155
|
+
def default_output_file
|
|
156
|
+
File.join(metric_directory, 'rcov.txt')
|
|
157
|
+
end
|
|
158
|
+
|
|
159
|
+
|
|
143
160
|
end
|
|
144
161
|
end
|
data/lib/metric_fu/utility.rb
CHANGED
data/lib/metric_fu/version.rb
CHANGED
|
@@ -45,17 +45,52 @@ describe MetricFu::Configuration do
|
|
|
45
45
|
load File.join(MetricFu.metrics_dir, metric, 'init.rb')
|
|
46
46
|
end
|
|
47
47
|
|
|
48
|
+
describe '#is_cruise_control_rb? ' do
|
|
49
|
+
|
|
50
|
+
before(:each) { get_new_config }
|
|
51
|
+
describe "when the CC_BUILD_ARTIFACTS env var is not nil" do
|
|
52
|
+
|
|
53
|
+
before(:each) do
|
|
54
|
+
ENV['CC_BUILD_ARTIFACTS'] = 'is set'
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
it 'should return true' do
|
|
58
|
+
@config.is_cruise_control_rb?.should be_true
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
after(:each) do
|
|
62
|
+
ENV['CC_BUILD_ARTIFACTS'] = nil
|
|
63
|
+
FileUtils.rm_rf(File.join(MetricFu.root_dir, 'is set'))
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
end
|
|
67
|
+
|
|
68
|
+
describe "when the CC_BUILD_ARTIFACTS env var is nil" do
|
|
69
|
+
before(:each) { ENV['CC_BUILD_ARTIFACTS'] = nil }
|
|
70
|
+
|
|
71
|
+
it 'should return false' do
|
|
72
|
+
@config.is_cruise_control_rb?.should be_false
|
|
73
|
+
end
|
|
74
|
+
end
|
|
75
|
+
end
|
|
76
|
+
|
|
48
77
|
describe "#reset" do
|
|
49
78
|
|
|
50
79
|
describe 'when there is a CC_BUILD_ARTIFACTS environment variable' do
|
|
51
80
|
|
|
52
|
-
|
|
81
|
+
before do
|
|
53
82
|
ENV['CC_BUILD_ARTIFACTS'] = 'foo'
|
|
54
83
|
@config = MetricFu.configuration
|
|
55
84
|
@config.reset
|
|
56
85
|
MetricFu.configure
|
|
86
|
+
end
|
|
87
|
+
it 'should return the CC_BUILD_ARTIFACTS environment variable' do
|
|
57
88
|
compare_paths(base_directory, ENV['CC_BUILD_ARTIFACTS'])
|
|
58
89
|
end
|
|
90
|
+
after do
|
|
91
|
+
ENV['CC_BUILD_ARTIFACTS'] = nil
|
|
92
|
+
FileUtils.rm_rf(File.join(MetricFu.root_dir, 'foo'))
|
|
93
|
+
end
|
|
59
94
|
end
|
|
60
95
|
|
|
61
96
|
describe 'when there is no CC_BUILD_ARTIFACTS environment variable' do
|
|
@@ -65,7 +100,7 @@ describe MetricFu::Configuration do
|
|
|
65
100
|
get_new_config
|
|
66
101
|
end
|
|
67
102
|
it 'should return "tmp/metric_fu"' do
|
|
68
|
-
base_directory.should ==
|
|
103
|
+
base_directory.should == MetricFu.artifact_dir
|
|
69
104
|
end
|
|
70
105
|
|
|
71
106
|
it 'should set @metric_fu_root_directory to the base of the '+
|
|
@@ -256,28 +291,6 @@ describe MetricFu::Configuration do
|
|
|
256
291
|
end
|
|
257
292
|
end
|
|
258
293
|
|
|
259
|
-
describe '#is_cruise_control_rb? ' do
|
|
260
|
-
|
|
261
|
-
before(:each) { get_new_config }
|
|
262
|
-
describe "when the CC_BUILD_ARTIFACTS env var is not nil" do
|
|
263
|
-
|
|
264
|
-
before(:each) { ENV['CC_BUILD_ARTIFACTS'] = 'is set' }
|
|
265
|
-
|
|
266
|
-
it 'should return true' do
|
|
267
|
-
@config.is_cruise_control_rb?.should be_true
|
|
268
|
-
end
|
|
269
|
-
|
|
270
|
-
end
|
|
271
|
-
|
|
272
|
-
describe "when the CC_BUILD_ARTIFACTS env var is nil" do
|
|
273
|
-
before(:each) { ENV['CC_BUILD_ARTIFACTS'] = nil }
|
|
274
|
-
|
|
275
|
-
it 'should return false' do
|
|
276
|
-
@config.is_cruise_control_rb?.should be_false
|
|
277
|
-
end
|
|
278
|
-
end
|
|
279
|
-
end
|
|
280
|
-
|
|
281
294
|
describe '#configure_formatter' do
|
|
282
295
|
before(:each) { get_new_config }
|
|
283
296
|
|
|
@@ -28,12 +28,11 @@ describe MetricFu::Generator do
|
|
|
28
28
|
end
|
|
29
29
|
|
|
30
30
|
describe "ConcreteClass#metric_directory" do
|
|
31
|
-
it "should be '
|
|
31
|
+
it "should be '{artifact_dir}/scratch/concreteclass'" do
|
|
32
32
|
concrete_metric = double('concrete_metric')
|
|
33
33
|
MetricFu::Metric.should_receive(:get_metric).with(:concrete).and_return(concrete_metric)
|
|
34
34
|
concrete_metric.should_receive(:run_options).and_return({})
|
|
35
|
-
compare_paths(ConcreteClass.metric_directory,
|
|
36
|
-
"tmp/metric_fu/scratch/concrete")
|
|
35
|
+
compare_paths(ConcreteClass.metric_directory, scratch_directory('concrete'))
|
|
37
36
|
end
|
|
38
37
|
end
|
|
39
38
|
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
require "spec_helper"
|
|
2
|
+
require "metric_fu/metrics/hotspots/analysis/record"
|
|
3
|
+
|
|
4
|
+
describe MetricFu::RcovHotspot do
|
|
5
|
+
describe "map" do
|
|
6
|
+
let(:zero_row) do
|
|
7
|
+
MetricFu::Record.new({"percentage_uncovered"=>0.0}, nil)
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
let(:non_zero_row) do
|
|
11
|
+
MetricFu::Record.new({"percentage_uncovered"=>0.75}, nil)
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
it {subject.map(zero_row).should eql(0.0)}
|
|
15
|
+
it {subject.map(non_zero_row).should eql(0.75)}
|
|
16
|
+
end
|
|
17
|
+
end
|
|
@@ -2,10 +2,16 @@ require "spec_helper"
|
|
|
2
2
|
|
|
3
3
|
describe MetricFu::RcovGenerator do
|
|
4
4
|
|
|
5
|
-
before
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
before do
|
|
6
|
+
setup_fs
|
|
7
|
+
MetricFu::Configuration.run do |config|
|
|
8
|
+
config.configure_metric(:rcov) do |rcov|
|
|
9
|
+
rcov.enabled = true
|
|
10
|
+
end
|
|
8
11
|
end
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
before :each do
|
|
9
15
|
@default_options = MetricFu::Metric.get_metric(:rcov).run_options
|
|
10
16
|
end
|
|
11
17
|
|
|
@@ -16,20 +22,19 @@ describe MetricFu::RcovGenerator do
|
|
|
16
22
|
end
|
|
17
23
|
|
|
18
24
|
it "should clear out previous output and make output folder" do
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
@rcov.emit
|
|
25
|
+
MetricFu::Utility.should_receive(:rm_rf).with(MetricFu::RcovGenerator.metric_directory, :verbose => false)
|
|
26
|
+
MetricFu::Utility.should_receive(:mkdir_p).with(MetricFu::RcovGenerator.metric_directory)
|
|
27
|
+
@rcov.reset_output_location
|
|
23
28
|
end
|
|
24
29
|
|
|
25
30
|
it "should set the RAILS_ENV" do
|
|
31
|
+
pending "Making this work with FakeFs"
|
|
26
32
|
next if breaks_when?(MetricFu.configuration.rubinius?)
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
options = {:environment => 'metrics'}
|
|
33
|
+
MetricFu::Utility.should_receive(:rm_rf).with(MetricFu::RcovGenerator.metric_directory, :verbose => false)
|
|
34
|
+
MetricFu::Utility.should_receive(:mkdir_p).with(MetricFu::RcovGenerator.metric_directory)
|
|
35
|
+
options = {:environment => 'metrics', :external => nil}
|
|
30
36
|
@rcov = MetricFu::RcovGenerator.new(@default_options.merge(options))
|
|
31
|
-
@rcov.
|
|
32
|
-
@rcov.emit
|
|
37
|
+
expect(@rcov.command).to include('RAILS_ENV=metrics')
|
|
33
38
|
end
|
|
34
39
|
end
|
|
35
40
|
|
|
@@ -38,9 +43,7 @@ describe MetricFu::RcovGenerator do
|
|
|
38
43
|
before :each do
|
|
39
44
|
options = {:external => nil}
|
|
40
45
|
@rcov = MetricFu::RcovGenerator.new(@default_options.merge(options))
|
|
41
|
-
|
|
42
|
-
with(MetricFu::RcovGenerator.metric_directory + '/rcov.txt').
|
|
43
|
-
and_return(double("io", :read => RCOV_OUTPUT))
|
|
46
|
+
@rcov.should_receive(:load_output).and_return(RCOV_OUTPUT)
|
|
44
47
|
@files = @rcov.analyze
|
|
45
48
|
end
|
|
46
49
|
|
|
@@ -74,14 +77,12 @@ describe MetricFu::RcovGenerator do
|
|
|
74
77
|
end
|
|
75
78
|
|
|
76
79
|
it "should emit nothing if external configuration option is set" do
|
|
77
|
-
|
|
80
|
+
MetricFu::Utility.should_not_receive(:rm_rf)
|
|
78
81
|
@rcov.emit
|
|
79
82
|
end
|
|
80
83
|
|
|
81
84
|
it "should open the external rcov analysis file" do
|
|
82
|
-
|
|
83
|
-
with('coverage/rcov.txt').
|
|
84
|
-
and_return(double("io", :read => RCOV_OUTPUT))
|
|
85
|
+
@rcov.should_receive(:load_output).and_return(RCOV_OUTPUT)
|
|
85
86
|
@files = @rcov.analyze
|
|
86
87
|
end
|
|
87
88
|
|
|
@@ -179,4 +180,8 @@ lib/templates/standard/standard_template.rb
|
|
|
179
180
|
|
|
180
181
|
HERE
|
|
181
182
|
|
|
183
|
+
after do
|
|
184
|
+
cleanup_fs
|
|
185
|
+
end
|
|
186
|
+
|
|
182
187
|
end
|
data/spec/spec_helper.rb
CHANGED
|
@@ -22,13 +22,13 @@ Dir[MetricFu.root_dir + "/spec/support/**/*.rb"].each {|f| require f}
|
|
|
22
22
|
|
|
23
23
|
RSpec.configure do |config|
|
|
24
24
|
# :suite after/before all specs
|
|
25
|
-
# :each
|
|
26
|
-
# :all
|
|
25
|
+
# :each every describe block
|
|
26
|
+
# :all every it block
|
|
27
27
|
|
|
28
28
|
config.order = 'random'
|
|
29
29
|
|
|
30
30
|
config.after(:suite) do
|
|
31
|
-
|
|
31
|
+
cleanup_fs
|
|
32
32
|
end
|
|
33
33
|
|
|
34
34
|
config.after(:each) do
|
data/spec/support/suite.rb
CHANGED
|
@@ -1,13 +1,10 @@
|
|
|
1
|
+
require 'fileutils'
|
|
1
2
|
def directory(name)
|
|
2
3
|
MetricFu::Io::FileSystem.directory(name)
|
|
3
4
|
end
|
|
4
5
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
FileUtils.rm_rf(Dir["#{MetricFu.root_dir}/foo"])
|
|
8
|
-
FileUtils.rm_rf(Dir["#{MetricFu.root_dir}/is set"])
|
|
9
|
-
rescue => e
|
|
10
|
-
mf_debug "Failed cleaning up test files #{e.inspect}"
|
|
6
|
+
def scratch_directory(name)
|
|
7
|
+
File.join(MetricFu::Io::FileSystem.artifact_dir, 'scratch', name)
|
|
11
8
|
end
|
|
12
9
|
|
|
13
10
|
# fakefs doesn't seem to work reliably on non-mri rubies
|
|
@@ -20,23 +17,22 @@ rescue NameError, LoadError
|
|
|
20
17
|
false
|
|
21
18
|
end
|
|
22
19
|
|
|
20
|
+
def artifact_test_dir
|
|
21
|
+
@artficat_test_dir ||= File.join(MetricFu::APP_ROOT, 'tmp','metric_fu','test')
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
MetricFu::Io::FileSystem.artifact_dir = artifact_test_dir
|
|
25
|
+
MetricFu::Io::FileSystem.set_directories
|
|
26
|
+
|
|
23
27
|
def setup_fs
|
|
28
|
+
# # Let's shift the output directories so that we don't interfere with
|
|
29
|
+
# # existing historical metric data.
|
|
24
30
|
if using_fake_filesystem
|
|
25
31
|
FakeFS.activate!
|
|
26
32
|
FakeFS::FileSystem.clone('lib')
|
|
27
33
|
FakeFS::FileSystem.clone('.metrics')
|
|
28
|
-
FileUtils.mkdir_p(Pathname.pwd.join(directory('base_directory')))
|
|
29
|
-
FileUtils.mkdir_p(Pathname.pwd.join(directory('output_directory')))
|
|
30
|
-
else
|
|
31
|
-
# Have to use the file system, so let's shift the
|
|
32
|
-
# output directories so that we don't interfere with
|
|
33
|
-
# existing historical metric data.
|
|
34
|
-
MetricFu::Io::FileSystem.stub(:directory).with('base_directory').and_return("tmp/metric_fu/test")
|
|
35
|
-
MetricFu::Io::FileSystem.stub(:directory).with('output_directory').and_return("tmp/metric_fu/test/output")
|
|
36
|
-
MetricFu::Io::FileSystem.stub(:directory).with('data_directory').and_return("tmp/metric_fu/test/_data")
|
|
37
|
-
MetricFu::Io::FileSystem.stub(:directory).with('code_dirs').and_return(%w(lib))
|
|
38
|
-
MetricFu::Io::FileSystem.stub(:directory).with('scratch_directory').and_return('tmp/metric_fu/test/scratch')
|
|
39
34
|
end
|
|
35
|
+
MetricFu::Io::FileSystem.set_directories
|
|
40
36
|
end
|
|
41
37
|
|
|
42
38
|
def cleanup_fs
|
|
@@ -45,11 +41,6 @@ def cleanup_fs
|
|
|
45
41
|
FakeFS.deactivate!
|
|
46
42
|
else
|
|
47
43
|
# Not ideal, but workaround for non-mri rubies
|
|
48
|
-
FileUtils.rm_rf(
|
|
49
|
-
FileUtils.rm_rf(Dir.glob("#{directory('output_directory')}/*.html"))
|
|
50
|
-
FileUtils.rm_rf(Dir.glob("#{directory('output_directory')}/*.js"))
|
|
51
|
-
FileUtils.rm_rf("#{directory('data_directory')}/#{Time.now.strftime("%Y%m%d")}.yml")
|
|
52
|
-
FileUtils.rm_rf(Dir["#{directory('base_directory')}/customdir"])
|
|
53
|
-
FileUtils.rm_rf("#{directory('base_directory')}/customreport.yml")
|
|
44
|
+
FileUtils.rm_rf(artifact_test_dir)
|
|
54
45
|
end
|
|
55
46
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: metric_fu
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 4.4.
|
|
4
|
+
version: 4.4.4
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Jake Scruggs
|
|
@@ -19,7 +19,7 @@ authors:
|
|
|
19
19
|
autorequire:
|
|
20
20
|
bindir: bin
|
|
21
21
|
cert_chain: []
|
|
22
|
-
date: 2013-09-
|
|
22
|
+
date: 2013-09-27 00:00:00.000000000 Z
|
|
23
23
|
dependencies:
|
|
24
24
|
- !ruby/object:Gem::Dependency
|
|
25
25
|
name: flay
|
|
@@ -280,6 +280,7 @@ files:
|
|
|
280
280
|
- checksum/metric_fu-4.4.0.gem.sha512
|
|
281
281
|
- checksum/metric_fu-4.4.1.gem.sha512
|
|
282
282
|
- checksum/metric_fu-4.4.2.gem.sha512
|
|
283
|
+
- checksum/metric_fu-4.4.3.gem.sha512
|
|
283
284
|
- config/roodi_config.yml
|
|
284
285
|
- gem_tasks/build.rake
|
|
285
286
|
- gemfiles/Gemfile.travis
|
|
@@ -440,6 +441,7 @@ files:
|
|
|
440
441
|
- spec/metric_fu/metrics/rails_best_practices/rails_best_practices_grapher_spec.rb
|
|
441
442
|
- spec/metric_fu/metrics/rails_best_practices/rails_best_practices_spec.rb
|
|
442
443
|
- spec/metric_fu/metrics/rcov/rcov_grapher_spec.rb
|
|
444
|
+
- spec/metric_fu/metrics/rcov/rcov_hotspot_spec.rb
|
|
443
445
|
- spec/metric_fu/metrics/rcov/rcov_spec.rb
|
|
444
446
|
- spec/metric_fu/metrics/reek/reek_grapher_spec.rb
|
|
445
447
|
- spec/metric_fu/metrics/reek/reek_spec.rb
|
|
@@ -532,6 +534,7 @@ test_files:
|
|
|
532
534
|
- spec/metric_fu/metrics/rails_best_practices/rails_best_practices_grapher_spec.rb
|
|
533
535
|
- spec/metric_fu/metrics/rails_best_practices/rails_best_practices_spec.rb
|
|
534
536
|
- spec/metric_fu/metrics/rcov/rcov_grapher_spec.rb
|
|
537
|
+
- spec/metric_fu/metrics/rcov/rcov_hotspot_spec.rb
|
|
535
538
|
- spec/metric_fu/metrics/rcov/rcov_spec.rb
|
|
536
539
|
- spec/metric_fu/metrics/reek/reek_grapher_spec.rb
|
|
537
540
|
- spec/metric_fu/metrics/reek/reek_spec.rb
|