Class: Quality::Rake::Task

Inherits:
Rake::TaskLib
  • Object
show all
Defined in:
lib/quality/rake/task.rb

Overview

A Rake task that run quality tools on a set of source files, and enforce a ratcheting quality level.

Example:

require 'quality/rake/task'

Quality::Rake::Task.new do |t|
end

This will create a task that can be run with:

rake quality

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name = :quality) {|_self| ... } ⇒ Task

Defines a new task, using the name name.

Yields:

  • (_self)

Yield Parameters:



44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# File 'lib/quality/rake/task.rb', line 44

def initialize(name = :quality)
  @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

Instance Attribute Details

#libsObject

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



37
38
39
# File 'lib/quality/rake/task.rb', line 37

def libs
  @libs
end

#nameObject

Name of reek task. Defaults to :reek.



33
34
35
# File 'lib/quality/rake/task.rb', line 33

def name
  @name
end

#verboseObject

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



41
42
43
# File 'lib/quality/rake/task.rb', line 41

def verbose
  @verbose
end