Parent

Syckle::Plugins::RCov

RCov Service

RCov code coverage utility.

Constants

DEFAULT_SCRIPTS

Default script files to run via rcov.

Attributes

options[R]

Additional commandline options string passed to rcov.

output[R]

Output directory. This defaults to an rcov/ folder in the the project’s log directory.

scripts[R]

Pattern of script files to run for coverage check. Usually these are your test files, but they can be any ruby scripts. By default this is includes .rb file in the test/ directory whose name begins with test_ or ends with _test.

Public Instance Methods

analyize() click to toggle source

Shell out to rcov.

# File lib/plugins/syckle/rcov.rb, line 37
def analyize
  files = scripts.map{ |s| Dir[s] }.flatten
  # create output directory if needed
  mkdir_p(output) unless File.exist?(output)
  # if nothing is out-of-date
  if outofdate?(output, *files) or force?
    sh "rcov #{options} -t -o #{output} #{files.join(' ')}"
    report "rcov updated (at #{output.sub(Dir.pwd,'')})"
  else
    report "rcov is current (at #{output.sub(Dir.pwd,'')})"
  end
end
clean() click to toggle source

Remove output directory and it’s contents.

# File lib/plugins/syckle/rcov.rb, line 59
def clean
  if File.directory?(output)
    rm_r(output)
    report "removed #{output}" #unless trial?
  end
end
initialize_defaults() click to toggle source

TODO: Default scripts must be improved. How?

esp. how to use Quarry?
# File lib/plugins/syckle/rcov.rb, line 31
def initialize_defaults
  @output  = project.log + 'rcov'
  @scripts = DEFAULT_SCRIPTS
end
reset() click to toggle source

Reset output directory, ie. set mtime to oldest date possible.

# File lib/plugins/syckle/rcov.rb, line 51
def reset
  if File.directory?(output)
    File.utime(0,0,output)
    report "reset #{output}" #unless trial?
  end
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.