metric_fu 2.1.4.pre2 → 2.1.4.pre4
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.
- data/bin/mf-churn +11 -0
- data/bin/mf-flay +11 -0
- data/bin/mf-rails_best_practices +10 -0
- data/bin/mf-reek +11 -0
- data/bin/mf-roodi +11 -0
- data/bin/mf-stats +7 -0
- data/lib/metric_fu/metrics/churn/churn.rb +1 -1
- data/lib/metric_fu/metrics/churn/init.rb +1 -1
- data/lib/metric_fu/metrics/flay/flay.rb +1 -1
- data/lib/metric_fu/metrics/flog/flog.rb +12 -1
- data/lib/metric_fu/metrics/rails_best_practices/init.rb +3 -1
- data/lib/metric_fu/metrics/rails_best_practices/rails_best_practices.rb +1 -2
- data/lib/metric_fu/metrics/reek/reek.rb +1 -1
- data/lib/metric_fu/metrics/roodi/roodi.rb +1 -1
- data/lib/metric_fu/metrics/stats/stats.rb +1 -1
- data/lib/metric_fu/version.rb +1 -1
- data/lib/metric_fu_requires.rb +40 -0
- data/metric_fu.gemspec +12 -10
- data/spec/metric_fu/configuration_spec.rb +1 -1
- data/spec/metric_fu/metrics/flay/flay_spec.rb +2 -2
- data/spec/metric_fu/metrics/rails_best_practices/rails_best_practices_spec.rb +1 -1
- data/spec/metric_fu/metrics/stats/stats_spec.rb +1 -1
- metadata +45 -10
data/bin/mf-churn
ADDED
@@ -0,0 +1,11 @@
|
|
1
|
+
#!/usr/bin/env ruby_noexec_wrapper
|
2
|
+
require 'rubygems'
|
3
|
+
|
4
|
+
|
5
|
+
require 'metric_fu_requires'
|
6
|
+
|
7
|
+
gem 'ruby2ruby', MetricFu::MetricVersion.ruby2ruby
|
8
|
+
gem 'ruby_parser', MetricFu::MetricVersion.ruby_parser
|
9
|
+
version = MetricFu::MetricVersion.churn
|
10
|
+
gem 'churn', version
|
11
|
+
load Gem.bin_path('churn', 'churn', version)
|
data/bin/mf-flay
ADDED
@@ -0,0 +1,11 @@
|
|
1
|
+
#!/usr/bin/env ruby_noexec_wrapper
|
2
|
+
require 'rubygems'
|
3
|
+
|
4
|
+
|
5
|
+
require 'metric_fu_requires'
|
6
|
+
|
7
|
+
gem 'ruby2ruby', MetricFu::MetricVersion.ruby2ruby
|
8
|
+
gem 'ruby_parser', MetricFu::MetricVersion.ruby_parser
|
9
|
+
version = MetricFu::MetricVersion.flay
|
10
|
+
gem 'flay', version
|
11
|
+
load Gem.bin_path('flay', 'flay', version)
|
@@ -0,0 +1,10 @@
|
|
1
|
+
#!/usr/bin/env ruby_noexec_wrapper
|
2
|
+
require 'rubygems'
|
3
|
+
|
4
|
+
|
5
|
+
require 'metric_fu_requires'
|
6
|
+
|
7
|
+
gem 'sexp_processor', MetricFu::MetricVersion.sexp_processor
|
8
|
+
version = MetricFu::MetricVersion.rails_best_practices
|
9
|
+
gem 'rails_best_practices', version
|
10
|
+
load Gem.bin_path('rails_best_practices', 'rails_best_practices', version)
|
data/bin/mf-reek
ADDED
@@ -0,0 +1,11 @@
|
|
1
|
+
#!/usr/bin/env ruby_noexec_wrapper
|
2
|
+
require 'rubygems'
|
3
|
+
|
4
|
+
|
5
|
+
require 'metric_fu_requires'
|
6
|
+
|
7
|
+
gem 'ruby2ruby', MetricFu::MetricVersion.ruby2ruby
|
8
|
+
gem 'ruby_parser', MetricFu::MetricVersion.ruby_parser
|
9
|
+
version = MetricFu::MetricVersion.reek
|
10
|
+
gem 'reek', version
|
11
|
+
load Gem.bin_path('reek', 'reek', version)
|
data/bin/mf-roodi
ADDED
@@ -0,0 +1,11 @@
|
|
1
|
+
#!/usr/bin/env ruby_noexec_wrapper
|
2
|
+
require 'rubygems'
|
3
|
+
|
4
|
+
|
5
|
+
require 'metric_fu_requires'
|
6
|
+
|
7
|
+
gem 'ruby2ruby', MetricFu::MetricVersion.ruby2ruby
|
8
|
+
gem 'ruby_parser', MetricFu::MetricVersion.ruby_parser
|
9
|
+
version = MetricFu::MetricVersion.roodi
|
10
|
+
gem 'metric_fu-roodi', version
|
11
|
+
load Gem.bin_path('metric_fu-roodi', 'metric_fu-roodi', version)
|
data/bin/mf-stats
ADDED
@@ -7,7 +7,7 @@ module MetricFu
|
|
7
7
|
def emit
|
8
8
|
mimimum_score_parameter = MetricFu.flay[:minimum_score] ? "--mass #{MetricFu.flay[:minimum_score]} " : ""
|
9
9
|
|
10
|
-
command = %Q(flay #{mimimum_score_parameter} #{MetricFu.flay[:dirs_to_flay].join(" ")})
|
10
|
+
command = %Q(mf-flay #{mimimum_score_parameter} #{MetricFu.flay[:dirs_to_flay].join(" ")})
|
11
11
|
mf_debug "** #{command}"
|
12
12
|
@output = `#{command}`
|
13
13
|
end
|
@@ -1,7 +1,18 @@
|
|
1
1
|
require 'pathname'
|
2
2
|
require 'optparse'
|
3
3
|
require 'flog'
|
4
|
-
|
4
|
+
class RubyParser
|
5
|
+
alias_method :original_process, :process
|
6
|
+
def process(s,f,t)
|
7
|
+
original_process(s,f,t)
|
8
|
+
rescue => e
|
9
|
+
if e.message =~ /wrong number of arguments/
|
10
|
+
original_process(s,f)
|
11
|
+
else
|
12
|
+
raise
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
5
16
|
module MetricFu
|
6
17
|
|
7
18
|
class Flog < Generator
|
@@ -1,5 +1,7 @@
|
|
1
1
|
MetricFu::Configuration.run do |config|
|
2
|
-
if
|
2
|
+
if RUBY_VERSION < '1.9'
|
3
|
+
config.mf_debug "rails_best_practices is not compatible with #{RUBY_VERSION}"
|
4
|
+
elsif config.rails?
|
3
5
|
config.add_metric(:rails_best_practices)
|
4
6
|
config.add_graph(:rails_best_practices)
|
5
7
|
config.configure_metric(:rails_best_practices, {})
|
@@ -1,8 +1,7 @@
|
|
1
1
|
module MetricFu
|
2
2
|
class RailsBestPractices < Generator
|
3
|
-
VERSION = '1.13.2'
|
4
3
|
def emit
|
5
|
-
command = %Q(rails_best_practices
|
4
|
+
command = %Q(mf-rails_best_practices --without-color .)
|
6
5
|
mf_debug "** #{command}"
|
7
6
|
@output = `#{command}`
|
8
7
|
end
|
@@ -7,7 +7,7 @@ module MetricFu
|
|
7
7
|
files_to_reek = MetricFu.reek[:dirs_to_reek].map{|dir| Dir[File.join(dir, "**/*.rb")] }
|
8
8
|
files = remove_excluded_files(files_to_reek.flatten)
|
9
9
|
config_file_param = MetricFu.reek[:config_file_pattern] ? "--config #{MetricFu.reek[:config_file_pattern]}" : ''
|
10
|
-
command = %Q(reek #{config_file_param} #{files.join(" ")})
|
10
|
+
command = %Q(mf-reek #{config_file_param} #{files.join(" ")})
|
11
11
|
mf_debug "** #{command}"
|
12
12
|
@output = `#{command}`
|
13
13
|
@output = massage_for_reek_12 if reek_12?
|
@@ -5,7 +5,7 @@ module MetricFu
|
|
5
5
|
files_to_analyze = MetricFu.roodi[:dirs_to_roodi].map{|dir| Dir[File.join(dir, "**/*.rb")] }
|
6
6
|
files = remove_excluded_files(files_to_analyze.flatten)
|
7
7
|
config = MetricFu.roodi[:roodi_config] ? "-config=#{MetricFu.roodi[:roodi_config]}" : ""
|
8
|
-
command = %Q(
|
8
|
+
command = %Q(mf-roodi #{config} #{files.join(" ")})
|
9
9
|
mf_debug "** #{command}"
|
10
10
|
@output = `#{command}`
|
11
11
|
end
|
data/lib/metric_fu/version.rb
CHANGED
@@ -0,0 +1,40 @@
|
|
1
|
+
module MetricFu
|
2
|
+
module MetricVersion
|
3
|
+
extend self
|
4
|
+
def reek
|
5
|
+
'1.3.1'
|
6
|
+
end
|
7
|
+
def flog
|
8
|
+
'3.2.2'
|
9
|
+
end
|
10
|
+
def flay
|
11
|
+
'2.0.1'
|
12
|
+
end
|
13
|
+
def churn
|
14
|
+
'0.0.28'
|
15
|
+
end
|
16
|
+
def roodi
|
17
|
+
'2.2.1'
|
18
|
+
end
|
19
|
+
def rails_best_practices
|
20
|
+
'1.13.2'
|
21
|
+
end
|
22
|
+
|
23
|
+
def ruby2ruby
|
24
|
+
'2.0.2'
|
25
|
+
end
|
26
|
+
def ruby_parser
|
27
|
+
'3.1.1'
|
28
|
+
end
|
29
|
+
def sexp_processor
|
30
|
+
'~> 4.0'
|
31
|
+
end
|
32
|
+
|
33
|
+
def rcov
|
34
|
+
'~> 0.8'
|
35
|
+
end
|
36
|
+
def saikuro
|
37
|
+
'>= 1.1.1.0'
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
data/metric_fu.gemspec
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
2
|
$:.push File.expand_path("../lib", __FILE__)
|
3
3
|
require 'metric_fu/version'
|
4
|
+
require 'metric_fu_requires'
|
4
5
|
|
5
6
|
Gem::Specification.new do |s|
|
6
7
|
s.name = "metric_fu"
|
@@ -21,20 +22,21 @@ Gem::Specification.new do |s|
|
|
21
22
|
s.license = 'MIT'
|
22
23
|
|
23
24
|
{
|
24
|
-
"rails_best_practices" => ["=
|
25
|
-
"rcov" => ["
|
25
|
+
"rails_best_practices" => ["= #{MetricFu::MetricVersion.rails_best_practices}"],
|
26
|
+
"rcov" => ["#{MetricFu::MetricVersion.rcov}"],
|
26
27
|
# still using rcov in ruby 1.9 till some errors are fleshed out
|
27
28
|
# "simplecov" => [">= 0.5.4"],
|
28
29
|
# "simplecov-rcov" => [">= 0.2.3"],
|
29
|
-
"japgolly-Saikuro" => ["
|
30
|
-
"metric_fu-roodi" => [">=
|
31
|
-
"flay" => ["=
|
32
|
-
"flog" => ["=
|
33
|
-
"reek" => ["=
|
34
|
-
"churn" => ["=
|
30
|
+
"japgolly-Saikuro" => ["#{MetricFu::MetricVersion.saikuro}"],
|
31
|
+
"metric_fu-roodi" => [">= #{MetricFu::MetricVersion.roodi}"],
|
32
|
+
"flay" => ["= #{MetricFu::MetricVersion.flay}"],
|
33
|
+
"flog" => ["= #{MetricFu::MetricVersion.flog}"],
|
34
|
+
"reek" => ["= #{MetricFu::MetricVersion.reek}"],
|
35
|
+
"churn" => ["= #{MetricFu::MetricVersion.churn}"],
|
35
36
|
# specifying dependencies for flay, reek, churn, and flog
|
36
|
-
"ruby_parser" => ["~> 3.0.
|
37
|
-
"sexp_processor" => ["
|
37
|
+
"ruby_parser" => ["~> 3.0", ">= #{MetricFu::MetricVersion.ruby_parser}"],
|
38
|
+
"sexp_processor" => ["#{MetricFu::MetricVersion.sexp_processor}"],
|
39
|
+
"ruby2ruby" => ["= #{MetricFu::MetricVersion.ruby2ruby}"],
|
38
40
|
"activesupport" => [">= 2.0.0"], # ok
|
39
41
|
"coderay" => [],
|
40
42
|
"fattr" => ["= 2.2.1"],
|
@@ -122,7 +122,7 @@ describe MetricFu::Configuration do
|
|
122
122
|
it 'should set @churn to {}' do
|
123
123
|
load_metric 'churn'
|
124
124
|
@config.instance_variable_get(:@churn).
|
125
|
-
should == { :start_date => "1 year ago", :minimum_churn_count => 10}
|
125
|
+
should == { :start_date => %q("1 year ago"), :minimum_churn_count => 10}
|
126
126
|
end
|
127
127
|
|
128
128
|
|
@@ -7,7 +7,7 @@ describe Flay do
|
|
7
7
|
File.stub!(:directory?).and_return(true)
|
8
8
|
@flay = MetricFu::Flay.new('base_dir')
|
9
9
|
|
10
|
-
@flay.should_receive(:`).with("flay app lib")
|
10
|
+
@flay.should_receive(:`).with("mf-flay app lib")
|
11
11
|
output = @flay.emit
|
12
12
|
end
|
13
13
|
|
@@ -16,7 +16,7 @@ describe Flay do
|
|
16
16
|
File.stub!(:directory?).and_return(true)
|
17
17
|
@flay = MetricFu::Flay.new('base_dir')
|
18
18
|
|
19
|
-
@flay.should_receive(:`).with("flay --mass 99 ")
|
19
|
+
@flay.should_receive(:`).with("mf-flay --mass 99 ")
|
20
20
|
output = @flay.emit
|
21
21
|
end
|
22
22
|
end
|
@@ -5,7 +5,7 @@ describe RailsBestPractices do
|
|
5
5
|
it "should gather the raw data" do
|
6
6
|
MetricFu::Configuration.run {}
|
7
7
|
practices = MetricFu::RailsBestPractices.new
|
8
|
-
practices.should_receive(:`).with("rails_best_practices
|
8
|
+
practices.should_receive(:`).with("mf-rails_best_practices --without-color .")
|
9
9
|
practices.emit
|
10
10
|
end
|
11
11
|
end
|
@@ -7,7 +7,7 @@ describe Stats do
|
|
7
7
|
MetricFu.configure.reset
|
8
8
|
File.stub!(:directory?).and_return(true)
|
9
9
|
stats = MetricFu::Stats.new
|
10
|
-
stats.should_receive(:`).with("
|
10
|
+
stats.should_receive(:`).with("mf-stats > tmp/metric_fu/scratch/stats/stats.txt")
|
11
11
|
stats.emit
|
12
12
|
end
|
13
13
|
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: 2.1.4.
|
4
|
+
version: 2.1.4.pre4
|
5
5
|
prerelease: 6
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -19,7 +19,7 @@ authors:
|
|
19
19
|
autorequire:
|
20
20
|
bindir: bin
|
21
21
|
cert_chain: []
|
22
|
-
date: 2013-
|
22
|
+
date: 2013-02-03 00:00:00.000000000 Z
|
23
23
|
dependencies:
|
24
24
|
- !ruby/object:Gem::Dependency
|
25
25
|
name: rails_best_practices
|
@@ -76,7 +76,7 @@ dependencies:
|
|
76
76
|
requirements:
|
77
77
|
- - ! '>='
|
78
78
|
- !ruby/object:Gem::Version
|
79
|
-
version: 2.2.
|
79
|
+
version: 2.2.1
|
80
80
|
type: :runtime
|
81
81
|
prerelease: false
|
82
82
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -84,7 +84,7 @@ dependencies:
|
|
84
84
|
requirements:
|
85
85
|
- - ! '>='
|
86
86
|
- !ruby/object:Gem::Version
|
87
|
-
version: 2.2.
|
87
|
+
version: 2.2.1
|
88
88
|
- !ruby/object:Gem::Dependency
|
89
89
|
name: flay
|
90
90
|
requirement: !ruby/object:Gem::Requirement
|
@@ -108,7 +108,7 @@ dependencies:
|
|
108
108
|
requirements:
|
109
109
|
- - '='
|
110
110
|
- !ruby/object:Gem::Version
|
111
|
-
version: 3.2.
|
111
|
+
version: 3.2.2
|
112
112
|
type: :runtime
|
113
113
|
prerelease: false
|
114
114
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -116,7 +116,7 @@ dependencies:
|
|
116
116
|
requirements:
|
117
117
|
- - '='
|
118
118
|
- !ruby/object:Gem::Version
|
119
|
-
version: 3.2.
|
119
|
+
version: 3.2.2
|
120
120
|
- !ruby/object:Gem::Dependency
|
121
121
|
name: reek
|
122
122
|
requirement: !ruby/object:Gem::Requirement
|
@@ -124,7 +124,7 @@ dependencies:
|
|
124
124
|
requirements:
|
125
125
|
- - '='
|
126
126
|
- !ruby/object:Gem::Version
|
127
|
-
version:
|
127
|
+
version: 1.3.1
|
128
128
|
type: :runtime
|
129
129
|
prerelease: false
|
130
130
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -132,7 +132,7 @@ dependencies:
|
|
132
132
|
requirements:
|
133
133
|
- - '='
|
134
134
|
- !ruby/object:Gem::Version
|
135
|
-
version:
|
135
|
+
version: 1.3.1
|
136
136
|
- !ruby/object:Gem::Dependency
|
137
137
|
name: churn
|
138
138
|
requirement: !ruby/object:Gem::Requirement
|
@@ -156,7 +156,10 @@ dependencies:
|
|
156
156
|
requirements:
|
157
157
|
- - ~>
|
158
158
|
- !ruby/object:Gem::Version
|
159
|
-
version: 3.0
|
159
|
+
version: '3.0'
|
160
|
+
- - ! '>='
|
161
|
+
- !ruby/object:Gem::Version
|
162
|
+
version: 3.1.1
|
160
163
|
type: :runtime
|
161
164
|
prerelease: false
|
162
165
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -164,7 +167,10 @@ dependencies:
|
|
164
167
|
requirements:
|
165
168
|
- - ~>
|
166
169
|
- !ruby/object:Gem::Version
|
167
|
-
version: 3.0
|
170
|
+
version: '3.0'
|
171
|
+
- - ! '>='
|
172
|
+
- !ruby/object:Gem::Version
|
173
|
+
version: 3.1.1
|
168
174
|
- !ruby/object:Gem::Dependency
|
169
175
|
name: sexp_processor
|
170
176
|
requirement: !ruby/object:Gem::Requirement
|
@@ -181,6 +187,22 @@ dependencies:
|
|
181
187
|
- - ~>
|
182
188
|
- !ruby/object:Gem::Version
|
183
189
|
version: '4.0'
|
190
|
+
- !ruby/object:Gem::Dependency
|
191
|
+
name: ruby2ruby
|
192
|
+
requirement: !ruby/object:Gem::Requirement
|
193
|
+
none: false
|
194
|
+
requirements:
|
195
|
+
- - '='
|
196
|
+
- !ruby/object:Gem::Version
|
197
|
+
version: 2.0.2
|
198
|
+
type: :runtime
|
199
|
+
prerelease: false
|
200
|
+
version_requirements: !ruby/object:Gem::Requirement
|
201
|
+
none: false
|
202
|
+
requirements:
|
203
|
+
- - '='
|
204
|
+
- !ruby/object:Gem::Version
|
205
|
+
version: 2.0.2
|
184
206
|
- !ruby/object:Gem::Dependency
|
185
207
|
name: activesupport
|
186
208
|
requirement: !ruby/object:Gem::Requirement
|
@@ -298,6 +320,12 @@ description: Code metrics from Flog, Flay, RCov, Saikuro, Churn, Reek, Roodi, Ra
|
|
298
320
|
email: github@benjaminfleischer.com
|
299
321
|
executables:
|
300
322
|
- metric_fu
|
323
|
+
- mf-churn
|
324
|
+
- mf-flay
|
325
|
+
- mf-rails_best_practices
|
326
|
+
- mf-reek
|
327
|
+
- mf-roodi
|
328
|
+
- mf-stats
|
301
329
|
extensions: []
|
302
330
|
extra_rdoc_files: []
|
303
331
|
files:
|
@@ -312,6 +340,12 @@ files:
|
|
312
340
|
- Rakefile
|
313
341
|
- TODO.md
|
314
342
|
- bin/metric_fu
|
343
|
+
- bin/mf-churn
|
344
|
+
- bin/mf-flay
|
345
|
+
- bin/mf-rails_best_practices
|
346
|
+
- bin/mf-reek
|
347
|
+
- bin/mf-roodi
|
348
|
+
- bin/mf-stats
|
315
349
|
- config/roodi_config.yml
|
316
350
|
- home_page/back_all.jpg
|
317
351
|
- home_page/churn.gif
|
@@ -426,6 +460,7 @@ files:
|
|
426
460
|
- lib/metric_fu/run.rb
|
427
461
|
- lib/metric_fu/tasks/metric_fu.rake
|
428
462
|
- lib/metric_fu/version.rb
|
463
|
+
- lib/metric_fu_requires.rb
|
429
464
|
- metric_fu.gemspec
|
430
465
|
- spec/metric_fu/configuration_spec.rb
|
431
466
|
- spec/metric_fu/data_structures/line_numbers_spec.rb
|