Class: Stable::Commands::Remove
- Inherits:
-
Object
- Object
- Stable::Commands::Remove
- Defined in:
- lib/stable/commands/remove.rb
Overview
Remove command - removes a Rails application
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(name) ⇒ Remove
constructor
A new instance of Remove.
Constructor Details
#initialize(name) ⇒ Remove
Returns a new instance of Remove.
7 8 9 |
# File 'lib/stable/commands/remove.rb', line 7 def initialize(name) @name = name end |
Instance Method Details
#call ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/stable/commands/remove.rb', line 11 def call app = Services::AppRegistry.find(@name) abort 'App not found' unless app Services::ProcessManager.stop(app) Services::HostsManager.remove(app[:domain]) Services::CaddyManager.remove(app[:domain]) Services::AppRegistry.remove(@name) Services::CaddyManager.reload puts "Removed #{@name}" end |