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
  "#{template_path_prefix}-api-deployment.yml"
end

.api_gateway_template_pathObject

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



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

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

.api_resources_template_path(page) ⇒ Object



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

def api_resources_template_path(page)
  "#{template_path_prefix}-api-resources-#{page}.yml"
end

.app_template_path(app_class) ⇒ Object



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

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

.authorizer_template_path(path) ⇒ Object



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

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

.gateway_api_nameObject



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

def gateway_api_name
  "#{Jets.config.project_namespace}"
end

.parent_stack_nameObject



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

def parent_stack_name
  File.basename(parent_template_path, ".yml")
end

.parent_template_pathObject

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



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

def parent_template_path
  "#{template_path_prefix}.yml"
end

.shared_resources_template_pathObject



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

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

.shared_template_path(shared_class) ⇒ Object



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

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

.template_path_prefixObject



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

def template_path_prefix
  "#{Jets.build_root}/templates/#{Jets.config.project_namespace}"
end

.underscore(s) ⇒ Object



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

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