Class: Yardstick::Rake::Measurement

Inherits:
Rake::TaskLib
  • Object
show all
Defined in:
lib/yardstick/rake/measurement.rb

Overview

A rake task for measuring docs in a set of files

Instance Method Summary collapse

Constructor Details

#initialize(name = :yardstick_measure, options = {}) {|config| ... } ⇒ Yardstick::Rake::Measurement

Initializes a Measurement task

Examples:

task = Yardstick::Rake::Measurement

Parameters:

  • name (Symbol) (defaults to: :yardstick_measure)

    optional task name

Yield Parameters:



28
29
30
31
32
33
# File 'lib/yardstick/rake/measurement.rb', line 28

def initialize(name = :yardstick_measure, options = {}, &block)
  @name   = name
  @config = Config.coerce(options, &block)

  define
end

Instance Method Details

#yardstick_measureundefined

Measure the documentation

Examples:

task.yardstick_measure  # (output measurement report)

Returns:

  • (undefined)


43
44
45
# File 'lib/yardstick/rake/measurement.rb', line 43

def yardstick_measure
  @config.output.write { |io| Yardstick.measure(@config).puts(io) }
end