Class: Hyraft::Rule::RemoveAdapterCommand
- Inherits:
-
Object
- Object
- Hyraft::Rule::RemoveAdapterCommand
- Defined in:
- lib/hyraft/rule/adapter_request/remove_adapter_command.rb
Class Method Summary collapse
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(args) ⇒ RemoveAdapterCommand
constructor
A new instance of RemoveAdapterCommand.
Constructor Details
#initialize(args) ⇒ RemoveAdapterCommand
Returns a new instance of RemoveAdapterCommand.
12 13 14 15 16 |
# File 'lib/hyraft/rule/adapter_request/remove_adapter_command.rb', line 12 def initialize(args) @adapter_input = args[0] # "admin-app/users" or "api-app/products" @target_dir = args[1] || "." parse_adapter_input end |
Class Method Details
.start(args) ⇒ Object
8 9 10 |
# File 'lib/hyraft/rule/adapter_request/remove_adapter_command.rb', line 8 def self.start(args) new(args).execute end |
Instance Method Details
#execute ⇒ Object
18 19 20 21 22 23 24 25 26 27 |
# File 'lib/hyraft/rule/adapter_request/remove_adapter_command.rb', line 18 def execute return show_manifest unless @adapter_name puts "\e[33m🗑️ Removing adapter: '#{@app_folder}/#{@adapter_name}'\e[0m" remove_adapter_only puts "\e[32m✅ Adapter removed: '#{@app_folder}/#{@adapter_name}'\e[0m" puts "\e[36mNote: Engine layer and other adapters preserved\e[0m" end |