Class: Xcop::RakeTask
- Inherits:
-
Rake::TaskLib
- Object
- Rake::TaskLib
- Xcop::RakeTask
- Defined in:
- lib/xcop/rake_task.rb
Overview
Xcop rake task.
- Author
-
Yegor Bugayenko ([email protected])
- Copyright
-
Copyright © 2017-2025 Yegor Bugayenko
- License
-
MIT
Instance Attribute Summary collapse
-
#excludes ⇒ Object
Returns the value of attribute excludes.
-
#fail_on_error ⇒ Object
Returns the value of attribute fail_on_error.
-
#includes ⇒ Object
Returns the value of attribute includes.
-
#name ⇒ Object
Returns the value of attribute name.
-
#quiet ⇒ Object
Returns the value of attribute quiet.
Instance Method Summary collapse
-
#initialize(*args, &task_block) ⇒ RakeTask
constructor
A new instance of RakeTask.
Constructor Details
#initialize(*args, &task_block) ⇒ RakeTask
Returns a new instance of RakeTask.
32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/xcop/rake_task.rb', line 32 def initialize(*args, &task_block) super() @name = args.shift || :xcop @includes = %w[xml xsd xhtml xsl html].map { |e| "**/*.#{e}" } @excludes = [] @quiet = false desc 'Run Xcop' unless ::Rake.application.last_description task(name, *args) do |_, task_args| RakeFileUtils.send(:verbose, true) do yield(*[self, task_args].slice(0, task_block.arity)) if block_given? run end end end |
Instance Attribute Details
#excludes ⇒ Object
Returns the value of attribute excludes.
30 31 32 |
# File 'lib/xcop/rake_task.rb', line 30 def excludes @excludes end |
#fail_on_error ⇒ Object
Returns the value of attribute fail_on_error.
30 31 32 |
# File 'lib/xcop/rake_task.rb', line 30 def fail_on_error @fail_on_error end |
#includes ⇒ Object
Returns the value of attribute includes.
30 31 32 |
# File 'lib/xcop/rake_task.rb', line 30 def includes @includes end |
#name ⇒ Object
Returns the value of attribute name.
30 31 32 |
# File 'lib/xcop/rake_task.rb', line 30 def name @name end |
#quiet ⇒ Object
Returns the value of attribute quiet.
30 31 32 |
# File 'lib/xcop/rake_task.rb', line 30 def quiet @quiet end |