p8-metric_fu 0.9.0 → 0.9.0.1

Sign up to get free protection for your applications and to get access to all the features.
data/spec/flay_spec.rb CHANGED
@@ -1,19 +1,19 @@
1
1
  require File.dirname(__FILE__) + '/spec_helper.rb'
2
2
 
3
- describe MetricFu::Flay do
3
+ describe Flay do
4
4
 
5
- describe "generate_html" do
6
- it "should create a new Generator and call generate_report on it" do
7
- @generator = MetricFu::Flay.new('other_dir')
8
- @generator.should_receive(:`).and_return("Matches found in :call (mass = 55)\n\tlib/metric_fu/flog_reporter.rb:2\n\tlib/metric_fu/flog_reporter.rb:3")
9
- @generator.generate_html
10
- end
11
- end
12
-
13
- describe "template_name" do
14
- it "should return the class name in lowercase" do
15
- flay = MetricFu::Flay.new('base_dir')
16
- flay.template_name.should == 'flay'
17
- end
18
- end
19
- end
5
+ # describe "generate_output" do
6
+ # it "should create a new Generator and call generate_report on it" do
7
+ # @generator = MetricFu::Flay.new('other_dir')
8
+ # @generator.should_receive(:`).and_return("Matches found in :call (mass = 55)\n\tlib/metric_fu/flog_reporter.rb:2\n\tlib/metric_fu/flog_reporter.rb:3")
9
+ # @generator.generate_output
10
+ # end
11
+ # end
12
+ #
13
+ # describe "template_name" do
14
+ # it "should return the class name in lowercase" do
15
+ # flay = MetricFu::Flay.new('base_dir')
16
+ # flay.template_name.should == 'flay'
17
+ # end
18
+ # end
19
+ end
data/spec/flog_spec.rb CHANGED
@@ -1,208 +1,207 @@
1
1
  require File.dirname(__FILE__) + '/spec_helper.rb'
2
- include MetricFu::Flog
3
2
 
