Class: Drakkon::Skeleton::Install

Inherits:
Object
  • Object
show all
Includes:
InstallHelpers
Defined in:
lib/drakkon/skeleton/install.rb

Overview

Run Command for CLI

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from InstallHelpers

#config_file, #do_the_check, #load_templates, #path?, #prompt, #read_config, #source?, #source_setup, #sources, #valid_structure?, #valid_template?, #valid_version?

Constructor Details

#initialize(args = []) ⇒ Install

Returns a new instance of Install.



8
9
10
11
12
13
14
# File 'lib/drakkon/skeleton/install.rb', line 8

def initialize(args = [])
  @args = args
  @data = {}
  source_setup
  do_the_check
  save!
end

Instance Attribute Details

#argsObject

Returns the value of attribute args.



6
7
8
# File 'lib/drakkon/skeleton/install.rb', line 6

def args
  @args
end

#configObject

Returns the value of attribute config.



6
7
8
# File 'lib/drakkon/skeleton/install.rb', line 6

def config
  @config
end

#dataObject

Returns the value of attribute data.



6
7
8
# File 'lib/drakkon/skeleton/install.rb', line 6

def data
  @data
end

#nameObject

Returns the value of attribute name.



6
7
8
# File 'lib/drakkon/skeleton/install.rb', line 6

def name
  @name
end

#sourceObject

Returns the value of attribute source.



6
7
8
# File 'lib/drakkon/skeleton/install.rb', line 6

def source
  @source
end

Instance Method Details

#save!Object



16
17
18
19
20
21
22
23
24
25
# File 'lib/drakkon/skeleton/install.rb', line 16

def save!
  details = {
    **data,
    **config,
    source: source
  }

  Hub.config.skeletons[name] = details
  Hub.write
end