flog 3.0.0.b1 → 3.0.0.b2

Sign up to get free protection for your applications and to get access to all the features.
data.tar.gz.sig CHANGED
Binary file
data/History.txt CHANGED
@@ -1,3 +1,9 @@
1
+ === 3.0.0.b2 / 2012-08-07
2
+
3
+ * 1 bug fix:
4
+
5
+ * Fix for sexp structure changes (no arglists).
6
+
1
7
  === 3.0.0.b1 / 2012-07-26
2
8
 
3
9
  * 4 minor enhancements:
data/lib/flog.rb CHANGED
@@ -12,7 +12,7 @@ class File
12
12
  end
13
13
 
14
14
  class Flog < SexpProcessor
15
- VERSION = '3.0.0.b1'
15
+ VERSION = '3.0.0.b2'
16
16
 
17
17
  THRESHOLD = 0.60
18
18
  SCORES = Hash.new 1
@@ -645,11 +645,11 @@ class Flog < SexpProcessor
645
645
  recv = exp.first
646
646
 
647
647
  # DSL w/ names. eg task :name do ... end
648
- if (recv[0] == :call and recv[1] == nil and recv.arglist[1] and
649
- [:lit, :str].include? recv.arglist[1][0]) then
650
- msg = recv[2]
651
- submsg = recv.arglist[1][1]
652
- in_klass msg do # :task
648
+ # looks like s(:call, nil, :task, s(:lit, :name))
649
+ t, r, m, a = recv
650
+ if (t == :call and r == nil and a and [:lit, :str].include? a[0]) then
651
+ submsg = a[1]
652
+ in_klass m do # :task
653
653
  in_method submsg, exp.file, exp.line do # :name
654
654
  process_until_empty exp
655
655
  end
@@ -660,7 +660,7 @@ class Flog < SexpProcessor
660
660
 
661
661
  add_to_score :branch
662
662
 
663
- exp.delete 0 # TODO: what is this?
663
+ exp.delete 0 # { || ... } has 0 in arg slot
664
664
 
665
665
  process exp.shift # no penalty for LHS
666
666
 
data/test/test_flog.rb CHANGED
@@ -266,12 +266,11 @@ class TestFlog < MiniTest::Unit::TestCase
266
266
 
267
267
  def test_process_attrasgn
268
268
  sexp = s(:attrasgn,
269
- s(:call, nil, :a, s(:arglist)),
269
+ s(:call, nil, :a),
270
270
  :[]=,
271
- s(:arglist,
272
- s(:splat,
273
- s(:call, nil, :b, s(:arglist))),
274
- s(:call, nil, :c, s(:arglist))))
271
+ s(:splat,
272
+ s(:call, nil, :b)),
273
+ s(:call, nil, :c))
275
274
 
276
275
  util_process(sexp, 3.162,
277
276
  :c => 1.0, :b => 1.0, :a => 1.0, :assignment => 1.0)
@@ -294,9 +293,8 @@ class TestFlog < MiniTest::Unit::TestCase
294
293
 
295
294
  def test_process_block_pass
296
295
  sexp = s(:call, nil, :a,
297
- s(:arglist,
298
- s(:block_pass,
299
- s(:call, nil, :b, s(:arglist)))))
296
+ s(:block_pass,
297
+ s(:call, nil, :b)))
300
298
 
301
299
  util_process(sexp, 9.4,
302
300
  :a => 1.0,
@@ -307,9 +305,8 @@ class TestFlog < MiniTest::Unit::TestCase
307
305
 
308
306
  def test_process_block_pass_colon2
309
307
  sexp = s(:call, nil, :a,
310
- s(:arglist,
311
- s(:block_pass,
312
- s(:colon2, s(:const, :A), :B))))
308
+ s(:block_pass,
309
+ s(:colon2, s(:const, :A), :B)))
313
310
 
314
311
  util_process(sexp, 2.2,
315
312
  :a => 1.0,
@@ -318,7 +315,7 @@ class TestFlog < MiniTest::Unit::TestCase
318
315
 
319
316
  def test_process_block_pass_iter
320
317
  sexp = s(:block_pass,
321
- s(:iter, s(:call, nil, :lambda, s(:arglist)), nil, s(:lit, 1)))
318
+ s(:iter, s(:call, nil, :lambda), nil, s(:lit, 1)))
322
319
 
323
320
  util_process(sexp, 12.316,
324
321
  :lit_fixnum => 0.275,
@@ -332,7 +329,7 @@ class TestFlog < MiniTest::Unit::TestCase
332
329
  sexp = s(:block_pass,
333
330
  s(:lasgn,
334
331
  :b,
335
- s(:iter, s(:call, nil, :lambda, s(:arglist)), nil, s(:lit, 1))))
332
+ s(:iter, s(:call, nil, :lambda), nil, s(:lit, 1))))
336
333
 
