p8-metric_fu 0.8.4.11 → 0.8.4.12

Sign up to get free protection for your applications and to get access to all the features.
data/Manifest.txt CHANGED
@@ -7,14 +7,11 @@ Rakefile
7
7
  README
8
8
  TODO.txt
9
9
  lib/metric_fu.rb
10
+ lib/metric_fu/base.rb
11
+ lib/metric_fu/churn.rb
12
+ lib/metric_fu/flay_reporter.rb
10
13
  lib/metric_fu/flog_reporter.rb
11
14
  lib/metric_fu/md5_tracker.rb
12
- lib/metric_fu/flog_reporter/base.rb
13
- lib/metric_fu/flog_reporter/flog_reporter.css
14
- lib/metric_fu/flog_reporter/generator.rb
15
- lib/metric_fu/flog_reporter/operator.rb
16
- lib/metric_fu/flog_reporter/page.rb
17
- lib/metric_fu/flog_reporter/scanned_method.rb
18
15
  lib/metric_fu/saikuro/saikuro.rb
19
16
  lib/metric_fu/saikuro/SAIKURO_README
20
17
  lib/tasks/churn.rake
data/Rakefile CHANGED
@@ -9,6 +9,7 @@ Spec::Rake::SpecTask.new(:spec) do |t|
9
9
  end
10
10
 
11
11
  MetricFu::Configuration.run do |config|
12
- config.metrics = [:flog]
12
+ config.metrics = [:coverage, :flog, :flay]
13
+ config.open_in_browser = false
13
14
  end
14
15
  task :default => [:"metrics:all"]
@@ -90,7 +90,7 @@ module MetricFu
90
90
  end
91
91
 
92
92
  def path
93
- File.basename(filename, ".txt") + '.html'
93
+ @path ||= File.basename(filename, ".txt") + '.html'
94
94
  end
95
95
 
96
96
  def to_html
@@ -0,0 +1,89 @@
1
+ require File.dirname(__FILE__) + '/spec_helper.rb'
2
+
3
+ describe MetricFu::Configuration do
4
+ before do
5
+ MetricFu.configuration.reset
6
+ end
7
+ describe "open_in_browser" do
8
+ it "should be configurable" do
9
+ MetricFu.open_in_browser?.should == !!PLATFORM['darwin']
10
+ MetricFu::Configuration.run do |config|
11
+ config.open_in_browser = false
12
+ end
13
+ MetricFu.configuration.open_in_browser.should == false
14
+ MetricFu.open_in_browser?.should == false
15
+ end
16
+ end
17
+
18
+ describe "metrics" do
19
+ it "should be configurable" do
20
+ MetricFu.metrics.should == [:coverage, :churn, :flog, :flay, :saikuro]
21
+ MetricFu::Configuration.run do |config|
22
+ config.metrics = [:coverage, :flog]
23
+ end
24
+ MetricFu.metrics.should == [:coverage, :flog]
25
+ end
26
+ end
27
+
28
+ describe "churn_options" do
29
+ it "should be configurable" do
30
+ now = Time.now
31
+ MetricFu.churn_options.should == {}
32
+ MetricFu::Configuration.run do |config|
33
+ config.churn_options[:start_date] = now
34
+ end
35
+ MetricFu.churn_options.should == {:start_date => now }
36
+ end
37
+ end
38
+
39
+ describe "coverage_options" do
40
+ it "should be configurable" do
41
+ MetricFu.coverage_options[:test_files].should == ['test/**/*_test.rb', 'spec/**/*_spec.rb']
42
+ MetricFu::Configuration.run do |config|
43
+ config.coverage_options[:test_files] = ['test/**/test_*.rb']
44
+ end
45
+ MetricFu.coverage_options[:test_files].should == ['test/**/test_*.rb']
46
+ end
47
+ end
48
+
49
+ describe "flay_options" do
50
+ it "should be configurable" do
51
+ now = Time.now
52
+ MetricFu.flay_options.should == { :dirs_to_flay => ['lib'] }
53
+ MetricFu::Configuration.run do |config|
54
+ config.flay_options[:dirs_to_flay] = ['cms/app', 'cms/lib']
55
+ end
56
+ MetricFu.flay_options.should == { :dirs_to_flay => ['cms/app', 'cms/lib'] }
57
+ end
58
+ end
59
+
60
+ describe "flog_options" do
61
+ it "should be configurable" do
62
+ now = Time.now
63
+ MetricFu.flog_options.should == { :dirs_to_flog => ['lib'] }
64
+ MetricFu::Configuration.run do |config|
65
+ config.flog_options[:dirs_to_flog] = ['cms/app', 'cms/lib']
66
+ end
67
+ MetricFu.flog_options.should == { :dirs_to_flog => ['cms/app', 'cms/lib'] }
68
+ end
69
+ end
70
+
71
+ describe "saikuro_options" do
72
+ it "should be configurable" do
73
+ MetricFu.saikuro_options.should == {}
74
+ MetricFu::Configuration.run do |config|
75
+ config.saikuro_options = { "--warn_cyclo" => "3", "--error_cyclo" => "4" }
76
+ end
77
+ MetricFu.saikuro_options.should == { "--warn_cyclo" => "3", "--error_cyclo" => "4" }
78
+ end
79
+
80
+ it "should only accept a Hash" do
81
+ MetricFu.saikuro_options.should == {}
82
+ lambda {
83
+ MetricFu::Configuration.run do |config|
84
+ config.saikuro_options = ''
85
+ end
86
+ }.should raise_error
87
+ end
88
+ end
89
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: p8-metric_fu
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.4.11
4
+ version: 0.8.4.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jake Scruggs
@@ -141,6 +141,7 @@ summary: A fistful of code metrics
141
141
  test_files:
142
142
  - spec/base_spec.rb
143
143
  - spec/churn_spec.rb
144
+ - spec/config_spec.rb
144
145
  - spec/flay_spec.rb
145
146
  - spec/flog_spec.rb
146
147
  - spec/md5_tracker_spec.rb