metrical 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/README.rdoc +18 -0
  2. data/bin/metrical +61 -0
  3. metadata +105 -0
data/README.rdoc ADDED
@@ -0,0 +1,18 @@
1
+ = Metrical
2
+
3
+ MetricFu is awesome! Metrical fixes some tiny issues I have with it.
4
+
5
+ * Don't make MetricFu or any metrics part of the dependencies of your project
6
+ * Works with Rails 3 and Rspec 2
7
+ * You can now run MetricFu in any directory:
8
+
9
+ cd /path/of/your/project
10
+ metrical
11
+
12
+ * Has been preconfigured to work with Rails
13
+ * Reek and Roodi are properly installed by metrical
14
+ * Per project configuration in a simple <tt>.metrics</tt> file
15
+
16
+ == Installation
17
+
18
+ gem install metrical
data/bin/metrical ADDED
@@ -0,0 +1,61 @@
1
+ #!/usr/bin/env ruby
2
+ require 'rubygems'
3
+ require 'json'
4
+ require 'metric_fu'
5
+
6
+ # Load default configuration
7
+ MetricFu::Configuration.run do |config|
8
+ config.metrics = [ :churn, :saikuro, :stats, :flog, :flay, :reek, :roodi, :rcov ]
9
+ config.graphs = [ :flog, :flay, :reek, :roodi, :rcov ]
10
+ config.flay = { :dirs_to_flay => ['app', 'lib'], :minimum_score => 100 }
11
+ config.flog = { :dirs_to_flog => ['app', 'lib'] }
12
+ config.reek = { :dirs_to_reek => ['app', 'lib'] }
13
+ config.roodi = { :dirs_to_roodi => ['app', 'lib'] }
14
+
15
+ config.saikuro = {
16
+ :output_directory => 'scratch_directory/saikuro',
17
+ :input_directory => ['app', 'lib'],
18
+ :cyclo => "",
19
+ :filter_cyclo => "0",
20
+ :warn_cyclo => "5",
21
+ :error_cyclo => "7",
22
+ :formater => "text" #this needs to be set to "text"
23
+ }
24
+
25
+ config.churn = { :start_date => "1 year ago", :minimum_churn_count => 10}
26
+
27
+ config.rcov = {
28
+ :environment => 'test',
29
+ :test_files => [ 'test/**/*_test.rb',
30
+ 'spec/**/*_spec.rb'],
31
+ :rcov_opts => [
32
+ "--sort coverage",
33
+ "--no-html",
34
+ "--text-coverage",
35
+ "--no-color",
36
+ "--profile",
37
+ "-Ispec",
38
+ "--exclude-only '.*'",
39
+ '--include-file "\Aapp,\Alib"'
40
+ ]
41
+ }
42
+ config.graph_engine = :bluff
43
+ end
44
+
45
+ # Load local metrics settings
46
+ file = File.join(Dir.pwd, '.metrics')
47
+ load file if File.exist?(file)
48
+
49
+ # Run metric fu!
50
+ MetricFu::Configuration.run {}
51
+ MetricFu.metrics.each {|metric| MetricFu.report.add(metric) }
52
+ MetricFu.report.save_output(MetricFu.report.to_yaml, MetricFu.base_directory, "report.yml")
53
+ MetricFu.report.save_output(MetricFu.report.to_yaml, MetricFu.data_directory, "#{Time.now.strftime("%Y%m%d")}.yml")
54
+ MetricFu.report.save_templatized_report
55
+
56
+ MetricFu.graphs.each {|graph| MetricFu.graph.add(graph, MetricFu.graph_engine) }
57
+ MetricFu.graph.generate
58
+
59
+ if MetricFu.report.open_in_browser?
60
+ MetricFu.report.show_in_browser(MetricFu.output_directory)
61
+ end
metadata ADDED
@@ -0,0 +1,105 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: metrical
3
+ version: !ruby/object:Gem::Version
4
+ prerelease: false
5
+ segments:
6
+ - 0
7
+ - 0
8
+ - 2
9
+ version: 0.0.2
10
+ platform: ruby
11
+ authors:
12
+ - Iain Hecker
13
+ autorequire:
14
+ bindir: bin
15
+ cert_chain: []
16
+
17
+ date: 2010-04-22 00:00:00 +02:00
18
+ default_executable:
19
+ dependencies:
20
+ - !ruby/object:Gem::Dependency
21
+ name: metric_fu
22
+ prerelease: false
23
+ requirement: &id001 !ruby/object:Gem::Requirement
24
+ requirements:
25
+ - - ~>
26
+ - !ruby/object:Gem::Version
27
+ segments:
28
+ - 1
29
+ - 3
30
+ - 0
31
+ version: 1.3.0
32
+ type: :runtime
33
+ version_requirements: *id001
34
+ - !ruby/object:Gem::Dependency
35
+ name: reek
36
+ prerelease: false
37
+ requirement: &id002 !ruby/object:Gem::Requirement
38
+ requirements:
39
+ - - ">="
40
+ - !ruby/object:Gem::Version
41
+ segments:
42
+ - 1
43
+ - 2
44
+ - 7
45
+ version: 1.2.7
46
+ type: :runtime
47
+ version_requirements: *id002
48
+ - !ruby/object:Gem::Dependency
49
+ name: roodi
50
+ prerelease: false
51
+ requirement: &id003 !ruby/object:Gem::Requirement
52
+ requirements:
53
+ - - ">="
54
+ - !ruby/object:Gem::Version
55
+ segments:
56
+ - 2
57
+ - 1
58
+ - 0
59
+ version: 2.1.0
60
+ type: :runtime
61
+ version_requirements: *id003
62
+ description: MetricFu is awesome! The only problem is that it's kinda obtrusive. Metrical provides a executable so you can run metric fu on any project without making changes to the project.
63
+ email: iain@iain.nl
64
+ executables:
65
+ - metrical
66
+ extensions: []
67
+
68
+ extra_rdoc_files: []
69
+
70
+ files:
71
+ - README.rdoc
72
+ - bin/metrical
73
+ has_rdoc: true
74
+ homepage: http://github.com/iain/metrical/
75
+ licenses: []
76
+
77
+ post_install_message:
78
+ rdoc_options:
79
+ - --main
80
+ - README.rdoc
81
+ require_paths:
82
+ - lib
83
+ required_ruby_version: !ruby/object:Gem::Requirement
84
+ requirements:
85
+ - - ">="
86
+ - !ruby/object:Gem::Version
87
+ segments:
88
+ - 0
89
+ version: "0"
90
+ required_rubygems_version: !ruby/object:Gem::Requirement
91
+ requirements:
92
+ - - ">="
93
+ - !ruby/object:Gem::Version
94
+ segments:
95
+ - 0
96
+ version: "0"
97
+ requirements: []
98
+
99
+ rubyforge_project:
100
+ rubygems_version: 1.3.6
101
+ signing_key:
102
+ specification_version: 3
103
+ summary: Run MetricFu on any project easisly
104
+ test_files: []
105
+