337
334
  util_process(sexp, 17.333,
338
335
  :lit_fixnum => 0.275,
@@ -344,7 +341,7 @@ class TestFlog < MiniTest::Unit::TestCase
344
341
  end
345
342
 
346
343
  def test_process_call
347
- sexp = s(:call, nil, :a, s(:arglist))
344
+ sexp = s(:call, nil, :a)
348
345
  util_process sexp, 1.0, :a => 1.0
349
346
  end
350
347
 
@@ -417,15 +414,15 @@ class TestFlog < MiniTest::Unit::TestCase
417
414
 
418
415
  def test_process_if
419
416
  sexp = s(:if,
420
- s(:call, nil, :b, s(:arglist)), # outside block, not penalized
421
- s(:call, nil, :a, s(:arglist)), nil)
417
+ s(:call, nil, :b), # outside block, not penalized
418
+ s(:call, nil, :a), nil)
422
419
 
423
420
  util_process sexp, 2.326, :branch => 1.0, :b => 1.0, :a => 1.1
424
421
  end
425
422
 
426
423
  def test_process_iter
427
424
  sexp = s(:iter,
428
- s(:call, nil, :loop, s(:arglist)), nil,
425
+ s(:call, nil, :loop), nil,
429
426
  s(:if, s(:true), s(:break), nil))
430
427
 
431
428
  util_process sexp, 2.326, :loop => 1.0, :branch => 2.1
@@ -437,9 +434,9 @@ class TestFlog < MiniTest::Unit::TestCase
437
434
  # end
438
435
 
439
436
  sexp = s(:iter,
440
- s(:call, nil, :task, s(:arglist, s(:lit, :blah))),
437
+ s(:call, nil, :task, s(:lit, :blah)),
441
438
  nil,
442
- s(:call, nil, :something, s(:arglist)))
439
+ s(:call, nil, :something))
443
440
 
444
441
  @klass, @meth = "task", "#blah"
445
442
 
@@ -452,9 +449,9 @@ class TestFlog < MiniTest::Unit::TestCase
452
449
  # end
453
450
 
454
451
  sexp = s(:iter,
455
- s(:call, nil, :task, s(:arglist, s(:lit, /regexp/))),
452
+ s(:call, nil, :task, s(:lit, /regexp/)),
456
453
  nil,
457
- s(:call, nil, :something, s(:arglist)))
454
+ s(:call, nil, :something))
458
455
 
459
456
  @klass, @meth = "task", "#/regexp/"
460
457
 
@@ -485,7 +482,7 @@ class TestFlog < MiniTest::Unit::TestCase
485
482
  def test_process_masgn
486
483
  sexp = s(:masgn,
487
484
  s(:array, s(:lasgn, :a), s(:lasgn, :b)),
488
- s(:to_ary, s(:call, nil, :c, s(:arglist))))
485
+ s(:to_ary, s(:call, nil, :c)))
489
486
 
490
487
  util_process sexp, 3.162, :c => 1.0, :assignment => 3.0
491
488
  end
@@ -515,8 +512,8 @@ class TestFlog < MiniTest::Unit::TestCase
515
512
 
516
513
  def test_process_while
517
514
  sexp = s(:while,
518
- s(:call, nil, :a, s(:arglist)),
519
- s(:call, nil, :b, s(:arglist)),
515
+ s(:call, nil, :a),
516
+ s(:call, nil, :b),
520
517
  true)
521
518
 
522
519
  util_process sexp, 2.417, :branch => 1.0, :a => 1.1, :b => 1.1
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: flog
3
3
  version: !ruby/object:Gem::Version
4
- hash: 1257799903
4
+ hash: -1937524008
5
5
  prerelease: 6
6
6
  segments:
7
7
  - 3
8
8
  - 0
9
9
  - 0
10
10
  - b
11
- - 1
12
- version: 3.0.0.b1
11
+ - 2
12
+ version: 3.0.0.b2
13
13
  platform: ruby
14
14
  authors:
15
15
  - Ryan Davis
@@ -38,7 +38,7 @@ cert_chain:
38
38
  FBHgymkyj/AOSqKRIpXPhjC6
39
39
  -----END CERTIFICATE-----
40
40
 
41
- date: 2012-07-27 00:00:00 Z
41
+ date: 2012-08-07 00:00:00 Z
42
42
  dependencies:
43
43
  - !ruby/object:Gem::Dependency
44
44
  name: sexp_processor
@@ -63,7 +63,7 @@ dependencies:
63
63
  requirements:
64
64
  - - ~>
65
65
  - !ruby/object:Gem::Version
66
- hash: 1257782997
66
+ hash: -1937540908
67
67
  segments:
68
68
  - 3
69
69
  - 0
@@ -81,11 +81,11 @@ dependencies:
81
81
  requirements:
82
82
  - - ~>
83
83
  - !ruby/object:Gem::Version
84
- hash: 3
84
+ hash: 1
85
85
  segments:
86
86
  - 3
87
- - 2
88
- version: "3.2"
87
+ - 3
88
+ version: "3.3"
89
89
  type: :development
90
90
  version_requirements: *id003
91
91
  - !ruby/object:Gem::Dependency
metadata.gz.sig CHANGED
Binary file