Class: Stable::Services::AppStopper
- Inherits:
-
Object
- Object
- Stable::Services::AppStopper
- Defined in:
- lib/stable/services/app_stopper.rb
Overview
Service for stopping Rails applications
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(name) ⇒ AppStopper
constructor
A new instance of AppStopper.
Constructor Details
#initialize(name) ⇒ AppStopper
Returns a new instance of AppStopper.
7 8 9 |
# File 'lib/stable/services/app_stopper.rb', line 7 def initialize(name) @app = AppRegistry.fetch(name) end |
Instance Method Details
#call ⇒ Object
11 12 13 14 15 |
# File 'lib/stable/services/app_stopper.rb', line 11 def call ProcessManager.stop(@app) AppRegistry.mark_stopped(@app[:name]) puts "✔ #{@app[:name]} stopped" end |