flog 2.0.0 → 2.1.0

Sign up to get free protection for your applications and to get access to all the features.
metadata CHANGED
@@ -1,15 +1,36 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: flog
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Davis
8
8
  autorequire:
9
9
  bindir: bin
10
- cert_chain: []
10
+ cert_chain:
11
+ - |
12
+ -----BEGIN CERTIFICATE-----
13
+ MIIDPjCCAiagAwIBAgIBADANBgkqhkiG9w0BAQUFADBFMRMwEQYDVQQDDApyeWFu
14
+ ZC1ydWJ5MRkwFwYKCZImiZPyLGQBGRYJemVuc3BpZGVyMRMwEQYKCZImiZPyLGQB
15
+ GRYDY29tMB4XDTA5MDMwNjE4NTMxNVoXDTEwMDMwNjE4NTMxNVowRTETMBEGA1UE
16
+ AwwKcnlhbmQtcnVieTEZMBcGCgmSJomT8ixkARkWCXplbnNwaWRlcjETMBEGCgmS
17
+ JomT8ixkARkWA2NvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALda
18
+ b9DCgK+627gPJkB6XfjZ1itoOQvpqH1EXScSaba9/S2VF22VYQbXU1xQXL/WzCkx
19
+ taCPaLmfYIaFcHHCSY4hYDJijRQkLxPeB3xbOfzfLoBDbjvx5JxgJxUjmGa7xhcT
20
+ oOvjtt5P8+GSK9zLzxQP0gVLS/D0FmoE44XuDr3iQkVS2ujU5zZL84mMNqNB1znh
21
+ GiadM9GHRaDiaxuX0cIUBj19T01mVE2iymf9I6bEsiayK/n6QujtyCbTWsAS9Rqt
22
+ qhtV7HJxNKuPj/JFH0D2cswvzznE/a5FOYO68g+YCuFi5L8wZuuM8zzdwjrWHqSV
23
+ gBEfoTEGr7Zii72cx+sCAwEAAaM5MDcwCQYDVR0TBAIwADALBgNVHQ8EBAMCBLAw
24
+ HQYDVR0OBBYEFEfFe9md/r/tj/Wmwpy+MI8d9k/hMA0GCSqGSIb3DQEBBQUAA4IB
25
+ AQAY59gYvDxqSqgC92nAP9P8dnGgfZgLxP237xS6XxFGJSghdz/nI6pusfCWKM8m
26
+ vzjjH2wUMSSf3tNudQ3rCGLf2epkcU13/rguI88wO6MrE0wi4ZqLQX+eZQFskJb/
27
+ w6x9W1ur8eR01s397LSMexySDBrJOh34cm2AlfKr/jokKCTwcM0OvVZnAutaovC0
28
+ l1SVZ0ecg88bsWHA0Yhh7NFxK1utWoIhtB6AFC/+trM0FQEB/jZkIS8SaNzn96Rl
29
+ n0sZEf77FLf5peR8TP/PtmIg7Cyqz23sLM4mCOoTGIy5OcZ8TdyiyINUHtb5ej/T
30
+ FBHgymkyj/AOSqKRIpXPhjC6
31
+ -----END CERTIFICATE-----
11
32
 
12
- date: 2009-01-20 00:00:00 -08:00
33
+ date: 2009-03-16 00:00:00 -07:00
13
34
  default_executable:
14
35
  dependencies:
15
36
  - !ruby/object:Gem::Dependency
@@ -40,7 +61,7 @@ dependencies:
40
61
  requirements:
41
62
  - - ">="
42
63
  - !ruby/object:Gem::Version
43
- version: 1.8.2
64
+ version: 1.11.0
44
65
  version:
45
66
  description: Flog reports the most tortured code in an easy to read pain report. The higher the score, the more pain the code is in.
46
67
  email:
@@ -61,14 +82,10 @@ files:
61
82
  - bin/flog
62
83
  - gem_updater.rb
63
84
  - lib/flog.rb
85
+ - lib/flog_task.rb
64
86
  - lib/gauntlet_flog.rb
65
87
  - unpack.rb
66
88
  - update_scores.rb
