Class: BuildMaster::ServerManager
- Inherits:
-
Object
- Object
- BuildMaster::ServerManager
- Defined in:
- lib/buildmaster/project/server_manager.rb
Instance Attribute Summary collapse
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Instance Method Summary collapse
-
#initialize(server) ⇒ ServerManager
constructor
A new instance of ServerManager.
- #start ⇒ Object
- #stop ⇒ Object
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
#status ⇒ Object (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
#start ⇒ Object
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 |
#stop ⇒ Object
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 |