Class: BuildMaster::ServerManager

Inherits:
Object
  • Object
show all
Defined in:
lib/buildmaster/project/server_manager.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(server) ⇒ ServerManager

Returns a new instance of ServerManager.



6
7
8
9
# File 'lib/buildmaster/project/server_manager.rb', line 6

def initialize(server)
  @server = server
  @status = 'stopped'
end

Instance Attribute Details

#statusObject (readonly)

Returns the value of attribute status.



4
5
6
# File 'lib/buildmaster/project/server_manager.rb', line 4

def status
  @status
end

Instance Method Details

#startObject



11
12
13
14
15
# File 'lib/buildmaster/project/server_manager.rb', line 11

def start
  starting_server
  wait_for_condition {@server.running?}
  @status = 'started'
end

#stopObject



17
18
19
20
21
# File 'lib/buildmaster/project/server_manager.rb', line 17

def stop
  stopping_server
  wait_for_condition {not @server.running?}
  @status = 'stopped'
end