Class: Kurgan::Component

Inherits:
Init
  • Object
show all
Defined in:
lib/kurgan/component.rb

Instance Method Summary collapse

Methods inherited from Init

#ci_init, #create_cfhighlander_template, #create_config_yaml, #git_init, #set_template_components, source_root

Instance Method Details

#copy_licenceObject



39
40
41
42
43
44
45
# File 'lib/kurgan/component.rb', line 39

def copy_licence
  if yes?("Use MIT license?")
    copy_file "templates/MITLICENSE", "#{@dir}/LICENSE"
  else
    say "Skipping license", :yellow
  end
end

#create_cfndsl_templateObject



26
27
28
# File 'lib/kurgan/component.rb', line 26

def create_cfndsl_template
  template('templates/cfndsl.rb.tt', "#{@dir}/#{name}.cfndsl.rb")
end

#create_default_config_testObject



34
35
36
37
# File 'lib/kurgan/component.rb', line 34

def create_default_config_test
  @test_name = 'default'
  template('templates/test.yaml.tt', "#{@dir}/tests/#{@test_name}.test.yaml")
end

#create_readmeObject



30
31
32
# File 'lib/kurgan/component.rb', line 30

def create_readme
  template "templates/README.md.component.tt", "#{@dir}/README.md"
end

#set_descriptionObject



15
16
17
# File 'lib/kurgan/component.rb', line 15

def set_description
  @description = ask "template description ", default: "#{name} - \#{component_version}"
end

#set_directoryObject



10
11
12
13
# File 'lib/kurgan/component.rb', line 10

def set_directory
  @dir = ask "directory name ", default: "hl-component-#{name}"
  empty_directory @dir
end

#set_template_parametersObject



19
20
21
22
23
24
# File 'lib/kurgan/component.rb', line 19

def set_template_parameters
  @parameters = [
    { name: 'EnvironmentName', default: 'dev', options: 'isGlobal: true' },
    { name: 'EnvironmentType', default: 'development', options: "allowedValues: ['development','production'], isGlobal: true" }
  ]
end

#set_typeObject



6
7
8
# File 'lib/kurgan/component.rb', line 6

def set_type
  @type = 'component'
end