Class: Quality::Rake::Task
- Inherits:
-
Rake::TaskLib
- Object
- Rake::TaskLib
- Quality::Rake::Task
- Defined in:
- lib/quality/rake/task.rb
Overview
Instance Attribute Summary collapse
-
#output_dir ⇒ Object
writeonly
Relative path to output directory where *_high_water_mark files will be read/written.
-
#quality_name ⇒ Object
Name of quality task.
-
#ratchet_name ⇒ Object
Name of ratchet task.
-
#ruby_dirs ⇒ Object
writeonly
Array of directory names which contain ruby files to analyze.
-
#skip_tools ⇒ Object
Array of strings describing tools to be skipped–e.g., [“cane”].
Instance Method Summary collapse
-
#initialize(args = {}) {|_self| ... } ⇒ Task
constructor
Defines a new task, using the name
name.
Constructor Details
#initialize(args = {}) {|_self| ... } ⇒ Task
Defines a new task, using the name name.
58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 |
# File 'lib/quality/rake/task.rb', line 58 def initialize(args = {}) @quality_name = args[:quality_name] || 'quality' @ratchet_name = args[:ratchet_name] || 'ratchet' # allow unit tests to override the class that Rake DSL # messages are sent to. @dsl = args[:dsl] # likewise, but for system() @cmd_runner = args[:cmd_runner] || Kernel # likewise, but for IO.popen() @popener = args[:popener] || IO # likewise, but for File.open() on the count files @count_file = args[:count_file] || File # likewise, but for IO.read()/IO.exist? on the count files @count_io = args[:count_io] || IO # likewise, but for Dir.glob() on target Ruby files @globber = args[:globber] || Dir # uses exist?() and open() to write out configuration files # for tools if needed (e.g., .cane file) @configuration_writer = args[:configuration_writer] || File @skip_tools = [] if @skip_tools.nil? @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' @output_dir ||= "." define end |
Instance Attribute Details
#output_dir=(value) ⇒ Object (writeonly)
Relative path to output directory where *_high_water_mark files will be read/written
Defaults to .
55 56 57 |
# File 'lib/quality/rake/task.rb', line 55 def output_dir=(value) @output_dir = value end |
#quality_name ⇒ Object
Name of quality task. Defaults to :quality.
34 35 36 |
# File 'lib/quality/rake/task.rb', line 34 def quality_name @quality_name end |
#ratchet_name ⇒ Object
Name of ratchet task. Defaults to :ratchet.
38 39 40 |
# File 'lib/quality/rake/task.rb', line 38 def ratchet_name @ratchet_name end |
#ruby_dirs=(value) ⇒ Object
Array of directory names which contain ruby files to analyze.
Defaults to %wtest features, which translates to *.rb in the base directory, as well as lib, test, and features.
49 50 51 |
# File 'lib/quality/rake/task.rb', line 49 def ruby_dirs=(value) @ruby_dirs = value end |
#skip_tools ⇒ Object
Array of strings describing tools to be skipped–e.g., [“cane”]
Defaults to []
43 44 45 |
# File 'lib/quality/rake/task.rb', line 43 def skip_tools @skip_tools end |