Sha256: 10ce8379c5fa7484f8c1b07c1f961ea8f4a8dad00f579e71ee40b907966b190b

Contents?: true

Size: 895 Bytes

Versions: 1

Compression:

Stored size: 895 Bytes

Contents

require 'lino'
require_relative 'base'

module RubyHelm
  module Commands
    class Template < Base
      def configure_command(builder, opts)
        chart = opts[:chart]
        name = opts[:name]
        output_directory = opts[:output_directory]
        values = opts[:values] || {}

        paired_values = values.map do |key, value|
          "#{key}=#{value}"
        end

        builder.with_subcommand('template') do |sub|
          sub = sub.with_option(
              '--set',
              paired_values.join(","),
              separator: ' ') unless values.empty?
          sub = sub.with_option('--name', name, separator: ' ') if name
          sub = sub.with_option(
              '--output-dir',
              output_directory,
              separator: ' '
          ) if output_directory
          sub
        end
            .with_argument(chart)
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ruby_helm-0.1.2 lib/ruby_helm/commands/template.rb