flog 4.2.0 → 4.2.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -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
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -1,3 +1,10 @@
1
+ === 4.2.1 / 2014-05-29
2
+
3
+ * 2 bug fixes:
4
+
5
+ * Fixed grouping by class name. (guilhermesimoes)
6
+ * Removed dead rubyforge setting in Rakefile
7
+
1
8
  === 4.2.0 / 2013-10-18
2
9
 
3
10
  * 3 minor enhancements:
data/README.txt CHANGED
@@ -3,6 +3,7 @@
3
3
  home :: http://ruby.sadi.st/
4
4
  code :: https://github.com/seattlerb/flog
5
5
  rdoc :: http://seattlerb.rubyforge.org/flog
6
+ vim :: http://github.com/sentientmonkey/vim-flog
6
7
 
7
8
  == DESCRIPTION:
8
9
 
data/Rakefile CHANGED
@@ -15,8 +15,6 @@ Hoe.plugin :seattlerb
15
15
  Hoe.spec 'flog' do
16
16
  developer 'Ryan Davis', 'ryand-ruby@zenspider.com'
17
17
 
18
- self.rubyforge_name = 'seattlerb'
19
-
20
18
  self.flog_method = :max_method
21
19
  self.flog_threshold = timebomb 150, 50, '2013-11-01', '2012-11-01'
22
20
 
@@ -11,7 +11,7 @@ class File
11
11
  end
12
12
 
13
13
  class Flog < MethodBasedSexpProcessor
14
- VERSION = "4.2.0" # :nodoc:
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.split(/#|::/).first
127
+ klass = class_method.scan(/.+(?=#|::)/).first
128
128
 
129
129
  method_scores[klass] << [class_method, score]
130
130
  scores[klass] += score
@@ -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
- hash: 55
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
- date: 2013-10-18 00:00:00 Z
40
- dependencies:
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
- prerelease: false
44
- requirement: &id001 !ruby/object:Gem::Requirement
45
- none: false
46
- requirements:
36
+ requirement: !ruby/object:Gem::Requirement
37
+ requirements:
47
38
  - - ~>
48
- - !ruby/object:Gem::Version
49
- hash: 19
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
- requirement: &id002 !ruby/object:Gem::Requirement
60
- none: false
61
- requirements:
43
+ version_requirements: !ruby/object:Gem::Requirement
44
+ requirements:
62
45
  - - ~>
63
- - !ruby/object:Gem::Version
64
- hash: 5
65
- segments:
66
- - 3
67
- - 1
68
- version: "3.1"
69
- - - ">"
70
- - !ruby/object:Gem::Version
71
- hash: 3
72
- segments:
73
- - 3
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
- requirement: &id003 !ruby/object:Gem::Requirement
83
- none: false
84
- requirements:
60
+ version_requirements: !ruby/object:Gem::Requirement
61
+ requirements:
85
62
  - - ~>
86
- - !ruby/object:Gem::Version
87
- hash: 31
88
- segments:
89
- - 5
90
- - 0
91
- version: "5.0"
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
- requirement: &id004 !ruby/object:Gem::Requirement
98
- none: false
99
- requirements:
77
+ version_requirements: !ruby/object:Gem::Requirement
78
+ requirements:
100
79
  - - ~>
101
- - !ruby/object:Gem::Version
102
- hash: 27
103
- segments:
104
- - 4
105
- - 0
106
- version: "4.0"
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
- requirement: &id005 !ruby/object:Gem::Requirement
113
- none: false
114
- requirements:
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
- hash: 9
118
- segments:
119
- - 3
120
- - 7
121
- version: "3.7"
101
+ - !ruby/object:Gem::Version
102
+ version: '3.12'
122
103
  type: :development
123
- version_requirements: *id005
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
- none: false
162
- requirements:
163
- - - ">="
164
- - !ruby/object:Gem::Version
165
- hash: 3
166
- segments:
167
- - 0
168
- version: "0"
169
- required_rubygems_version: !ruby/object:Gem::Requirement
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
- rubyforge_project: seattlerb
181
- rubygems_version: 1.8.25
157
+ rubyforge_project:
158
+ rubygems_version: 2.2.1
182
159
  signing_key:
183
- specification_version: 3
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