4
- describe "Flog::Base" do
5
- before do
6
- @alpha_only_method = <<-AOM
7
- Total flog = 13.6283678106927
8
-
9
- ErrorMailer#errormail: (12.5)
10
- 12.0: assignment
11
- 1.2: []
12
- 1.2: now
13
- 1.2: content_type
14
- AOM
15
-
16
- @method_that_has_digits = <<-MTHD
17
- Total flog = 7.08378429936994
18
-
19
- NoImmunizationReason#to_c32: (7.1)
20
- 3.0: code
21
- 2.3: branch
22
- 1.4: templateId
23
- 1.2: act
24
- 1.1: entryRelationship
25
- MTHD
26
-
27
- @bang_method = <<-BM
28
- Total flog = 7.08378429936994
29
-
30
- NoImmunizationReason#to_c32!: (7.1)
31
- 3.0: code
32
- 2.3: branch
33
- 1.4: templateId
34
- 1.2: act
35
- 1.1: entryRelationship
36
- BM
37
-
38
- @invalid_method = <<-IM
39
- Total flog = 7.08378429936994
40
-
41
- 3.0: code
42
- 2.3: branch
43
- 1.4: templateId
44
- 1.2: act
45
- 1.1: entryRelationship
46
- IM
47
-
48
- @assignment_method = <<-MTHD
49
- Total Flog = 21.6 (5.4 +/- 3.3 flog / method)
50
-
51
- ActivityReport#existing_measure_attributes=: (8.5)
52
- 4.1: assignment
53
- 1.8: id
54
- 1.6: to_s
55
- 1.4: []
56
- 1.4: activity_report_measures
57
- 1.2: each
58
- 1.2: branch
59
- MTHD
60
-
61
- @class_methods_grouped_together = <<-MTHD
62
- Total Flog = 61.8 (7.7 +/- 95.3 flog / method)
63
-
64
- User#none: (32.8)
65
- 7.2: include
66
- 3.6: validates_length_of
67
- 3.6: validates_format_of
68
- 2.4: validates_presence_of
69
- 2.4: validates_uniqueness_of
70
- 1.4: bad_login_message
71
- 1.4: name_regex
72
- 1.4: bad_email_message
73
- 1.4: bad_name_message
74
- 1.4: login_regex
75
- 1.4: email_regex
76
- 1.2: private
77
- 1.2: has_and_belongs_to_many
78
- 1.2: before_create
79
- 1.2: attr_accessible
80
- 0.4: lit_fixnum
81
- MTHD
82
- end
83
-
84
- it "should be able to parse class_methods_grouped_together" do
85
- page = Base.parse(@class_methods_grouped_together)
86
- page.should_not be_nil
87
- page.score.should == 61.8
88
- page.scanned_methods.size.should == 1
89
- sm = page.scanned_methods.first
90
- sm.name.should == 'User#none'
91
- sm.score.should == 32.8
92
-
93
- sm.operators.size.should == 16
94
- sm.operators.first.score.should == 7.2
95
- sm.operators.first.operator.should == "include"
96
-
97
- sm.operators.last.score.should == 0.4
98
- sm.operators.last.operator.should == "lit_fixnum"
99
- end
100
-
101
- it "should be able to parse an assignment method" do
102
- page = Base.parse(@assignment_method)
103
- page.should_not be_nil
104
- page.score.should == 21.6
105
- page.scanned_methods.size.should == 1
106
- sm = page.scanned_methods.first
107
- sm.name.should == 'ActivityReport#existing_measure_attributes='
108
- sm.score.should == 8.5
109
- end
110
-
111
- it "should be able to parse an alpha only method" do
112
- page = Base.parse(@alpha_only_method)
113
- page.should_not be_nil
114
- page.score.should == 13.6283678106927
115
- page.scanned_methods.size.should == 1
116
- sm = page.scanned_methods.first
117
- sm.name.should == 'ErrorMailer#errormail'
118
- sm.score.should == 12.5
119
- end
120
-
121
- it "should be able to parse method that has digits" do
122
- page = Base.parse(@method_that_has_digits)
123
- page.should_not be_nil
124
- page.score.should == 7.08378429936994
125
- page.scanned_methods.size.should == 1
126
- sm = page.scanned_methods.first
127
- sm.name.should == 'NoImmunizationReason#to_c32'
128
- sm.score.should == 7.1
129
- end
130
-
131
- it "should be able to parse bang method" do
132
- page = Base.parse(@bang_method)
133
- page.should_not be_nil
134
- page.score.should == 7.08378429936994
135
- page.scanned_methods.size.should == 1
136
- sm = page.scanned_methods.first
137
- sm.name.should == 'NoImmunizationReason#to_c32!'
138
- sm.score.should == 7.1
139
- end
140
-
141
- it "should return nil when parsing invalid method" do
142
- page = Base.parse(@invalid_method)
143
- page.should be_nil
144
- end
145
- end
146
-
147
- IM = <<-IM
148
- Total flog = 7.08378429936994
149
-
150
- 3.0: code
151
- 2.3: branch
152
- 1.4: templateId
153
- 1.2: act
154
- 1.1: entryRelationship
155
- IM
156
- describe MetricFu::Flog do
157
-
158
- describe "generate_report" do
159
- it "should generate reports" do
160
- generator = Flog::Generator.new('other_dir')
161
- generator.should_receive(:flog_results).and_return(['A', 'B'])
162
- generator.should_receive(:save_html).at_least(3).times.and_return('')
163
- generator.should_receive(:open).any_number_of_times.and_return(['Total Flog = 1273.9 (9.3 +/- 259.2 flog / method)', 'TokenCounter#list_tokens_per_line: (15.2)', '9.0: assignment'].join("\n"))
164
- generator.generate_report
165
- end
166
-
167
- it "should be able to handle InvalidFlogs" do
168
- generator = Flog::Generator.new('other_dir')
169
- generator.should_receive(:flog_results).and_return(['A', 'B'])
170
- generator.should_receive(:inline_css).any_number_of_times.and_return('')
171
- generator.should_receive(:save_html).once
172
- generator.should_receive(:open).any_number_of_times.and_return(IM)
173
- generator.generate_report
174
- end
175
- end
176
-
177
- describe "template_name" do
178
- it "should return the class name in lowercase" do
179
- flog = Flog::Generator.new('base_dir')
180
- Flog::Generator.template_name.should == 'flog'
181
- end
182
- end
3
+ describe Flog do
4
+ # before do
5
+ # @alpha_only_method = <<-AOM
6
+ # Total flog = 13.6283678106927
7
+ #
8
+ # ErrorMailer#errormail: (12.5)
9
+ # 12.0: assignment
10
+ # 1.2: []
11
+ # 1.2: now
12
+ # 1.2: content_type
13
+ # AOM
14
+ #
15
+ # @method_that_has_digits = <<-MTHD
16
+ # Total flog = 7.08378429936994
17
+ #
18
+ # NoImmunizationReason#to_c32: (7.1)
19
+ # 3.0: code
20
+ # 2.3: branch
21
+ # 1.4: templateId
22
+ # 1.2: act
23
+ # 1.1: entryRelationship
24
+ # MTHD
25
+ #
26
+ # @bang_method = <<-BM
27
+ # Total flog = 7.08378429936994
28
+ #
29
+ # NoImmunizationReason#to_c32!: (7.1)
30
+ # 3.0: code
31
+ # 2.3: branch
32
+ # 1.4: templateId
33
+ # 1.2: act
34
+ # 1.1: entryRelationship
35
+ # BM
36
+ #
37
+ # @invalid_method = <<-IM
38
+ # Total flog = 7.08378429936994
39
+ #
40
+ # 3.0: code
41
+ # 2.3: branch
42
+ # 1.4: templateId
43
+ # 1.2: act
44
+ # 1.1: entryRelationship
45
+ # IM
46
+ #
47
+ # @assignment_method = <<-MTHD
48
+ # Total Flog = 21.6 (5.4 +/- 3.3 flog / method)
49
+ #
50
+ # ActivityReport#existing_measure_attributes=: (8.5)
51
+ # 4.1: assignment
52
+ # 1.8: id
53
+ # 1.6: to_s
54
+ # 1.4: []
55
+ # 1.4: activity_report_measures
56
+ # 1.2: each
57
+ # 1.2: branch
58
+ # MTHD
59
+ #
60
+ # @class_methods_grouped_together = <<-MTHD
61
+ # Total Flog = 61.8 (7.7 +/- 95.3 flog / method)
62
+ #
63
+ # User#none: (32.8)
64
+ # 7.2: include
65
+ # 3.6: validates_length_of
66
+ # 3.6: validates_format_of
67
+ # 2.4: validates_presence_of
68
+ # 2.4: validates_uniqueness_of
69
+ # 1.4: bad_login_message
70
+ # 1.4: name_regex
71
+ # 1.4: bad_email_message
72
+ # 1.4: bad_name_message
73
+ # 1.4: login_regex
74
+ # 1.4: email_regex
75
+ # 1.2: private
76
+ # 1.2: has_and_belongs_to_many
77
+ # 1.2: before_create
78
+ # 1.2: attr_accessible
79
+ # 0.4: lit_fixnum
80
+ # MTHD
81
+ # end
82
+ #
83
+ # it "should be able to parse class_methods_grouped_together" do
84
+ # page = Base.parse(@class_methods_grouped_together)
85
+ # page.should_not be_nil
86
+ # page.score.should == 61.8
87
+ # page.scanned_methods.size.should == 1
88
+ # sm = page.scanned_methods.first
89
+ # sm.name.should == 'User#none'
90
+ # sm.score.should == 32.8
91
+ #
92
+ # sm.operators.size.should == 16
93
+ # sm.operators.first.score.should == 7.2
94
+ # sm.operators.first.operator.should == "include"
95
+ #
96
+ # sm.operators.last.score.should == 0.4
97
+ # sm.operators.last.operator.should == "lit_fixnum"
98
+ # end
99
+ #
100
+ # it "should be able to parse an assignment method" do
101
+ # page = Base.parse(@assignment_method)
102
+ # page.should_not be_nil
103
+ # page.score.should == 21.6
104
+ # page.scanned_methods.size.should == 1
105
+ # sm = page.scanned_methods.first
106
+ # sm.name.should == 'ActivityReport#existing_measure_attributes='
107
+ # sm.score.should == 8.5
108
+ # end
109
+ #
110
+ # it "should be able to parse an alpha only method" do
111
+ # page = Base.parse(@alpha_only_method)
112
+ # page.should_not be_nil
113
+ # page.score.should == 13.6283678106927
114
+ # page.scanned_methods.size.should == 1
115
+ # sm = page.scanned_methods.first
116
+ # sm.name.should == 'ErrorMailer#errormail'
117
+ # sm.score.should == 12.5
118
+ # end
119
+ #
120
+ # it "should be able to parse method that has digits" do
121
+ # page = Base.parse(@method_that_has_digits)
122
+ # page.should_not be_nil
123
+ # page.score.should == 7.08378429936994
124
+ # page.scanned_methods.size.should == 1
125
+ # sm = page.scanned_methods.first
126
+ # sm.name.should == 'NoImmunizationReason#to_c32'
127
+ # sm.score.should == 7.1
128
+ # end
129
+ #
130
+ # it "should be able to parse bang method" do
131
+ # page = Base.parse(@bang_method)
132
+ # page.should_not be_nil
133
+ # page.score.should == 7.08378429936994
134
+ # page.scanned_methods.size.should == 1
135
+ # sm = page.scanned_methods.first
136
+ # sm.name.should == 'NoImmunizationReason#to_c32!'
137
+ # sm.score.should == 7.1
138
+ # end
139
+ #
140
+ # it "should return nil when parsing invalid method" do
141
+ # page = Base.parse(@invalid_method)
142
+ # page.should be_nil
143
+ # end
144
+ # end
145
+ #
146
+ # IM = <<-IM
147
+ # Total flog = 7.08378429936994
148
+ #
149
+ # 3.0: code
150
+ # 2.3: branch
151
+ # 1.4: templateId
152
+ # 1.2: act
153
+ # 1.1: entryRelationship
154
+ # IM
155
+ # describe MetricFu::Flog do
156
+ #
157
+ # describe "generate_report" do
158
+ # it "should generate reports" do
159
+ # generator = Flog::Generator.new('other_dir')
160
+ # generator.should_receive(:flog_results).and_return(['A', 'B'])
161
+ # generator.should_receive(:save_output).at_least(3).times.and_return('')
162
+ # generator.should_receive(:open).any_number_of_times.and_return(['Total Flog = 1273.9 (9.3 +/- 259.2 flog / method)', 'TokenCounter#list_tokens_per_line: (15.2)', '9.0: assignment'].join("\n"))
163
+ # generator.generate_report
164
+ # end
165
+ #
166
+ # it "should be able to handle InvalidFlogs" do
167
+ # generator = Flog::Generator.new('other_dir')
168
+ # generator.should_receive(:flog_results).and_return(['A', 'B'])
169
+ # generator.should_receive(:inline_css).any_number_of_times.and_return('')
170
+ # generator.should_receive(:save_output).once
171
+ # generator.should_receive(:open).any_number_of_times.and_return(IM)
172
+ # generator.generate_report
173
+ # end
174
+ # end
175
+ #
176
+ # describe "template_name" do
177
+ # it "should return the class name in lowercase" do
178
+ # flog = Flog::Generator.new('base_dir')
179
+ # Flog::Generator.template_name.should == 'flog'
180
+ # end
181
+ # end
182
+ # end
183
+ #
184
+ # describe MetricFu::Flog::Page do
185
+ #
186
+ # describe "average_score" do
187
+ # it "should calculate the average score" do
188
+ # page = Page.new(10)
189
+ # page.should_receive(:scanned_methods).any_number_of_times.and_return([ScannedMethod.new(:test, 10), ScannedMethod.new(:test, 20)])
190
+ # page.average_score.should == 15
191
+ # end
192
+ #
193
+ # it "should be able to handle divide by zero" do
194
+ # page = Page.new(10)
195
+ # page.should_receive(:scanned_methods).any_number_of_times.and_return([])
196
+ # page.average_score.should == 0
197
+ # end
198
+ # end
199
+ #
200
+ # describe "highest_score" do
201
+ # it "should calculate the average score" do
202
+ # page = Page.new(10)
203
+ # page.should_receive(:scanned_methods).any_number_of_times.and_return([ScannedMethod.new(:test, 10), ScannedMethod.new(:test, 20)])
204
+ # page.highest_score.should == 20
205
+ # end
206
+ # end
183
207
  end
