Class: SyntaxTree::Rake::Task
- Inherits:
-
Rake::TaskLib
- Object
- Rake::TaskLib
- SyntaxTree::Rake::Task
- Defined in:
- lib/syntax_tree/rake/task.rb
Overview
A parent Rake task that runs a command on a set of source files.
Instance Attribute Summary collapse
-
#ignore_files ⇒ Object
Glob pattern to ignore source files.
-
#name ⇒ Object
Name of the task.
-
#plugins ⇒ Object
The set of plugins to require.
-
#print_width ⇒ Object
Max line length.
-
#source_files ⇒ Object
Glob pattern to match source files.
-
#target_ruby_version ⇒ Object
The target Ruby version to use for formatting.
Instance Method Summary collapse
-
#initialize(name = :"stree:#{command}", source_files = ::Rake::FileList["lib/**/*.rb"], plugins = [], print_width = DEFAULT_PRINT_WIDTH, target_ruby_version = Gem::Version.new(RUBY_VERSION), ignore_files = "") {|_self| ... } ⇒ Task
constructor
A new instance of Task.
Constructor Details
#initialize(name = :"stree:#{command}", source_files = ::Rake::FileList["lib/**/*.rb"], plugins = [], print_width = DEFAULT_PRINT_WIDTH, target_ruby_version = Gem::Version.new(RUBY_VERSION), ignore_files = "") {|_self| ... } ⇒ Task
Returns a new instance of Task.
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 |
# File 'lib/syntax_tree/rake/task.rb', line 36 def initialize( name = :"stree:#{command}", source_files = ::Rake::FileList["lib/**/*.rb"], plugins = [], print_width = DEFAULT_PRINT_WIDTH, target_ruby_version = Gem::Version.new(RUBY_VERSION), ignore_files = "" ) @name = name @source_files = source_files @plugins = plugins @print_width = print_width @target_ruby_version = target_ruby_version @ignore_files = ignore_files yield self if block_given? define_task end |
Instance Attribute Details
#ignore_files ⇒ Object
Glob pattern to ignore source files. Defaults to ”.
34 35 36 |
# File 'lib/syntax_tree/rake/task.rb', line 34 def ignore_files @ignore_files end |
#name ⇒ Object
Name of the task.
14 15 16 |
# File 'lib/syntax_tree/rake/task.rb', line 14 def name @name end |
#plugins ⇒ Object
The set of plugins to require. Defaults to [].
22 23 24 |
# File 'lib/syntax_tree/rake/task.rb', line 22 def plugins @plugins end |
#print_width ⇒ Object
Max line length. Defaults to 80.
26 27 28 |
# File 'lib/syntax_tree/rake/task.rb', line 26 def print_width @print_width end |
#source_files ⇒ Object
Glob pattern to match source files. Defaults to ‘lib/*/.rb’.
18 19 20 |
# File 'lib/syntax_tree/rake/task.rb', line 18 def source_files @source_files end |
#target_ruby_version ⇒ Object
The target Ruby version to use for formatting. Defaults to Gem::Version.new(RUBY_VERSION).
30 31 32 |
# File 'lib/syntax_tree/rake/task.rb', line 30 def target_ruby_version @target_ruby_version end |