Class: CruiseControl::Server
- Inherits:
-
Object
- Object
- CruiseControl::Server
- Defined in:
- lib/cruise_control/server.rb
Instance Attribute Summary collapse
-
#projects ⇒ Object
readonly
Returns the value of attribute projects.
Instance Method Summary collapse
-
#initialize(host, port = 80) ⇒ Server
constructor
A new instance of Server.
-
#pass? ⇒ Boolean
Returns true if all projects from this server passes.
-
#refresh ⇒ Object
Retrieve the projects’ newest status from the server.
Constructor Details
#initialize(host, port = 80) ⇒ Server
Returns a new instance of Server.
9 10 11 12 13 |
# File 'lib/cruise_control/server.rb', line 9 def initialize(host, port = 80) @host, @port = host, port @projects = [] refresh end |
Instance Attribute Details
#projects ⇒ Object (readonly)
Returns the value of attribute projects.
7 8 9 |
# File 'lib/cruise_control/server.rb', line 7 def projects @projects end |
Instance Method Details
#pass? ⇒ Boolean
Returns true if all projects from this server passes
21 22 23 |
# File 'lib/cruise_control/server.rb', line 21 def pass? projects.all? {|p| p.pass?} end |
#refresh ⇒ Object
Retrieve the projects’ newest status from the server
16 17 18 |
# File 'lib/cruise_control/server.rb', line 16 def refresh @projects.replace parse_projects_from_xml(Net::HTTP.get @host, '/dashboard/rss.xml', @port) end |