Class: SyntaxTree::Rake::CheckTask
- Inherits:
-
Rake::TaskLib
- Object
- Rake::TaskLib
- SyntaxTree::Rake::CheckTask
- 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
-
#name ⇒ Object
Name of the task.
-
#plugins ⇒ Object
The set of plugins to require.
-
#source_files ⇒ Object
Glob pattern to match source files.
Instance Method Summary collapse
-
#initialize(name = :"stree:check", source_files = ::Rake::FileList["lib/**/*.rb"], plugins = []) {|_self| ... } ⇒ CheckTask
constructor
A new instance of CheckTask.
Constructor Details
#initialize(name = :"stree:check", source_files = ::Rake::FileList["lib/**/*.rb"], plugins = []) {|_self| ... } ⇒ CheckTask
Returns a new instance of CheckTask.
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
#name ⇒ Object
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 |
#plugins ⇒ Object
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_files ⇒ Object
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 |