Class: Buildr::Cobertura::CoberturaConfig

Inherits:
Object
  • Object
show all
Defined in:
lib/buildr/java/cobertura.rb

Overview

:nodoc:

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(project) ⇒ CoberturaConfig

Returns a new instance of CoberturaConfig.



68
69
70
# File 'lib/buildr/java/cobertura.rb', line 68

def initialize(project)
  @project = project
end

Instance Attribute Details

#data_fileObject



77
78
79
# File 'lib/buildr/java/cobertura.rb', line 77

def data_file
  @data_file ||= project.path_to(:reports, 'cobertura.ser')
end

#instrumented_dirObject



81
82
83
# File 'lib/buildr/java/cobertura.rb', line 81

def instrumented_dir
  @instrumented_dir ||= project.path_to(:target, :instrumented, :classes)
end

#report_dirObject



85
86
87
# File 'lib/buildr/java/cobertura.rb', line 85

def report_dir
  @report_dir ||= project.path_to(:reports, :cobertura)
end

Instance Method Details

#checkObject



121
122
123
# File 'lib/buildr/java/cobertura.rb', line 121

def check
  @check ||= CoberturaCheck.new
end

#exclude(*classPatterns) ⇒ Object

:call-seq:

project.cobertura.exclude(*classPatterns)


108
109
110
111
# File 'lib/buildr/java/cobertura.rb', line 108

def exclude(*classPatterns)
  excludes.push(*classPatterns.map { |p| String === p ? Regexp.new(p) : p })
  self
end

#excludesObject



113
114
115
# File 'lib/buildr/java/cobertura.rb', line 113

def excludes
  @excludeClasses ||= []
end

#include(*classPatterns) ⇒ Object

:call-seq:

project.cobertura.include(*classPatterns)


96
97
98
99
# File 'lib/buildr/java/cobertura.rb', line 96

def include(*classPatterns)
  includes.push(*classPatterns.map { |p| String === p ? Regexp.new(p) : p })
  self
end

#includesObject



101
102
103
# File 'lib/buildr/java/cobertura.rb', line 101

def includes
  @includeClasses ||= []
end

#report_to(file = nil) ⇒ Object



89
90
91
# File 'lib/buildr/java/cobertura.rb', line 89

def report_to(file = nil)
  File.expand_path(File.join(*[report_dir, file.to_s].compact))
end

#sourcesObject



117
118
119
# File 'lib/buildr/java/cobertura.rb', line 117

def sources
  project.compile.sources
end