Sha256: 4fd2b50abc46e06439739fbd9387f04422d542f5f26712fd6d3dbb1b0755fc4b

Contents?: true

Size: 1.4 KB

Versions: 6

Compression:

Stored size: 1.4 KB

Contents

# This class groups the naming in one place.
# Some naming is for CloudFormation
# Some are for the Build process
class Jets::Naming
  # Mainly used by build.rb
  class << self
    extend Memoist

    def app_template_path(app_class)
      underscored = app_class.to_s.underscore.gsub('/','-')
      "#{template_path_prefix}-app-#{underscored}.yml"
    end

    def shared_template_path(shared_class)
      underscored = shared_class.to_s.underscore.gsub('/','-')
      "#{template_path_prefix}-shared-#{underscored}.yml"
    end

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

    # consider moving these methods into cfn/builder/helpers.rb or that area.
    def parent_template_path
      "#{template_path_prefix}.yml"
    end

    # consider moving these methods into cfn/builder/helpers.rb or that area.
    def api_gateway_template_path
      "#{template_path_prefix}-api-gateway.yml"
    end

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

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

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

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

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

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
jets-2.1.7 lib/jets/naming.rb
jets-2.1.6 lib/jets/naming.rb
jets-2.1.5 lib/jets/naming.rb
jets-2.1.4 lib/jets/naming.rb
jets-2.1.3 lib/jets/naming.rb
jets-2.1.2 lib/jets/naming.rb