Class: Jets::Names

Inherits:
Object
  • Object
show all
Extended by:
Memoist
Defined in:
lib/jets/names.rb

Overview

This class groups the names in one place. Some names are for CloudFormation Some are for the Build process

Class Method Summary collapse

Class Method Details

.api_deployment_template_pathObject



37
38
39
# File 'lib/jets/names.rb', line 37

def api_deployment_template_path
  "#{templates_folder}/api-deployment.yml"
end

.api_gateway_template_pathObject

consider moving these methods into cfn/builder/helpers.rb or that area.



33
34
35
# File 'lib/jets/names.rb', line 33

def api_gateway_template_path
  "#{templates_folder}/api-gateway.yml"
end

.api_mapping_template_pathObject



41
42
43
# File 'lib/jets/names.rb', line 41

def api_mapping_template_path
  "#{templates_folder}/api-mapping.yml"
end

.app_template_path(app_class) ⇒ Object



17
18
19
20
# File 'lib/jets/names.rb', line 17

def app_template_path(app_class)
  underscored = underscore(app_class)
  "#{templates_folder}/app-#{underscored}.yml"
end

.authorizer_template_path(path) ⇒ Object



57
58
59
60
61
# File 'lib/jets/names.rb', line 57

def authorizer_template_path(path)
  underscored = underscore(path)
  underscored.sub!(/^app-/, "")
  "#{templates_folder}/#{underscored}.yml"
end

.gateway_api_nameObject



53
54
55
# File 'lib/jets/names.rb', line 53

def gateway_api_name
  Jets.project.namespace
end

.one_controller_template_pathObject



13
14
15
# File 'lib/jets/names.rb', line 13

def one_controller_template_path
  "#{templates_folder}/controller.yml"
end

.parent_stack_nameObject



49
50
51
# File 'lib/jets/names.rb', line 49

def parent_stack_name
  Jets.project.namespace
end

.parent_template_pathObject

consider moving these methods into cfn/builder/helpers.rb or that area.



28
29
30
# File 'lib/jets/names.rb', line 28

def parent_template_path
  "#{templates_folder}/parent.yml"
end

.shared_resources_template_pathObject



45
46
47
# File 'lib/jets/names.rb', line 45

def shared_resources_template_path
  "#{templates_folder}/shared-resources.yml"
end

.shared_template_path(shared_class) ⇒ Object



22
23
24
25
# File 'lib/jets/names.rb', line 22

def shared_template_path(shared_class)
  underscored = underscore(shared_class)
  "#{templates_folder}/shared-#{underscored}.yml"
end

.templates_folderObject



9
10
11
# File 'lib/jets/names.rb', line 9

def templates_folder
  "#{Jets.build_root}/templates"
end

.underscore(s) ⇒ Object



63
64
65
# File 'lib/jets/names.rb', line 63

def underscore(s)
  s.to_s.underscore.sub(/\.rb$/, "").tr("/", "-")
end