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 (yegor256@gmail.com)
- Copyright
-
Copyright © 2017-2026 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.
15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/xcop/rake_task.rb', line 15 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.
13 14 15 |
# File 'lib/xcop/rake_task.rb', line 13 def excludes @excludes end |
#fail_on_error ⇒ Object
Returns the value of attribute fail_on_error.
13 14 15 |
# File 'lib/xcop/rake_task.rb', line 13 def fail_on_error @fail_on_error end |
#includes ⇒ Object
Returns the value of attribute includes.
13 14 15 |
# File 'lib/xcop/rake_task.rb', line 13 def includes @includes end |
#name ⇒ Object
Returns the value of attribute name.
13 14 15 |
# File 'lib/xcop/rake_task.rb', line 13 def name @name end |
#quiet ⇒ Object
Returns the value of attribute quiet.
13 14 15 |
# File 'lib/xcop/rake_task.rb', line 13 def quiet @quiet end |