Class: CI::Syntax::Tool::RakeTask
- Inherits:
-
Rake::TaskLib
- Object
- Rake::TaskLib
- CI::Syntax::Tool::RakeTask
- Defined in:
- lib/ci-syntax-tool/rake_task.rb
Overview
Provides a custom rake task.
require ‘ci-syntax-tool/rake_task’ CI::Syntax::Tool::RakeTask.new
Instance Attribute Summary collapse
-
#fail_on_error ⇒ Object
Returns the value of attribute fail_on_error.
-
#formats ⇒ Object
Returns the value of attribute formats.
-
#languages ⇒ Object
Returns the value of attribute languages.
-
#name ⇒ Object
Returns the value of attribute name.
-
#options ⇒ Object
Returns the value of attribute options.
-
#outputs ⇒ Object
Returns the value of attribute outputs.
-
#verbose ⇒ Object
Returns the value of attribute verbose.
Instance Method Summary collapse
-
#initialize(*args, &task_block) ⇒ RakeTask
constructor
A new instance of RakeTask.
- #run_main_task(verbose) ⇒ Object
Constructor Details
#initialize(*args, &task_block) ⇒ RakeTask
Returns a new instance of RakeTask.
22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/ci-syntax-tool/rake_task.rb', line 22 def initialize(*args, &task_block) setup_ivars(args) desc 'Run syntax checks' unless ::Rake.application.last_comment task(name, *args) do |_, task_args| RakeFileUtils.send(:verbose, verbose) do if task_block task_block.call(*[self, task_args].slice(0, task_block.arity)) end run_main_task(verbose) end end end |
Instance Attribute Details
#fail_on_error ⇒ Object
Returns the value of attribute fail_on_error.
15 16 17 |
# File 'lib/ci-syntax-tool/rake_task.rb', line 15 def fail_on_error @fail_on_error end |
#formats ⇒ Object
Returns the value of attribute formats.
19 20 21 |
# File 'lib/ci-syntax-tool/rake_task.rb', line 19 def formats @formats end |
#languages ⇒ Object
Returns the value of attribute languages.
17 18 19 |
# File 'lib/ci-syntax-tool/rake_task.rb', line 17 def languages @languages end |
#name ⇒ Object
Returns the value of attribute name.
14 15 16 |
# File 'lib/ci-syntax-tool/rake_task.rb', line 14 def name @name end |
#options ⇒ Object
Returns the value of attribute options.
20 21 22 |
# File 'lib/ci-syntax-tool/rake_task.rb', line 20 def @options end |
#outputs ⇒ Object
Returns the value of attribute outputs.
18 19 20 |
# File 'lib/ci-syntax-tool/rake_task.rb', line 18 def outputs @outputs end |
#verbose ⇒ Object
Returns the value of attribute verbose.
16 17 18 |
# File 'lib/ci-syntax-tool/rake_task.rb', line 16 def verbose @verbose end |
Instance Method Details
#run_main_task(verbose) ⇒ Object
37 38 39 |
# File 'lib/ci-syntax-tool/rake_task.rb', line 37 def run_main_task(verbose) run_cli(verbose, ) end |