Class: Xcop::RakeTask
- Inherits:
-
Rake::TaskLib
- Object
- Rake::TaskLib
- Xcop::RakeTask
- Defined in:
- lib/xcop/rake_task.rb
Overview
Rake task.
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.
-
#license ⇒ Object
Returns the value of attribute license.
-
#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.
41 42 43 44 45 46 47 48 49 50 51 52 53 54 |
# File 'lib/xcop/rake_task.rb', line 41 def initialize(*args, &task_block) @name = args.shift || :xcop @includes = %w(xml xsd xhtml xsl html).map { |e| "**/*.#{e}" } @excludes = [] @license = nil @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.
36 37 38 |
# File 'lib/xcop/rake_task.rb', line 36 def excludes @excludes end |
#fail_on_error ⇒ Object
Returns the value of attribute fail_on_error.
35 36 37 |
# File 'lib/xcop/rake_task.rb', line 35 def fail_on_error @fail_on_error end |
#includes ⇒ Object
Returns the value of attribute includes.
37 38 39 |
# File 'lib/xcop/rake_task.rb', line 37 def includes @includes end |
#license ⇒ Object
Returns the value of attribute license.
38 39 40 |
# File 'lib/xcop/rake_task.rb', line 38 def license @license end |
#name ⇒ Object
Returns the value of attribute name.
34 35 36 |
# File 'lib/xcop/rake_task.rb', line 34 def name @name end |
#quiet ⇒ Object
Returns the value of attribute quiet.
39 40 41 |
# File 'lib/xcop/rake_task.rb', line 39 def quiet @quiet end |