Class: Xcop::RakeTask

Inherits:
Rake::TaskLib
  • Object
show all
Defined in:
lib/xcop/rake_task.rb

Overview

Xcop rake task.

Author

Yegor Bugayenko ([email protected])

Copyright

Copyright © 2017-2022 Yegor Bugayenko

License

MIT

Instance Attribute Summary collapse

Instance Method Summary collapse

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
46
# 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 = []
  @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

#excludesObject

Returns the value of attribute excludes.



30
31
32
# File 'lib/xcop/rake_task.rb', line 30

def excludes
  @excludes
end

#fail_on_errorObject

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

#includesObject

Returns the value of attribute includes.



30
31
32
# File 'lib/xcop/rake_task.rb', line 30

def includes
  @includes
end

#licenseObject

Returns the value of attribute license.



30
31
32
# File 'lib/xcop/rake_task.rb', line 30

def license
  @license
end

#nameObject

Returns the value of attribute name.



30
31
32
# File 'lib/xcop/rake_task.rb', line 30

def name
  @name
end

#quietObject

Returns the value of attribute quiet.



30
31
32
# File 'lib/xcop/rake_task.rb', line 30

def quiet
  @quiet
end