Class: CiStatus::CruiseControl
- Inherits:
-
Object
- Object
- CiStatus::CruiseControl
- 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
-
#url ⇒ Object
Returns the value of attribute url.
Instance Method Summary collapse
- #[](name) ⇒ Object
-
#initialize(url) ⇒ CruiseControl
constructor
A new instance of CruiseControl.
- #projects ⇒ Object
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
#url ⇒ Object
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 |
#projects ⇒ Object
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 |