Class: SyntaxTree::Rake::CheckTask

Inherits:
Rake::TaskLib
  • Object
show all
Defined in:
lib/syntax_tree/rake/check_task.rb

Overview

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

Example:

require 'syntax_tree/rake/check_task'

SyntaxTree::Rake::CheckTask.new do |t|
  t.source_files = '{app,config,lib}/**/*.rb'
end

This will create task that can be run with:

rake stree_check

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name = :"stree:check", source_files = ::Rake::FileList["lib/**/*.rb"], plugins = []) {|_self| ... } ⇒ CheckTask

Returns a new instance of CheckTask.

Yields:

  • (_self)

Yield Parameters:



38
39
40
41
42
43
44
45
46
47
48
49
# File 'lib/syntax_tree/rake/check_task.rb', line 38

def initialize(
  name = :"stree:check",
  source_files = ::Rake::FileList["lib/**/*.rb"],
  plugins = []
)
  @name = name
  @source_files = source_files
  @plugins = plugins

  yield self if block_given?
  define_task
end

Instance Attribute Details

#nameObject

Name of the task. Defaults to :“stree:check”.



28
29
30
# File 'lib/syntax_tree/rake/check_task.rb', line 28

def name
  @name
end

#pluginsObject

The set of plugins to require. Defaults to [].



36
37
38
# File 'lib/syntax_tree/rake/check_task.rb', line 36

def plugins
  @plugins
end

#source_filesObject

Glob pattern to match source files. Defaults to ‘lib/*/.rb’.



32
33
34
# File 'lib/syntax_tree/rake/check_task.rb', line 32

def source_files
  @source_files
end