Class: Stable::Commands::Destroy
- Inherits:
-
Object
- Object
- Stable::Commands::Destroy
- Defined in:
- lib/stable/commands/destroy.rb
Overview
Destroy command - permanently deletes a Rails application with confirmation
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(name) ⇒ Destroy
constructor
A new instance of Destroy.
Constructor Details
#initialize(name) ⇒ Destroy
Returns a new instance of Destroy.
9 10 11 |
# File 'lib/stable/commands/destroy.rb', line 9 def initialize(name) @name = name end |
Instance Method Details
#call ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/stable/commands/destroy.rb', line 13 def call app = Services::AppRegistry.find(@name) abort 'App not found' unless app display_warning(app) return unless confirm_destruction puts "\nšļø Destroying #{@name}..." perform_destruction(app) puts "ā Successfully destroyed #{@name}" end |