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:



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

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)


45
46
47
# File 'lib/yardstick/rake/measurement.rb', line 45

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