Sha256: 6dbd79dfd6bb443d4eff5e0b36e4861c6c1ef08acfc7357a972354ce48b53fc1

Contents?: true

Size: 580 Bytes

Versions: 58

Compression:

Stored size: 580 Bytes

Contents

module Kubes::Args
  class Custom
    extend Memoist
    include Dsl
    include DslEvaluator

    attr_accessor :name
    def initialize(name, file)
      @name = name.to_s
      @file = file # IE: .kubes/config/kubectl/args.rb
      @commands = {}
    end

    def build
      return @commands unless File.exist?(@file)
      evaluate_file(@file)
      @commands.deep_stringify_keys!
    end
    memoize :build

    def args
      args = dig("args")
      args.compact.flatten
    end

    def dig(prop, default=[])
      @commands.dig(@name, prop) || default
    end
  end
end

Version data entries

58 entries across 58 versions & 1 rubygems

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