Sha256: f5f21e4f503c86b60469e534f85cd4620e7eedb756b70101e775451f943a92fc

Contents?: true

Size: 1.3 KB

Versions: 129

Compression:

Stored size: 1.3 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_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

129 entries across 129 versions & 2 rubygems

Version Path
jets-2.1.1 lib/jets/naming.rb
jets-2.1.0 lib/jets/naming.rb
jets-2.0.6 lib/jets/naming.rb
jets-2.0.5 lib/jets/naming.rb
jets-2.0.4 lib/jets/naming.rb
jets-2.0.3 lib/jets/naming.rb
jets-2.0.1 lib/jets/naming.rb
jets-2.0.0 lib/jets/naming.rb
jets-1.9.32 lib/jets/naming.rb
jets-1.9.31 lib/jets/naming.rb
jets-1.9.30 lib/jets/naming.rb
jets-1.9.29 lib/jets/naming.rb
jets-1.9.28 lib/jets/naming.rb
jets-1.9.27 lib/jets/naming.rb
jets-1.9.26 lib/jets/naming.rb
jets-1.9.25 lib/jets/naming.rb
jets-1.9.24 lib/jets/naming.rb
jets-1.9.23 lib/jets/naming.rb
jets-1.9.22 lib/jets/naming.rb
jets-1.9.21 lib/jets/naming.rb