Parent

Methods

Class/Module Index [+]

Quicksearch

Reek::Rake::Task

A Rake task that runs reek on a set of source files.

Example:

require 'reek/rake/task'

Reek::Rake::Task.new do |t|
  t.fail_on_error = false
end

This will create a task that can be run with:

rake reek

Examples:

rake reek                                # checks lib/**/*.rb
rake reek REEK_SRC=just_one_file.rb      # checks a single source file
rake reek REEK_OPTS=-s                   # sorts the report by smell

Attributes

config_files[RW]

Glob pattern to match config files. Setting the REEK_CFG environment variable overrides this. Defaults to ‘config/*/.reek’.

fail_on_error[RW]

Whether or not to fail Rake when an error occurs (typically when smells are found). Defaults to true.

libs[RW]

Array of directories to be added to $LOAD_PATH before running reek. Defaults to ['<the absolute path to reek's lib directory>']

name[RW]

Name of reek task. Defaults to :reek.

reek_opts[RW]

String containing commandline options to be passed to Reek. Setting the REEK_OPTS environment variable overrides this value. Defaults to ".

ruby_opts[RW]

Array of commandline options to pass to ruby. Defaults to [].

source_files[RW]

Glob pattern to match source files. Setting the REEK_SRC environment variable overrides this. Defaults to ‘lib/*/.rb’.

verbose[RW]

Use verbose output. If this is set to true, the task will print the reek command to stdout. Defaults to false.

Public Class Methods

new(name = :reek) click to toggle source

Defines a new task, using the name name.

# File lib/reek/rake/task.rb, line 72
def initialize(name = :reek)
  @name = name
  @libs = [File.expand_path(File.dirname(__FILE__) + '/../../../lib')]
  @config_files = nil
  @source_files = nil
  @ruby_opts = []
  @reek_opts = ''
  @fail_on_error = true
  @sort = nil

  yield self if block_given?
  @config_files ||= 'config/**/*.reek'
  @source_files ||= 'lib/**/*.rb'
  define
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.