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_cors_template_path(page_number) ⇒ Object



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

def api_cors_template_path(page_number)
  "#{templates_folder}/api-cors-#{page_number}.yml"
end

.api_deployment_template_pathObject



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

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



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

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

.api_methods_template_path(page_number) ⇒ Object



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

def api_methods_template_path(page_number)
  "#{templates_folder}/api-methods-#{page_number}.yml"
end

.api_resources_template_path(page_number) ⇒ Object



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

def api_resources_template_path(page_number)
  "#{templates_folder}/api-resources-#{page_number}.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



69
70
71
72
73
# File 'lib/jets/names.rb', line 69

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

.gateway_api_nameObject



65
66
67
# File 'lib/jets/names.rb', line 65

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}/jets-controller.yml"
end

.parent_stack_nameObject



61
62
63
# File 'lib/jets/names.rb', line 61

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



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

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



75
76
77
# File 'lib/jets/names.rb', line 75

def underscore(s)
  s.to_s.underscore.sub(/\.rb$/,'').gsub('/','-')
end