metric_fu 2.1.3.7.19 → 2.1.4.pre
Sign up to get free protection for your applications and to get access to all the features.
- data/.rspec +2 -0
- data/.travis.yml +12 -0
- data/Gemfile +2 -2
- data/HISTORY.md +15 -2
- data/README.md +19 -12
- data/TODO.md +121 -7
- data/bin/metric_fu +134 -2
- data/lib/metric_fu.rb +8 -1
- data/lib/metric_fu/configuration.rb +192 -0
- data/lib/{data_structures → metric_fu/data_structures}/careful_array.rb +0 -0
- data/lib/{data_structures → metric_fu/data_structures}/line_numbers.rb +0 -0
- data/lib/{data_structures → metric_fu/data_structures}/location.rb +0 -0
- data/lib/{errors → metric_fu/errors}/analysis_error.rb +0 -0
- data/lib/{initial_requires.rb → metric_fu/initial_requires.rb} +1 -0
- data/lib/{load_files.rb → metric_fu/load_files.rb} +0 -8
- data/lib/{logging → metric_fu/logging}/mf_debugger.rb +0 -0
- data/lib/{metrics → metric_fu/metrics}/base_template.rb +0 -0
- data/lib/metric_fu/metrics/churn/churn.rb +64 -0
- data/lib/{metrics → metric_fu/metrics}/churn/churn_hotspot.rb +0 -0
- data/lib/metric_fu/metrics/churn/init.rb +5 -0
- data/lib/{metrics → metric_fu/metrics}/churn/template_awesome/churn.html.erb +0 -0
- data/lib/{metrics → metric_fu/metrics}/churn/template_standard/churn.html.erb +0 -0
- data/lib/{metrics → metric_fu/metrics}/flay/flay.rb +3 -1
- data/lib/{metrics → metric_fu/metrics}/flay/flay_grapher.rb +0 -0
- data/lib/{metrics → metric_fu/metrics}/flay/flay_hotspot.rb +0 -0
- data/lib/metric_fu/metrics/flay/init.rb +9 -0
- data/lib/{metrics → metric_fu/metrics}/flay/template_awesome/flay.html.erb +0 -0
- data/lib/{metrics → metric_fu/metrics}/flay/template_standard/flay.html.erb +0 -0
- data/lib/{metrics → metric_fu/metrics}/flog/flog.rb +0 -0
- data/lib/{metrics → metric_fu/metrics}/flog/flog_grapher.rb +0 -0
- data/lib/{metrics → metric_fu/metrics}/flog/flog_hotspot.rb +0 -0
- data/lib/metric_fu/metrics/flog/init.rb +7 -0
- data/lib/{metrics → metric_fu/metrics}/flog/template_awesome/flog.html.erb +0 -0
- data/lib/{metrics → metric_fu/metrics}/flog/template_standard/flog.html.erb +0 -0
- data/lib/{metrics → metric_fu/metrics}/generator.rb +3 -4
- data/lib/{metrics → metric_fu/metrics}/graph.rb +0 -0
- data/lib/{metrics → metric_fu/metrics}/hotspots/analysis/code_issue.rb +0 -0
- data/lib/{metrics → metric_fu/metrics}/hotspots/analysis/grouping.rb +0 -0
- data/lib/{metrics → metric_fu/metrics}/hotspots/analysis/ranking.rb +0 -0
- data/lib/{metrics → metric_fu/metrics}/hotspots/analysis/record.rb +0 -0
- data/lib/{metrics → metric_fu/metrics}/hotspots/analysis/scoring_strategies.rb +0 -0
- data/lib/{metrics → metric_fu/metrics}/hotspots/analysis/table.rb +0 -0
- data/lib/{metrics → metric_fu/metrics}/hotspots/hotspot_analyzer.rb +0 -0
- data/lib/{metrics → metric_fu/metrics}/hotspots/hotspots.rb +0 -0
- data/lib/metric_fu/metrics/hotspots/init.rb +5 -0
- data/lib/{metrics → metric_fu/metrics}/hotspots/template_awesome/hotspots.html.erb +0 -0
- data/lib/{metrics → metric_fu/metrics}/hotspots/template_standard/hotspots.html.erb +0 -0
- data/lib/metric_fu/metrics/rails_best_practices/init.rb +7 -0
- data/lib/{metrics → metric_fu/metrics}/rails_best_practices/rails_best_practices.rb +4 -2
- data/lib/{metrics → metric_fu/metrics}/rails_best_practices/rails_best_practices_grapher.rb +0 -0
- data/lib/{metrics → metric_fu/metrics}/rails_best_practices/template_awesome/rails_best_practices.html.erb +0 -0
- data/lib/{metrics → metric_fu/metrics}/rails_best_practices/template_standard/rails_best_practices.html.erb +0 -0
- data/lib/metric_fu/metrics/rcov/init.rb +18 -0
- data/lib/{metrics → metric_fu/metrics}/rcov/rcov.rb +22 -7
- data/lib/{metrics → metric_fu/metrics}/rcov/rcov_grapher.rb +0 -0
- data/lib/{metrics → metric_fu/metrics}/rcov/rcov_hotspot.rb +0 -0
- data/lib/{metrics → metric_fu/metrics}/rcov/template_awesome/rcov.html.erb +0 -0
- data/lib/{metrics → metric_fu/metrics}/rcov/template_standard/rcov.html.erb +0 -0
- data/lib/metric_fu/metrics/reek/init.rb +7 -0
- data/lib/{metrics → metric_fu/metrics}/reek/reek.rb +3 -1
- data/lib/{metrics → metric_fu/metrics}/reek/reek_grapher.rb +0 -0
- data/lib/{metrics → metric_fu/metrics}/reek/reek_hotspot.rb +0 -0
- data/lib/{metrics → metric_fu/metrics}/reek/template_awesome/reek.html.erb +0 -0
- data/lib/{metrics → metric_fu/metrics}/reek/template_standard/reek.html.erb +0 -0
- data/lib/metric_fu/metrics/roodi/init.rb +7 -0
- data/lib/{metrics → metric_fu/metrics}/roodi/roodi.rb +3 -1
- data/lib/{metrics → metric_fu/metrics}/roodi/roodi_grapher.rb +0 -0
- data/lib/{metrics → metric_fu/metrics}/roodi/roodi_hotspot.rb +0 -0
- data/lib/{metrics → metric_fu/metrics}/roodi/template_awesome/roodi.html.erb +0 -0
- data/lib/{metrics → metric_fu/metrics}/roodi/template_standard/roodi.html.erb +0 -0
- data/lib/metric_fu/metrics/saikuro/init.rb +11 -0
- data/lib/{metrics → metric_fu/metrics}/saikuro/saikuro.rb +0 -0
- data/lib/{metrics → metric_fu/metrics}/saikuro/saikuro_hotspot.rb +0 -0
- data/lib/{metrics → metric_fu/metrics}/saikuro/template_awesome/saikuro.html.erb +0 -0
- data/lib/{metrics → metric_fu/metrics}/saikuro/template_standard/saikuro.html.erb +0 -0
- data/lib/metric_fu/metrics/stats/init.rb +7 -0
- data/lib/{metrics → metric_fu/metrics}/stats/stats.rb +3 -1
- data/lib/{metrics → metric_fu/metrics}/stats/stats_grapher.rb +0 -0
- data/lib/{metrics → metric_fu/metrics}/stats/stats_hotspot.rb +0 -0
- data/lib/{metrics → metric_fu/metrics}/stats/template_awesome/stats.html.erb +0 -0
- data/lib/{metrics → metric_fu/metrics}/stats/template_standard/stats.html.erb +0 -0
- data/lib/{reporting → metric_fu/reporting}/graphs/engines/bluff.rb +0 -0
- data/lib/{reporting → metric_fu/reporting}/graphs/engines/gchart.rb +0 -0
- data/lib/metric_fu/reporting/graphs/engines/init.rb +5 -0
- data/lib/{reporting → metric_fu/reporting}/graphs/grapher.rb +0 -0
- data/lib/{reporting → metric_fu/reporting}/report.rb +3 -2
- data/lib/{reporting → metric_fu/reporting}/templates/awesome/awesome_template.rb +0 -0
- data/lib/{reporting → metric_fu/reporting}/templates/awesome/css/buttons.css +0 -0
- data/lib/{reporting → metric_fu/reporting}/templates/awesome/css/default.css +0 -0
- data/lib/{reporting → metric_fu/reporting}/templates/awesome/css/integrity.css +0 -0
- data/lib/{reporting → metric_fu/reporting}/templates/awesome/css/reset.css +0 -0
- data/lib/{reporting → metric_fu/reporting}/templates/awesome/css/syntax.css +0 -0
- data/lib/{reporting → metric_fu/reporting}/templates/awesome/index.html.erb +0 -0
- data/lib/{reporting → metric_fu/reporting}/templates/awesome/layout.html.erb +0 -0
- data/lib/{reporting → metric_fu/reporting}/templates/javascripts/bluff-min.js +0 -0
- data/lib/{reporting → metric_fu/reporting}/templates/javascripts/excanvas.js +0 -0
- data/lib/{reporting → metric_fu/reporting}/templates/javascripts/js-class.js +0 -0
- data/lib/{reporting → metric_fu/reporting}/templates/standard/default.css +0 -0
- data/lib/{reporting → metric_fu/reporting}/templates/standard/index.html.erb +0 -0
- data/lib/{reporting → metric_fu/reporting}/templates/standard/standard_template.rb +0 -0
- data/lib/{run.rb → metric_fu/run.rb} +12 -11
- data/lib/{tasks → metric_fu/tasks}/metric_fu.rake +0 -0
- data/lib/metric_fu/version.rb +3 -0
- data/metric_fu.gemspec +13 -21
- data/spec/metric_fu/configuration_spec.rb +298 -0
- data/spec/{base → metric_fu/data_structures}/line_numbers_spec.rb +11 -11
- data/spec/{base → metric_fu/data_structures}/location_spec.rb +1 -1
- data/spec/{base → metric_fu/metrics}/base_template_spec.rb +1 -1
- data/spec/metric_fu/metrics/churn/churn_spec.rb +85 -0
- data/spec/{graphs → metric_fu/metrics/flay}/flay_grapher_spec.rb +3 -3
- data/spec/{generators → metric_fu/metrics/flay}/flay_spec.rb +1 -1
- data/spec/{graphs → metric_fu/metrics/flog}/flog_grapher_spec.rb +4 -4
- data/spec/{generators → metric_fu/metrics/flog}/flog_spec.rb +1 -1
- data/spec/{base → metric_fu/metrics}/generator_spec.rb +4 -3
- data/spec/{base → metric_fu/metrics}/graph_spec.rb +1 -1
- data/spec/{base → metric_fu/metrics/hotspots/analysis}/ranking_spec.rb +1 -1
- data/spec/{base → metric_fu/metrics/hotspots/analysis}/table_spec.rb +1 -1
- data/spec/{base → metric_fu/metrics/hotspots}/hotspot_analyzer_spec.rb +1 -1
- data/spec/{generators → metric_fu/metrics/hotspots}/hotspots_spec.rb +1 -1
- data/spec/{graphs → metric_fu/metrics/rails_best_practices}/rails_best_practices_grapher_spec.rb +3 -3
- data/spec/{generators → metric_fu/metrics/rails_best_practices}/rails_best_practices_spec.rb +1 -1
- data/spec/{graphs → metric_fu/metrics/rcov}/rcov_grapher_spec.rb +3 -3
- data/spec/{generators → metric_fu/metrics/rcov}/rcov_spec.rb +1 -1
- data/spec/{graphs → metric_fu/metrics/reek}/reek_grapher_spec.rb +3 -3
- data/spec/{generators → metric_fu/metrics/reek}/reek_spec.rb +1 -1
- data/spec/{graphs → metric_fu/metrics/roodi}/roodi_grapher_spec.rb +3 -3
- data/spec/{generators → metric_fu/metrics/roodi}/roodi_spec.rb +1 -1
- data/spec/{generators → metric_fu/metrics/saikuro}/saikuro_spec.rb +4 -4
- data/spec/{graphs → metric_fu/metrics/stats}/stats_grapher_spec.rb +3 -3
- data/spec/{generators → metric_fu/metrics/stats}/stats_spec.rb +7 -4
- data/spec/{graphs → metric_fu/reporting/graphs}/engines/bluff_spec.rb +3 -3
- data/spec/{graphs → metric_fu/reporting/graphs}/engines/gchart_spec.rb +2 -1
- data/spec/{base → metric_fu/reporting}/report_spec.rb +5 -3
- data/spec/spec_helper.rb +17 -5
- data/spec/support/suite.rb +16 -0
- metadata +195 -183
- data/lib/configuration.rb +0 -227
- data/lib/metrics/churn/churn.rb +0 -28
- data/lib/version.rb +0 -3
- data/spec/base/configuration_spec.rb +0 -277
- data/spec/generators/churn_spec.rb +0 -41
- data/spec/spec.opts +0 -6
@@ -1,41 +0,0 @@
|
|
1
|
-
require File.expand_path(File.dirname(__FILE__) + "/../spec_helper")
|
2
|
-
|
3
|
-
describe Churn do
|
4
|
-
|
5
|
-
describe "analyze method" do
|
6
|
-
before :each do
|
7
|
-
MetricFu::Configuration.run {}
|
8
|
-
File.stub!(:directory?).and_return(true)
|
9
|
-
@changes = {"lib/generators/flog.rb"=>2, "lib/metric_fu.rb"=>3}
|
10
|
-
end
|
11
|
-
|
12
|
-
it "should be empty on error" do
|
13
|
-
churn = MetricFu::Churn.new
|
14
|
-
churn.instance_variable_set(:@output, "Churning requires a subversion or git repo")
|
15
|
-
result = churn.analyze
|
16
|
-
result.should == [:churn => {}]
|
17
|
-
end
|
18
|
-
|
19
|
-
it "should return yaml results" do
|
20
|
-
churn = MetricFu::Churn.new
|
21
|
-
churn.instance_variable_set(:@output, "--- \n:churn: \n :changed_files: \n - spec/graphs/flog_grapher_spec.rb\n - spec/base/graph_spec.rb\n - lib/templates/awesome/layout.html.erb\n - lib/graphs/rcov_grapher.rb\n - lib/base/base_template.rb\n - spec/graphs/grapher_spec.rb\n - lib/templates/awesome/flog.html.erb\n - lib/templates/awesome/flay.html.erb\n - lib/graphs/roodi_grapher.rb\n - lib/graphs/reek_grapher.rb\n - HISTORY\n - spec/graphs/roodi_grapher_spec.rb\n - lib/generators/rcov.rb\n - spec/graphs/engines/gchart_spec.rb\n - spec/graphs/rcov_grapher_spec.rb\n - lib/templates/javascripts/excanvas.js\n - lib/templates/javascripts/bluff-min.js\n - spec/graphs/reek_grapher_spec.rb\n")
|
22
|
-
result = churn.analyze
|
23
|
-
result.should == {:churn=>{:changed_files=>["spec/graphs/flog_grapher_spec.rb", "spec/base/graph_spec.rb", "lib/templates/awesome/layout.html.erb", "lib/graphs/rcov_grapher.rb", "lib/base/base_template.rb", "spec/graphs/grapher_spec.rb", "lib/templates/awesome/flog.html.erb", "lib/templates/awesome/flay.html.erb", "lib/graphs/roodi_grapher.rb", "lib/graphs/reek_grapher.rb", "HISTORY", "spec/graphs/roodi_grapher_spec.rb", "lib/generators/rcov.rb", "spec/graphs/engines/gchart_spec.rb", "spec/graphs/rcov_grapher_spec.rb", "lib/templates/javascripts/excanvas.js", "lib/templates/javascripts/bluff-min.js", "spec/graphs/reek_grapher_spec.rb"]}}
|
24
|
-
end
|
25
|
-
|
26
|
-
end
|
27
|
-
|
28
|
-
describe "to_h method" do
|
29
|
-
before :each do
|
30
|
-
MetricFu::Configuration.run {}
|
31
|
-
File.stub!(:directory?).and_return(true)
|
32
|
-
end
|
33
|
-
|
34
|
-
it "should put the changes into a hash" do
|
35
|
-
churn = MetricFu::Churn.new
|
36
|
-
churn.instance_variable_set(:@churn, {:churn => 'results'})
|
37
|
-
churn.to_h[:churn].should == "results"
|
38
|
-
end
|
39
|
-
end
|
40
|
-
end
|
41
|
-
|