Module: Kubes::Compiler::Util::Normalize

Included in:
Dsl::Syntax::Resource, Strategy::Base
Defined in:
lib/kubes/compiler/util/normalize.rb

Instance Method Summary collapse

Instance Method Details

#extract_type(info) ⇒ Object

info: web/service.yaml



8
9
10
11
12
# File 'lib/kubes/compiler/util/normalize.rb', line 8

def extract_type(info)
  info = info.sub(%r{.*/.kubes/resources/}, '')
  _, kind = info.split('/')
  kind.sub('.yaml','').sub('.yml','').sub('.rb','').sub(/-.*/,'')
end

#normalize_kind(path) ⇒ Object



3
4
5
# File 'lib/kubes/compiler/util/normalize.rb', line 3

def normalize_kind(path)
  extract_type(path).underscore.camelize # Deployment, Service, Ingress, ManagedCertificate, etc
end