Class: Stable::Commands::Destroy

Inherits:
Object
  • Object
show all
Defined in:
lib/stable/commands/destroy.rb

Overview

Destroy command - permanently deletes a Rails application with confirmation

Instance Method Summary collapse

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

#callObject



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