Class: CruiseControl::Server

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

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#projectsObject (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

Returns:

  • (Boolean)


21
22
23
# File 'lib/cruise_control/server.rb', line 21

def pass?
  projects.all? {|p| p.pass?}
end

#refreshObject

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