Class: Xcop::RakeTask

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

Overview

Rake task.

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#excludesObject

Returns the value of attribute excludes.



36
37
38
# File 'lib/xcop/rake_task.rb', line 36

def excludes
  @excludes
end

#fail_on_errorObject

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

#includesObject

Returns the value of attribute includes.



37
38
39
# File 'lib/xcop/rake_task.rb', line 37

def includes
  @includes
end

#licenseObject

Returns the value of attribute license.



38
39
40
# File 'lib/xcop/rake_task.rb', line 38

def license
  @license
end

#nameObject

Returns the value of attribute name.



34
35
36
# File 'lib/xcop/rake_task.rb', line 34

def name
  @name
end

#quietObject

Returns the value of attribute quiet.



39
40
41
# File 'lib/xcop/rake_task.rb', line 39

def quiet
  @quiet
end