184
-
185
- describe MetricFu::Flog::Page do
186
-
187
- describe "average_score" do
188
- it "should calculate the average score" do
189
- page = Page.new(10)
190
- page.should_receive(:scanned_methods).any_number_of_times.and_return([ScannedMethod.new(:test, 10), ScannedMethod.new(:test, 20)])
191
- page.average_score.should == 15
192
- end
193
-
194
- it "should be able to handle divide by zero" do
195
- page = Page.new(10)
196
- page.should_receive(:scanned_methods).any_number_of_times.and_return([])
197
- page.average_score.should == 0
198
- end
199
- end
200
-
201
- describe "highest_score" do
202
- it "should calculate the average score" do
203
- page = Page.new(10)
204
- page.should_receive(:scanned_methods).any_number_of_times.and_return([ScannedMethod.new(:test, 10), ScannedMethod.new(:test, 20)])
205
- page.highest_score.should == 20
206
- end
207
- end
208
- end
data/spec/reek_spec.rb CHANGED
@@ -1,26 +1,26 @@
1
1
  require File.dirname(__FILE__) + '/spec_helper.rb'
2
2
 
3
- REEK_RESULT = %("lib/metric_fu/base.rb" -- 5 warnings:
4
- [Utility Function] #configuration doesn't depend on instance state
5
- [Utility Function] #open_in_browser? doesn't depend on instance state
6
- [Long Method] Configuration#reset has approx 6 statements
7
- [Utility Function] Generator#cycle doesn't depend on instance state
8
- [Utility Function] Generator#link_to_filename doesn't depend on instance state)
3
+ # REEK_RESULT = %("lib/metric_fu/base.rb" -- 5 warnings:
4
+ # [Utility Function] #configuration doesn't depend on instance state
5
+ # [Utility Function] #open_in_browser? doesn't depend on instance state
6
+ # [Long Method] Configuration#reset has approx 6 statements
7
+ # [Utility Function] Generator#cycle doesn't depend on instance state
8
+ # [Utility Function] Generator#link_to_filename doesn't depend on instance state)
9
+ #
10
+ describe Reek do
9
11
 
10
- describe MetricFu::Reek do
11
-
12
- describe "generate_html" do
13
- it "should create a new Generator and call generate_report on it" do
14
- @generator = MetricFu::Reek.new('other_dir')
15
- @generator.should_receive(:`).and_return(REEK_RESULT)
16
- @generator.generate_html
17
- end
18
- end
19
-
20
- describe "template_name" do
21
- it "should return the class name in lowercase" do
22
- flay = MetricFu::Reek.new('base_dir')
23
- flay.template_name.should == 'reek'
24
- end
25
- end
26
- end
12
+ # describe "generate_output" do
13
+ # it "should create a new Generator and call generate_report on it" do
14
+ # @generator = MetricFu::Reek.new('other_dir')
15
+ # @generator.should_receive(:`).and_return(REEK_RESULT)
16
+ # @generator.generate_output
17
+ # end
18
+ # end
19
+ #
20
+ # describe "template_name" do
21
+ # it "should return the class name in lowercase" do
22
+ # flay = MetricFu::Reek.new('base_dir')
23
+ # flay.template_name.should == 'reek'
24
+ # end
25
+ # end
26
+ end
data/spec/spec_helper.rb CHANGED
@@ -2,10 +2,27 @@ require 'rubygems'
2
2
  require 'spec'
3
3
  require 'date'
4
4
 
5
- require File.join(File.dirname(__FILE__), '/../lib/metric_fu/base')
6
- require File.join(File.dirname(__FILE__), '/../lib/metric_fu/flay')
7
- require File.join(File.dirname(__FILE__), '/../lib/metric_fu/flog')
8
- require File.join(File.dirname(__FILE__), '/../lib/metric_fu/md5_tracker')
9
- require File.join(File.dirname(__FILE__), '/../lib/metric_fu/churn')
10
- require File.join(File.dirname(__FILE__), '/../lib/metric_fu/reek')
11
- include MetricFu
5
+ require File.join(File.dirname(__FILE__), '/../lib/metric_fu.rb')
6
+ include MetricFu
7
+
8
+ Mystat = <<-EOF
9
+ (in /Users/gmcinnes/Documents/projects/NeerBeer/src/Web)
10
+ +----------------------+-------+-------+---------+---------+-----+-------+
11
+ | Name | Lines | LOC | Classes | Methods | M/C | LOC/M |
12
+ +----------------------+-------+-------+---------+---------+-----+-------+
13
+ | Controllers | 893 | 405 | 16 | 41 | 2 | 7 |
14
+ | Helpers | 569 | 352 | 0 | 52 | 0 | 4 |
15
+ | Models | 1758 | 453 | 26 | 48 | 1 | 7 |
16
+ | Libraries | 2507 | 1320 | 19 | 175 | 9 | 5 |
17
+ | Model specs | 2285 | 965 | 0 | 1 | 0 | 963 |
18
+ | View specs | 821 | 654 | 0 | 2 | 0 | 325 |
19
+ | Controller specs | 1144 | 871 | 0 | 9 | 0 | 94 |
20
+ | Helper specs | 652 | 465 | 0 | 1 | 0 | 463 |
21
+ | Library specs | 1456 | 1141 | 8 | 14 | 1 | 79 |
22
+ +----------------------+-------+-------+---------+---------+-----+-------+
23
+ | Total | 12085 | 6626 | 69 | 343 | 4 | 17 |
24
+ +----------------------+-------+-------+---------+---------+-----+-------+
25
+ Code LOC: 2530 Test LOC: 4096 Code to Test Ratio: 1:1.6
26
+
27
+ EOF
28
+
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.9.0
4
+ version: 0.9.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jake Scruggs
@@ -12,7 +12,7 @@ autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
14
 
15
- date: 2009-02-13 00:00:00 -08:00
15
+ date: 2009-02-25 00:00:00 -08:00
16
16
  default_executable:
17
17
  dependencies:
18
18
  - !ruby/object:Gem::Dependency
@@ -1,88 +0,0 @@
1
- module MetricFu
2
-
3
- def self.generate_churn_report
4
- Churn.generate_report(MetricFu.churn)
5
- system("open #{Churn.metric_dir}/index.html") if open_in_browser?
6
- end
7
-
8
- class Churn < Base::Generator
9
-
10
- def initialize(options={})
11
- @base_dir = File.join(MetricFu::BASE_DIRECTORY, template_name)
12
- if File.exist?(".git")
13
- @source_control = Git.new(options[:start_date])
14
- elsif File.exist?(".svn")
15
- @source_control = Svn.new(options[:start_date])
16
- else
17
- raise "Churning requires a subversion or git repo"
18
- end
19
-
20
- @minimum_churn_count = options[:minimum_churn_count] || 5
21
- end
22
-
23
- def analyze
24
- @changes = parse_log_for_changes.reject! {|file, change_count| change_count < @minimum_churn_count}
25
- end
26
-
27
- private
28
-
29
- def parse_log_for_changes
30
- changes = {}
31
-
32
- logs = @source_control.get_logs
33
- logs.each do |line|
34
- changes[line] ? changes[line] += 1 : changes[line] = 1
35
- end
36
- changes
37
- end
38
-
39
-
40
- class SourceControl
41
- def initialize(start_date=nil)
42
- @start_date = start_date
43
- end
44
-
45
- private
46
- def require_rails_env
47
- # not sure if the following works because active_support might only be in vendor/rails
48
- # require 'activesupport'
49
- require RAILS_ROOT + '/config/environment'
50
- end
51
- end
52
-
53
- class Git < SourceControl
54
- def get_logs
55
- `git log #{date_range} --name-only --pretty=format:`.split(/\n/).reject{|line| line == ""}
56
- end
57
-
58
- private
59
- def date_range
60
- if @start_date
61
- require_rails_env
62
- "--after=#{@start_date.call.strftime('%Y-%m-%d')}"
63
- end
64
- end
65
-
66
- end
67
-
68
- class Svn < SourceControl
69
- def get_logs
70
- `svn log #{date_range} --verbose`.split(/\n/).map { |line| clean_up_svn_line(line) }.compact
71
- end
72
-
73
- private
74
- def date_range
75
- if @start_date
76
- require_rails_env
77
- "--revision {#{@start_date.call.strftime('%Y-%m-%d')}}:{#{Time.now.strftime('%Y-%m-%d')}}"
78
- end
79
- end
80
-
81
- def clean_up_svn_line(line)
82
- m = line.match(/\W*[A,M]\W+(\/.*)\b/)
83
- m ? m[1] : nil
84
- end
85
- end
86
-
87
- end
88
- end
@@ -1,17 +0,0 @@
1
- module MetricFu
2
-
3
- def self.generate_flay_report
4
- Flay.generate_report
5
- system("open #{Flay.metric_dir}/index.html") if open_in_browser?
6
- end
7
-
8
- class Flay < Base::Generator
9
-
10
- def analyze
11
- files_to_flay = MetricFu.flay[:dirs_to_flay].map{|dir| Dir[File.join(dir, "**/*.rb")] }
12
- output = `flay #{files_to_flay.join(" ")}`
13
- @matches = output.chomp.split("\n\n").map{|m| m.split("\n ") }
14
- end
15
-
16
- end
17
- end