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(dsl: ::Rake::Task, cmd_runner: Kernel, count_file: File, count_io: IO, gem_spec: Gem::Specification, quality_checker_class: Quality::QualityChecker, which: Which.new, config: Quality::Config.new) {|@config| ... } ⇒ Task

Defines a new task, using the name name.

Yields:



44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# File 'lib/quality/rake/task.rb', line 44

def initialize(dsl: ::Rake::Task,
               cmd_runner: Kernel,
               count_file: File,
               count_io: IO,
               gem_spec: Gem::Specification,
               quality_checker_class:
                 Quality::QualityChecker,
               which: Which.new,
               config: Quality::Config.new)
  @dsl = dsl
  @cmd_runner = cmd_runner
  @config = config
  yield @config if block_given?
  @runner = Quality::Runner.new(@config,
                                gem_spec: gem_spec,
                                quality_checker_class:
                                  quality_checker_class,
                                count_io: count_io,
                                count_file: count_file,
                                globber: globber,
                                which: which)
  define
end

Instance Attribute Details

#configObject (readonly)

Returns the value of attribute config.



68
69
70
# File 'lib/quality/rake/task.rb', line 68

def config
  @config
end

#globberObject (readonly)

Returns the value of attribute globber.



68
69
70
# File 'lib/quality/rake/task.rb', line 68

def globber
  @globber
end