Class: BlinkyMonitor::CruiseControlServer

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

Instance Method Summary collapse

Constructor Details

#initialize(url) ⇒ CruiseControlServer

Returns a new instance of CruiseControlServer.



5
6
7
# File 'lib/blinky_monitor/cruise_control_server.rb', line 5

def initialize url
  @url = url
end

Instance Method Details

#statusObject



9
10
11
12
13
14
15
# File 'lib/blinky_monitor/cruise_control_server.rb', line 9

def status
  xml = open("#{@url}/cc.xml").read
  status = :success if xml.include? 'lastBuildStatus="Success"'
  status = :failure if xml.include? 'lastBuildStatus="Failure"'
  status = :building if xml.include? 'activity="Building"'
  status
end