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, globber: Dir, gem_spec: Gem::Specification, quality_checker_class: Quality::QualityChecker) {|@config| ... } ⇒ Task

Defines a new task, using the name name.

Yields:



30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# File 'lib/quality/rake/task.rb', line 30

def initialize(dsl: ::Rake::Task,
               cmd_runner: Kernel,
               count_file: File,
               count_io: IO,
               globber: Dir,
               gem_spec: Gem::Specification,
               quality_checker_class:
                 Quality::QualityChecker)
  @dsl = dsl
  @cmd_runner = cmd_runner
  @globber = globber
  @config = Quality::Config.new(globber: globber)
  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)
  define
end

Instance Attribute Details

#configObject (readonly)

Returns the value of attribute config.



53
54
55
# File 'lib/quality/rake/task.rb', line 53

def config
  @config
end

#globberObject (readonly)

Returns the value of attribute globber.



53
54
55
# File 'lib/quality/rake/task.rb', line 53

def globber
  @globber
end