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
62 63 64 65 66 67 68 69 70 71 72 |
# File 'lib/yardstick/rake/verify.rb', line 62 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
33 34 35 |
# File 'lib/yardstick/rake/verify.rb', line 33 def path=(value) @path = value end |
#require_exact_threshold=(value) ⇒ undefined (writeonly)
Specify if the threshold should match the coverage
26 27 28 |
# File 'lib/yardstick/rake/verify.rb', line 26 def require_exact_threshold=(value) @require_exact_threshold = value end |
#threshold=(value) ⇒ undefined (writeonly)
Set the threshold
19 20 21 |
# File 'lib/yardstick/rake/verify.rb', line 19 def threshold=(value) @threshold = value end |
#verbose=(value) ⇒ undefined (writeonly)
Specify if the coverage summary should be displayed
40 41 42 |
# File 'lib/yardstick/rake/verify.rb', line 40 def verbose=(value) @verbose = value end |
Instance Method Details
#verify_measurements ⇒ undefined
Verify the YARD coverage measurements
87 88 89 90 91 |
# File 'lib/yardstick/rake/verify.rb', line 87 def verify_measurements puts "YARD-Coverage: #{total_coverage}% (threshold: #{@threshold}%)" if verbose assert_meets_threshold assert_matches_threshold end |