Class: CiStatus::CruiseControl

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

Overview

Parses the CC format (also used by CCMenu, CCTray etc.)

Defined Under Namespace

Classes: Project

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(url) ⇒ CruiseControl

Returns a new instance of CruiseControl.



9
10
11
# File 'lib/ci_status/cruise_control.rb', line 9

def initialize(url)
  self.url = url
end

Instance Attribute Details

#urlObject

Returns the value of attribute url.



7
8
9
# File 'lib/ci_status/cruise_control.rb', line 7

def url
  @url
end

Instance Method Details

#[](name) ⇒ Object



24
25
26
# File 'lib/ci_status/cruise_control.rb', line 24

def [](name)
  projects.detect { |p| p.name == name }
end

#projectsObject



13
14
15
16
17
18
19
20
21
22
# File 'lib/ci_status/cruise_control.rb', line 13

def projects
  @projects ||= document.xpath("/Projects/Project").map do |project|
    Project.new do |p|
      p.name   = project["name"]
      p.url    = project["webUrl"]
      p.time   = project["lastBuildTime"]
      p.status = project["lastBuildStatus"]
    end
  end
end