Class: GeneSystem::Commands::RemoveManifest
- Inherits:
-
Object
- Object
- GeneSystem::Commands::RemoveManifest
- Defined in:
- lib/gene_system/commands/remove_manifest.rb
Overview
Remove manifest command
Constant Summary collapse
- DEFAULT_MANIFEST_NAME =
Default name of gene system manifest
'manifest.json'.freeze
Instance Method Summary collapse
-
#initialize(options) ⇒ RemoveManifest
constructor
A new instance of RemoveManifest.
-
#run ⇒ Object
Applies remove instructions from a manifest to the host system.
Constructor Details
#initialize(options) ⇒ RemoveManifest
Returns a new instance of RemoveManifest.
10 11 12 13 14 |
# File 'lib/gene_system/commands/remove_manifest.rb', line 10 def initialize() @options = @prompt = TTY::Prompt.new @manifest = nil end |
Instance Method Details
#run ⇒ Object
Applies remove instructions from a manifest to the host system.
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/gene_system/commands/remove_manifest.rb', line 20 def run manifest_path = @options.manifest manifest_path ||= @prompt.ask( 'Please enter the path to the configuration manifest', default: DEFAULT_MANIFEST_NAME ) @manifest = GeneSystem::Manifest.new_from_file(manifest_path) platform = GeneSystem::Platform.new puts("REMOVE #{@manifest.name_and_version}") @manifest.steps.each do |step| next if skip?(step, platform) vars = ask(step.remove.prompts) platform.execute_commands( step.remove.cmd, vars ) end puts( "✔ Manifest #{@manifest.name_and_version} successfully removed" ) end |