Sha256: 9e67b63ebef3dfa4134b17c307099cb23bb1a135be31d7272df72b46627c1487

Contents?: true

Size: 415 Bytes

Versions: 26

Compression:

Stored size: 415 Bytes

Contents

module Kubes::Compiler::Util
  module Normalize
    def normalize_kind(path)
      extract_type(path).underscore.camelize # Deployment, Service, Ingress, ManagedCertificate, etc
    end

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

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
kubes-0.9.3 lib/kubes/compiler/util/normalize.rb
kubes-0.9.2 lib/kubes/compiler/util/normalize.rb
kubes-0.9.1 lib/kubes/compiler/util/normalize.rb
kubes-0.9.0 lib/kubes/compiler/util/normalize.rb
kubes-0.8.10 lib/kubes/compiler/util/normalize.rb
kubes-0.8.9 lib/kubes/compiler/util/normalize.rb
kubes-0.8.8 lib/kubes/compiler/util/normalize.rb
kubes-0.8.7 lib/kubes/compiler/util/normalize.rb
kubes-0.8.6 lib/kubes/compiler/util/normalize.rb
kubes-0.8.5 lib/kubes/compiler/util/normalize.rb
kubes-0.8.4 lib/kubes/compiler/util/normalize.rb
kubes-0.8.3 lib/kubes/compiler/util/normalize.rb
kubes-0.8.2 lib/kubes/compiler/util/normalize.rb
kubes-0.8.1 lib/kubes/compiler/util/normalize.rb
kubes-0.8.0 lib/kubes/compiler/util/normalize.rb
kubes-0.7.10 lib/kubes/compiler/util/normalize.rb
kubes-0.7.9 lib/kubes/compiler/util/normalize.rb
kubes-0.7.8 lib/kubes/compiler/util/normalize.rb
kubes-0.7.7 lib/kubes/compiler/util/normalize.rb
kubes-0.7.6 lib/kubes/compiler/util/normalize.rb