Class: Yardstick::Rake::Verify
- Inherits:
-
Rake::TaskLib
- Object
- Rake::TaskLib
- Yardstick::Rake::Verify
- Defined in:
- lib/yardstick/rake/verify.rb
Overview
A rake task for verifying the doc thresholds
Instance Attribute Summary collapse
-
#path ⇒ undefined
writeonly
List of paths to measure.
-
#require_exact_threshold ⇒ undefined
writeonly
Specify if the threshold should match the coverage.
-
#threshold ⇒ undefined
writeonly
Set the threshold.
-
#verbose ⇒ undefined
writeonly
Specify if the coverage summary should be displayed.
Instance Method Summary collapse
-
#initialize(name = :verify_measurements) {|task| ... } ⇒ Yardstick::Rake::Verify
constructor
Initialize a Verify task.
-
#verify_measurements ⇒ undefined
Verify the YARD coverage measurements.
Constructor Details
#initialize(name = :verify_measurements) {|task| ... } ⇒ Yardstick::Rake::Verify
Initialize a Verify task
60 61 62 63 64 65 66 67 68 69 70 |
# File 'lib/yardstick/rake/verify.rb', line 60 def initialize(name = :verify_measurements) @name = name @require_exact_threshold = true @path = 'lib/**/*.rb' @verbose = true yield self assert_threshold define end |
Instance Attribute Details
#path=(value) ⇒ undefined (writeonly)
List of paths to measure
31 32 33 |
# File 'lib/yardstick/rake/verify.rb', line 31 def path=(value) @path = value end |
#require_exact_threshold=(value) ⇒ undefined (writeonly)
Specify if the threshold should match the coverage
24 25 26 |
# File 'lib/yardstick/rake/verify.rb', line 24 def require_exact_threshold=(value) @require_exact_threshold = value end |
#threshold=(value) ⇒ undefined (writeonly)
Set the threshold
17 18 19 |
# File 'lib/yardstick/rake/verify.rb', line 17 def threshold=(value) @threshold = value end |
#verbose=(value) ⇒ undefined (writeonly)
Specify if the coverage summary should be displayed
38 39 40 |
# File 'lib/yardstick/rake/verify.rb', line 38 def verbose=(value) @verbose = value end |
Instance Method Details
#verify_measurements ⇒ undefined
Verify the YARD coverage measurements
85 86 87 88 89 |
# File 'lib/yardstick/rake/verify.rb', line 85 def verify_measurements puts "Coverage: #{total_coverage}% (threshold: #{@threshold}%)" if verbose assert_meets_threshold assert_matches_threshold end |