Class: GeneSystem::Commands::InstallManifest
- Inherits:
-
Object
- Object
- GeneSystem::Commands::InstallManifest
- Includes:
- Helpers
- Defined in:
- lib/gene_system/commands/install_manifest.rb
Overview
Install manifest command
Constant Summary collapse
- DEFAULT_MANIFEST_NAME =
Default name of gene system manifest
'manifest.json'.freeze
Instance Method Summary collapse
-
#initialize(options) ⇒ InstallManifest
constructor
A new instance of InstallManifest.
-
#run ⇒ Object
Applies install instructions from a manifest to the host system.
Methods included from Helpers
#ask, #filters, #filters?, #skip?, #steps
Constructor Details
#initialize(options) ⇒ InstallManifest
Returns a new instance of InstallManifest.
12 13 14 15 16 |
# File 'lib/gene_system/commands/install_manifest.rb', line 12 def initialize() @options = @prompt = TTY::Prompt.new @manifest = nil end |
Instance Method Details
#run ⇒ Object
Applies install instructions from a manifest to the host system.
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 47 48 |
# File 'lib/gene_system/commands/install_manifest.rb', line 22 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("INSTALL #{@manifest.name_and_version}") steps.each do |step| next if skip?(:install, step, platform) vars = ask(step.install.prompts) platform.execute_commands( step.install.cmd, vars ) end puts( "✔ Manifest #{@manifest.name_and_version} successfully installed" ) end |