simplificator-flogger 0.0.2 → 0.1.1
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/lib/flogger.rb +1 -4
- data/lib/flogger/assertions.rb +3 -9
- metadata +1 -1
data/lib/flogger.rb
CHANGED
@@ -1,8 +1,5 @@
|
|
1
|
-
#$:.unshift File.dirname(__FILE__) # For use/testing when no gem is installed
|
2
1
|
require 'flogger/assertions'
|
3
2
|
require 'test/unit'
|
4
3
|
require 'rubygems'
|
5
4
|
require 'flog'
|
6
|
-
Test::Unit::TestCase.send(:include, Flogger::InstanceMethods)
|
7
|
-
|
8
|
-
puts 'loaded flogger'
|
5
|
+
Test::Unit::TestCase.send(:include, Flogger::InstanceMethods)
|
data/lib/flogger/assertions.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
module Flogger
|
2
2
|
module InstanceMethods
|
3
3
|
#
|
4
|
-
# assert the flog score of file(s) is below a treshold.
|
4
|
+
# assert the flog score of file(s) is below a treshold (default treshold is 20).
|
5
5
|
#
|
6
6
|
# = Samples:
|
7
7
|
# == Flog a file or all ruby files in a directory
|
@@ -14,7 +14,7 @@ module Flogger
|
|
14
14
|
# assert_flog(file_or_dir, :thresholds => {'FooClass#bar_method'})
|
15
15
|
#
|
16
16
|
# == options
|
17
|
-
# * :treshold what flog score do we allow at most.
|
17
|
+
# * :treshold what flog score do we allow at most. Default is 20.
|
18
18
|
# * :tresholds customize tresholds on a per class/method base, overrides :treshold option
|
19
19
|
#
|
20
20
|
# == Message
|
@@ -33,12 +33,6 @@ module Flogger
|
|
33
33
|
end
|
34
34
|
end
|
35
35
|
|
36
|
-
|
37
|
-
def assert_floq_rails(*args)
|
38
|
-
assert_flog([RAILS_ROOT] + args)
|
39
|
-
end
|
40
|
-
|
41
|
-
|
42
36
|
private
|
43
37
|
|
44
38
|
#
|
@@ -65,7 +59,7 @@ module Flogger
|
|
65
59
|
end
|
66
60
|
|
67
61
|
#
|
68
|
-
# Remove all values which are not exceeding the
|
62
|
+
# Remove all values which are not exceeding the threshold
|
69
63
|
#
|
70
64
|
def reject_success(totals, options)
|
71
65
|
totals.reject do |key, value|
|