67
- - spec/flog_command_spec.rb
68
- - spec/flog_integration_spec.rb
69
- - spec/flog_spec.rb
70
- - spec/spec.opts
71
- - spec/spec_helper.rb
72
89
  - spec_fixtures/collection/bigger_example/acts/date_range.rb
73
90
  - spec_fixtures/collection/bigger_example/acts/range.rb
74
91
  - spec_fixtures/collection/bigger_example/association_extensions/date_ranged.rb
@@ -80,6 +97,10 @@ files:
80
97
  - spec_fixtures/directory/bot_sender.rb
81
98
  - spec_fixtures/empty/empty.rb
82
99
  - spec_fixtures/simple/simple.rb
100
+ - test/test_flog.rb
101
+ - test/test_flog_command.rb
102
+ - test/test_flog_integration.rb
103
+ - test/test_helper.rb
83
104
  has_rdoc: true
84
105
  homepage: http://ruby.sadi.st/
85
106
  post_install_message:
@@ -107,5 +128,8 @@ rubygems_version: 1.3.1
107
128
  signing_key:
108
129
  specification_version: 2
109
130
  summary: Flog reports the most tortured code in an easy to read pain report
110
- test_files: []
111
-
131
+ test_files:
132
+ - test/test_flog.rb
133
+ - test/test_flog_command.rb
134
+ - test/test_flog_integration.rb
135
+ - test/test_helper.rb
Binary file
@@ -1,352 +0,0 @@
1
- require File.dirname(__FILE__) + '/spec_helper.rb'
2
- require 'flog'
3
-
4
- describe 'flog command' do
5
- before :each do
6
- @flog = stub('Flog', :flog_files => true, :report => true)
7
- Flog.stubs(:new).returns(@flog)
8
- self.stubs(:exit)
9
- self.stubs(:puts)
10
- end
11
-
12
- def run_command
13
- eval File.read(File.join(File.dirname(__FILE__), *%w[.. bin flog]))
14
- end
15
-
16
- describe 'when no command-line arguments are specified' do
17
- before :each do
18
- Object.send(:remove_const, :ARGV)
19
- ARGV = []
20
- end
21
-
22
- it 'should run' do
23
- lambda { run_command }.should_not raise_error(Errno::ENOENT)
24
- end
25
-
26
- it 'should not alter the include path' do
27
- @paths = $:.dup
28
- run_command
29
- $:.should == @paths
30
- end
31
-
32
- it 'should create a Flog instance' do
33
- Flog.expects(:new).returns(@flog)
34
- run_command
35
- end
36
-
37
- it 'should not have any options flags set' do
38
- Flog.expects(:new).with({}).returns(@flog)
39
- run_command
40
- end
41
-
42
- it 'should call flog_files on the Flog instance' do
43
- @flog.expects(:flog_files)
44
- run_command
45
- end
46
-
47
- it "should pass '-' (for the file path) to flog_files on the instance" do
48
- @flog.expects(:flog_files).with(['-'])
49
- run_command
50
- end
51
-
52
- it 'should call report on the Flog instance' do
53
- @flog.expects(:report)
54
- run_command
55
- end
56
-
57
- it 'should exit with status 0' do
58
- self.expects(:exit).with(0)
59
- run_command
60
- end
61
- end
62
-
63
- describe "when -a is specified on the command-line" do
64
- before :each do
65
- Object.send(:remove_const, :ARGV)
66
- ARGV = ['-a']
67
- end
68
-
69
- it 'should create a Flog instance' do
70
- Flog.expects(:new).returns(@flog)
71
- run_command
72
- end
73
-
74
- it "should set the option to show all methods" do
75
- Flog.expects(:new).with(:all => true).returns(@flog)
76
- run_command
77
- end
78
-
79
- it 'should exit with status 0' do
80
- self.expects(:exit).with(0)
81
- run_command
82
- end
83
- end
84
-
85
- describe "when --all is specified on the command-line" do
86
- before :each do
87
- Object.send(:remove_const, :ARGV)
88
- ARGV = ['--all']
89
- end
90
-
91
- it 'should create a Flog instance' do
92
- Flog.expects(:new).returns(@flog)
93
- run_command
94
- end
95
-
96
- it "should set the option to show all methods" do
97
- Flog.expects(:new).with(:all => true).returns(@flog)
98
- run_command
99
- end
100
-
101
- it 'should exit with status 0' do
102
- self.expects(:exit).with(0)
103
- run_command
104
- end
105
- end
106
-
107
- describe "when -s is specified on the command-line" do
108
- before :each do
109
- Object.send(:remove_const, :ARGV)
110
- ARGV = ['-s']
111
- end
112
-
113
- it 'should create a Flog instance' do
114
- Flog.expects(:new).returns(@flog)
115
- run_command
116
- end
117
-
118
- it "should set the option to show only the score" do
119
- Flog.expects(:new).with(:score => true).returns(@flog)
120
- run_command
121
- end
122
-
123
- it 'should exit with status 0' do
124
- self.expects(:exit).with(0)
125
- run_command
126
- end
127
- end
128
-
129
- describe "when --score is specified on the command-line" do
130
- before :each do
131
- Object.send(:remove_const, :ARGV)
132
- ARGV = ['--score']
133
- end
134
-
135
- it 'should create a Flog instance' do
136
- Flog.expects(:new).returns(@flog)
137
- run_command
138
- end
139
-
140
- it "should set the option to show only the score" do
141
- Flog.expects(:new).with(:score => true).returns(@flog)
142
- run_command
143
- end
144
-
145
- it 'should exit with status 0' do
146
- self.expects(:exit).with(0)
147
- run_command
148
- end
149
- end
150
-
151
- describe "when -m is specified on the command-line" do
152
- before :each do
153
- Object.send(:remove_const, :ARGV)
154
- ARGV = ['-m']
155
- end
156
-
157
- it 'should create a Flog instance' do
158
- Flog.expects(:new).returns(@flog)
159
- run_command
160
- end
161
-
162
- it "should set the option to report on methods only" do
163
- Flog.expects(:new).with(:methods => true).returns(@flog)
164
- run_command
165
- end
166
-
167
- it 'should exit with status 0' do
168
- self.expects(:exit).with(0)
169
- run_command
170
- end
171
- end
172
-
173
- describe "when --methods-only is specified on the command-line" do
174
- before :each do
175
- Object.send(:remove_const, :ARGV)
176
- ARGV = ['--methods-only']
177
- end
178
-
179
- it 'should create a Flog instance' do
180
- Flog.expects(:new).returns(@flog)
181
- run_command
182
- end
183
-
184
- it "should set the option to report on methods only" do
185
- Flog.expects(:new).with(:methods => true).returns(@flog)
186
- run_command
187
- end
188
-
189
- it 'should exit with status 0' do
190
- self.expects(:exit).with(0)
191
- run_command
192
- end
193
- end
194
-
195
- describe "when -v is specified on the command-line" do
196
- before :each do
197
- Object.send(:remove_const, :ARGV)
198
- ARGV = ['-v']
199
- end
200
-
201
- it 'should create a Flog instance' do
202
- Flog.expects(:new).returns(@flog)
203
- run_command
204
- end
205
-
206
- it "should set the option to be verbose" do
207
- Flog.expects(:new).with(:verbose => true).returns(@flog)
208
- run_command
209
- end
210
-
211
- it 'should exit with status 0' do
212
- self.expects(:exit).with(0)
213
- run_command
214
- end
215
- end
216
-
217
- describe "when --verbose is specified on the command-line" do
218
- before :each do
219
- Object.send(:remove_const, :ARGV)
220
- ARGV = ['--verbose']
221
- end
222
-
223
- it 'should create a Flog instance' do
224
- Flog.expects(:new).returns(@flog)
225
- run_command
226
- end
227
-
228
- it "should set the option to be verbose" do
229
- Flog.expects(:new).with(:verbose => true).returns(@flog)
230
- run_command
231
- end
232
-
233
- it 'should exit with status 0' do
234
- self.expects(:exit).with(0)
235
- run_command
236
- end
237
- end
238
-
239
- describe "when -h is specified on the command-line" do
240
- before :each do
241
- Object.send(:remove_const, :ARGV)
242
- ARGV = ['-h']
243
- end
244
-
245
- it "should display help information" do
246
- self.expects(:puts)
247
- run_command
248
- end
249
-
250
- it 'should not create a Flog instance' do
251
- Flog.expects(:new).never
252
- run_command
253
- end
254
-
255
- it 'should exit with status 0' do
256
- self.expects(:exit).with(0)
257
- run_command
258
- end
259
- end
260
-
261
- describe "when --help is specified on the command-line" do
262
- before :each do
263
- Object.send(:remove_const, :ARGV)
264
- ARGV = ['--help']
265
- end
266
-
267
- it "should display help information" do
268
- self.expects(:puts)
269
- run_command
270
- end
271
-
272
- it 'should not create a Flog instance' do
273
- Flog.expects(:new).never
274
- run_command
275
- end
276
-
277
- it 'should exit with status 0' do
278
- self.expects(:exit).with(0)
279
- run_command
280
- end
281
- end
282
-
283
- describe 'when -I is specified on the command-line' do
284
- before :each do
285
- Object.send(:remove_const, :ARGV)
286
- ARGV = ['-I /tmp,/etc']
287
- end
288
-
289
- before :each do
290
- @paths = $:.dup
291
- end
292
-
293
- it "should append each ':' separated path to $:" do
294
- run_command
295
- $:.should_not == @paths
296
- end
297
-
298
- it 'should create a Flog instance' do
299
- Flog.expects(:new).returns(@flog)
300
- run_command
301
- end
302
-
303
- it 'should exit with status 0' do
304
- self.expects(:exit).with(0)
305
- run_command
306
- end
307
- end
308
-
309
- describe 'when -b is specified on the command-line' do
310
- before :each do
311
- Object.send(:remove_const, :ARGV)
312
- ARGV = ['-b']
313
- end
314
-
315
- it 'should create a Flog instance' do
316
- Flog.expects(:new).returns(@flog)
317
- run_command
318
- end
319
-
320
- it "should set the option to provide 'blame' information" do
321
- Flog.expects(:new).with(:blame => true).returns(@flog)
322
- run_command
323
- end
324
-
325
- it 'should exit with status 0' do
326
- self.expects(:exit).with(0)
327
- run_command
328
- end
329
- end
330
-
331
- describe 'when --blame is specified on the command-line' do
332
- before :each do
333
- Object.send(:remove_const, :ARGV)
334
- ARGV = ['--blame']
335
- end
336
-
337
- it 'should create a Flog instance' do
338
- Flog.expects(:new).returns(@flog)
339
- run_command
340
- end
341
-
342
- it "should set the option to provide 'blame' information" do
343
- Flog.expects(:new).with(:blame => true).returns(@flog)
344
- run_command
345
- end
346
-
347
- it 'should exit with status 0' do
348
- self.expects(:exit).with(0)
349
- run_command
350
- end
351
- end
352
- end
@@ -1,3 +0,0 @@
1
- --format
2
- s
3
- --colour
@@ -1,36 +0,0 @@
1
- # this is my favorite way to require ever
2
- begin
3
- require 'spec'
4
- rescue LoadError
5
- require 'rubygems'
6
- gem 'rspec'
7
- require 'spec'
8
- end
9
-
10
- begin
11
- require 'mocha'
12
- rescue LoadError
13
- require 'rubygems'
14
- gem 'mocha'
15
- require 'mocha'
16
- end
17
-
18
-
19
- module Spec::Example::ExampleGroupMethods
20
- def currently(name, &block)
21
- it("*** CURRENTLY *** #{name}", &block)
22
- end
23
- end
24
-
25
- Spec::Runner.configure do |config|
26
- config.mock_with :mocha
27
- end
28
-
29
- def fixture_files(paths)
30
- paths.collect do |path|
31
- File.expand_path(File.dirname(__FILE__) + '/../spec_fixtures/' + path)
32
- end
33
- end
34
-
35
-
36
- $:.unshift File.join(File.dirname(__FILE__), *%w[.. lib])