Sha256: 257cacb9cd7ac7de1f60fa7b8f8778c5aa6a78c081ef84edef62789b3f17ee4a

Contents?: true

Size: 415 Bytes

Versions: 9

Compression:

Stored size: 415 Bytes

Contents

module Kubes::Compiler::Util
  module Normalize
    def normalize_kind(path)
      info = path.sub(%r{.*/.kubes/resources/}, '')
      extract_type(info).underscore.camelize # Deployment, Service, Ingress, ManagedCertificate, etc
    end

    # info: web/service.yaml
    def extract_type(info)
      _, kind = info.split('/')
      kind.sub('.yaml','').sub('.yml','').sub('.rb','').sub(/-.*/,'')
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
kubes-0.6.8 lib/kubes/compiler/util/normalize.rb
kubes-0.6.7 lib/kubes/compiler/util/normalize.rb
kubes-0.6.6 lib/kubes/compiler/util/normalize.rb
kubes-0.6.5 lib/kubes/compiler/util/normalize.rb
kubes-0.6.4 lib/kubes/compiler/util/normalize.rb
kubes-0.6.3 lib/kubes/compiler/util/normalize.rb
kubes-0.6.2 lib/kubes/compiler/util/normalize.rb
kubes-0.6.1 lib/kubes/compiler/util/normalize.rb
kubes-0.6.0 lib/kubes/compiler/util/normalize.rb