Class: BuildLights::CcNet

Inherits:
Object
  • Object
show all
Defined in:
lib/ccnet.rb

Instance Method Summary collapse

Constructor Details

#initialize(uri, parser = XmlParser) ⇒ CcNet

Returns a new instance of CcNet.



6
7
8
9
# File 'lib/ccnet.rb', line 6

def initialize(uri, parser = XmlParser)
  puts "CruiseControl.net url: #{uri}" if $verbose
  @doc = parser.parse(uri)
end

Instance Method Details

#failed_jobsObject



11
12
13
14
15
16
17
18
19
# File 'lib/ccnet.rb', line 11

def failed_jobs
  @doc.search(:Project).map do |project|
    name = project[:name]
    status = project[:lastBuildStatus]
    puts "#{name} -> #{status}" if $verbose
    failed = /FAIL/i.match(status)
    name if failed
  end.compact
end