flog 4.2.0 → 4.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/History.txt +7 -0
- data/README.txt +1 -0
- data/Rakefile +0 -2
- data/lib/flog.rb +2 -2
- data/test/test_flog.rb +31 -2
- metadata +90 -113
- metadata.gz.sig +0 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 5437bf1956f0917171e461fa6008b06c60b7582d
|
4
|
+
data.tar.gz: 36b784fd5cfe0a7d61c4d4be4e24aaff42b4f3b8
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 24306a923d5c1a3c27bd766de2c965ae4e48dfaa47120b95aff2226cbea42c35c9c1fed23c1e9181bf9a904b55046385d50da1d4c29dd2fdce466d241b61dc44
|
7
|
+
data.tar.gz: e4d1db182c4c534053682ac012f1716770ddae9017a68194a333aaedce12efe3e78c4e9e7eb4b8d3a46a16bfda7982aae50abf22b62048def4a83eea96f5bd78
|
checksums.yaml.gz.sig
ADDED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/History.txt
CHANGED
data/README.txt
CHANGED
data/Rakefile
CHANGED
data/lib/flog.rb
CHANGED
@@ -11,7 +11,7 @@ class File
|
|
11
11
|
end
|
12
12
|
|
13
13
|
class Flog < MethodBasedSexpProcessor
|
14
|
-
VERSION = "4.2.
|
14
|
+
VERSION = "4.2.1" # :nodoc:
|
15
15
|
|
16
16
|
##
|
17
17
|
# Cut off point where the report should stop unless --all given.
|
@@ -124,7 +124,7 @@ class Flog < MethodBasedSexpProcessor
|
|
124
124
|
|
125
125
|
def calculate
|
126
126
|
each_by_score threshold do |class_method, score, call_list|
|
127
|
-
klass = class_method.
|
127
|
+
klass = class_method.scan(/.+(?=#|::)/).first
|
128
128
|
|
129
129
|
method_scores[klass] << [class_method, score]
|
130
130
|
scores[klass] += score
|
data/test/test_flog.rb
CHANGED
@@ -540,8 +540,8 @@ class TestFlog < FlogTest
|
|
540
540
|
@flog.calculate_total_scores
|
541
541
|
@flog.calculate
|
542
542
|
|
543
|
-
assert_equal({ 'MyKlass' => 42.0 }, @flog.scores)
|
544
|
-
assert_equal({ 'MyKlass' => [["MyKlass::Base#mymethod", 42.0]] }, @flog.method_scores)
|
543
|
+
assert_equal({ 'MyKlass::Base' => 42.0 }, @flog.scores)
|
544
|
+
assert_equal({ 'MyKlass::Base' => [["MyKlass::Base#mymethod", 42.0]] }, @flog.method_scores)
|
545
545
|
end
|
546
546
|
|
547
547
|
def test_reset
|
@@ -588,6 +588,35 @@ class TestFlog < FlogTest
|
|
588
588
|
assert_equal({ "Coder" => 1.0 }, @flog.scores)
|
589
589
|
end
|
590
590
|
|
591
|
+
def test_method_scores
|
592
|
+
user_class = %(
|
593
|
+
module User
|
594
|
+
class Account
|
595
|
+
def blah n
|
596
|
+
puts "blah" * n
|
597
|
+
end
|
598
|
+
end
|
599
|
+
|
600
|
+
class Profile
|
601
|
+
def bleh n
|
602
|
+
puts "bleh" * n
|
603
|
+
end
|
604
|
+
end
|
605
|
+
end
|
606
|
+
)
|
607
|
+
user_file = "user.rb"
|
608
|
+
|
609
|
+
@flog.flog_ruby user_class, user_file
|
610
|
+
@flog.calculate_total_scores
|
611
|
+
@flog.calculate
|
612
|
+
|
613
|
+
expected = {
|
614
|
+
"User::Account"=>[["User::Account#blah", 2.2]],
|
615
|
+
"User::Profile"=>[["User::Profile#bleh", 2.2]]
|
616
|
+
}
|
617
|
+
assert_equal(expected, @flog.method_scores)
|
618
|
+
end
|
619
|
+
|
591
620
|
def setup_my_klass
|
592
621
|
@flog.class_stack << "Base" << "MyKlass"
|
593
622
|
@flog.method_stack << "mymethod"
|
metadata
CHANGED
@@ -1,19 +1,13 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: flog
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
prerelease:
|
6
|
-
segments:
|
7
|
-
- 4
|
8
|
-
- 2
|
9
|
-
- 0
|
10
|
-
version: 4.2.0
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 4.2.1
|
11
5
|
platform: ruby
|
12
|
-
authors:
|
6
|
+
authors:
|
13
7
|
- Ryan Davis
|
14
8
|
autorequire:
|
15
9
|
bindir: bin
|
16
|
-
cert_chain:
|
10
|
+
cert_chain:
|
17
11
|
- |
|
18
12
|
-----BEGIN CERTIFICATE-----
|
19
13
|
MIIDPjCCAiagAwIBAgIBATANBgkqhkiG9w0BAQUFADBFMRMwEQYDVQQDDApyeWFu
|
@@ -35,107 +29,99 @@ cert_chain:
|
|
35
29
|
Y4evBVezr3SjXz08vPqRO5YRdO3zfeMT8gBjRqZjWJGMZ2lD4XNfrs7eky74CyZw
|
36
30
|
xx3n58i0lQkBE1EpKE0lFu/y
|
37
31
|
-----END CERTIFICATE-----
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
- !ruby/object:Gem::Dependency
|
32
|
+
date: 2014-05-30 00:00:00.000000000 Z
|
33
|
+
dependencies:
|
34
|
+
- !ruby/object:Gem::Dependency
|
42
35
|
name: sexp_processor
|
43
|
-
|
44
|
-
|
45
|
-
none: false
|
46
|
-
requirements:
|
36
|
+
requirement: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
47
38
|
- - ~>
|
48
|
-
- !ruby/object:Gem::Version
|
49
|
-
|
50
|
-
segments:
|
51
|
-
- 4
|
52
|
-
- 4
|
53
|
-
version: "4.4"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '4.4'
|
54
41
|
type: :runtime
|
55
|
-
version_requirements: *id001
|
56
|
-
- !ruby/object:Gem::Dependency
|
57
|
-
name: ruby_parser
|
58
42
|
prerelease: false
|
59
|
-
|
60
|
-
|
61
|
-
requirements:
|
43
|
+
version_requirements: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
62
45
|
- - ~>
|
63
|
-
- !ruby/object:Gem::Version
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
- -
|
70
|
-
- !ruby/object:Gem::Version
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
- 1
|
75
|
-
- 0
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '4.4'
|
48
|
+
- !ruby/object:Gem::Dependency
|
49
|
+
name: ruby_parser
|
50
|
+
requirement: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ~>
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '3.1'
|
55
|
+
- - '>'
|
56
|
+
- !ruby/object:Gem::Version
|
76
57
|
version: 3.1.0
|
77
58
|
type: :runtime
|
78
|
-
version_requirements: *id002
|
79
|
-
- !ruby/object:Gem::Dependency
|
80
|
-
name: minitest
|
81
59
|
prerelease: false
|
82
|
-
|
83
|
-
|
84
|
-
requirements:
|
60
|
+
version_requirements: !ruby/object:Gem::Requirement
|
61
|
+
requirements:
|
85
62
|
- - ~>
|
86
|
-
- !ruby/object:Gem::Version
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
63
|
+
- !ruby/object:Gem::Version
|
64
|
+
version: '3.1'
|
65
|
+
- - '>'
|
66
|
+
- !ruby/object:Gem::Version
|
67
|
+
version: 3.1.0
|
68
|
+
- !ruby/object:Gem::Dependency
|
69
|
+
name: minitest
|
70
|
+
requirement: !ruby/object:Gem::Requirement
|
71
|
+
requirements:
|
72
|
+
- - ~>
|
73
|
+
- !ruby/object:Gem::Version
|
74
|
+
version: '5.3'
|
92
75
|
type: :development
|
93
|
-
version_requirements: *id003
|
94
|
-
- !ruby/object:Gem::Dependency
|
95
|
-
name: rdoc
|
96
76
|
prerelease: false
|
97
|
-
|
98
|
-
|
99
|
-
requirements:
|
77
|
+
version_requirements: !ruby/object:Gem::Requirement
|
78
|
+
requirements:
|
100
79
|
- - ~>
|
101
|
-
- !ruby/object:Gem::Version
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
80
|
+
- !ruby/object:Gem::Version
|
81
|
+
version: '5.3'
|
82
|
+
- !ruby/object:Gem::Dependency
|
83
|
+
name: rdoc
|
84
|
+
requirement: !ruby/object:Gem::Requirement
|
85
|
+
requirements:
|
86
|
+
- - ~>
|
87
|
+
- !ruby/object:Gem::Version
|
88
|
+
version: '4.0'
|
107
89
|
type: :development
|
108
|
-
version_requirements: *id004
|
109
|
-
- !ruby/object:Gem::Dependency
|
110
|
-
name: hoe
|
111
90
|
prerelease: false
|
112
|
-
|
113
|
-
|
114
|
-
|
91
|
+
version_requirements: !ruby/object:Gem::Requirement
|
92
|
+
requirements:
|
93
|
+
- - ~>
|
94
|
+
- !ruby/object:Gem::Version
|
95
|
+
version: '4.0'
|
96
|
+
- !ruby/object:Gem::Dependency
|
97
|
+
name: hoe
|
98
|
+
requirement: !ruby/object:Gem::Requirement
|
99
|
+
requirements:
|
115
100
|
- - ~>
|
116
|
-
- !ruby/object:Gem::Version
|
117
|
-
|
118
|
-
segments:
|
119
|
-
- 3
|
120
|
-
- 7
|
121
|
-
version: "3.7"
|
101
|
+
- !ruby/object:Gem::Version
|
102
|
+
version: '3.12'
|
122
103
|
type: :development
|
123
|
-
|
104
|
+
prerelease: false
|
105
|
+
version_requirements: !ruby/object:Gem::Requirement
|
106
|
+
requirements:
|
107
|
+
- - ~>
|
108
|
+
- !ruby/object:Gem::Version
|
109
|
+
version: '3.12'
|
124
110
|
description: |-
|
125
111
|
Flog reports the most tortured code in an easy to read pain
|
126
112
|
report. The higher the score, the more pain the code is in.
|
127
|
-
email:
|
113
|
+
email:
|
128
114
|
- ryand-ruby@zenspider.com
|
129
|
-
executables:
|
115
|
+
executables:
|
130
116
|
- flog
|
131
117
|
extensions: []
|
132
|
-
|
133
|
-
extra_rdoc_files:
|
118
|
+
extra_rdoc_files:
|
134
119
|
- History.txt
|
135
120
|
- Manifest.txt
|
136
121
|
- README.txt
|
137
|
-
files:
|
122
|
+
files:
|
138
123
|
- .autotest
|
124
|
+
- .gemtest
|
139
125
|
- History.txt
|
140
126
|
- Manifest.txt
|
141
127
|
- README.txt
|
@@ -147,41 +133,32 @@ files:
|
|
147
133
|
- lib/gauntlet_flog.rb
|
148
134
|
- test/test_flog.rb
|
149
135
|
- test/test_flog_cli.rb
|
150
|
-
- .gemtest
|
151
136
|
homepage: http://ruby.sadi.st/
|
152
|
-
licenses:
|
137
|
+
licenses:
|
153
138
|
- MIT
|
139
|
+
metadata: {}
|
154
140
|
post_install_message:
|
155
|
-
rdoc_options:
|
141
|
+
rdoc_options:
|
156
142
|
- --main
|
157
143
|
- README.txt
|
158
|
-
require_paths:
|
144
|
+
require_paths:
|
159
145
|
- lib
|
160
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
none: false
|
171
|
-
requirements:
|
172
|
-
- - ">="
|
173
|
-
- !ruby/object:Gem::Version
|
174
|
-
hash: 3
|
175
|
-
segments:
|
176
|
-
- 0
|
177
|
-
version: "0"
|
146
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
147
|
+
requirements:
|
148
|
+
- - '>='
|
149
|
+
- !ruby/object:Gem::Version
|
150
|
+
version: '0'
|
151
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
152
|
+
requirements:
|
153
|
+
- - '>='
|
154
|
+
- !ruby/object:Gem::Version
|
155
|
+
version: '0'
|
178
156
|
requirements: []
|
179
|
-
|
180
|
-
|
181
|
-
rubygems_version: 1.8.25
|
157
|
+
rubyforge_project:
|
158
|
+
rubygems_version: 2.2.1
|
182
159
|
signing_key:
|
183
|
-
specification_version:
|
160
|
+
specification_version: 4
|
184
161
|
summary: Flog reports the most tortured code in an easy to read pain report
|
185
|
-
test_files:
|
162
|
+
test_files:
|
186
163
|
- test/test_flog.rb
|
187
164
|
- test/test_flog_cli.rb
|
metadata.gz.sig
CHANGED
Binary file
|