Sha256: 01c704d3f790b1fb7ed0c4a0e780b1279c8b65df5093c62057e2c44d0817aadd

Contents?: true

Size: 1.14 KB

Versions: 20

Compression:

Stored size: 1.14 KB

Contents

# frozen_string_literal: true

require 'lino'
require_relative 'base'

module RubyHelm
  module Commands
    class Template < Base
      # rubocop:disable Metrics/AbcSize
      # rubocop:disable Metrics/MethodLength
      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|
          unless values.empty?
            sub = sub.with_option(
              '--set',
              paired_values.join(','),
              separator: ' '
            )
          end
          sub = sub.with_option('--name', name, separator: ' ') if name
          if output_directory
            sub = sub.with_option(
              '--output-dir',
              output_directory,
              separator: ' '
            )
          end
          sub
        end
               .with_argument(chart)
      end
      # rubocop:enable Metrics/MethodLength
      # rubocop:enable Metrics/AbcSize
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
ruby_helm-0.6.0.pre.2 lib/ruby_helm/commands/template.rb
ruby_helm-0.6.0.pre.1 lib/ruby_helm/commands/template.rb
ruby_helm-0.5.0 lib/ruby_helm/commands/template.rb
ruby_helm-0.4.0.pre.6 lib/ruby_helm/commands/template.rb
ruby_helm-0.4.0.pre.5 lib/ruby_helm/commands/template.rb
ruby_helm-0.4.0.pre.4 lib/ruby_helm/commands/template.rb
ruby_helm-0.4.0.pre.3 lib/ruby_helm/commands/template.rb
ruby_helm-0.4.0.pre.2 lib/ruby_helm/commands/template.rb
ruby_helm-0.4.0.pre.1 lib/ruby_helm/commands/template.rb
ruby_helm-0.3.0 lib/ruby_helm/commands/template.rb
ruby_helm-0.2.0.pre.10 lib/ruby_helm/commands/template.rb
ruby_helm-0.2.0.pre.9 lib/ruby_helm/commands/template.rb
ruby_helm-0.2.0.pre.8 lib/ruby_helm/commands/template.rb
ruby_helm-0.2.0.pre.7 lib/ruby_helm/commands/template.rb
ruby_helm-0.2.0.pre.6 lib/ruby_helm/commands/template.rb
ruby_helm-0.2.0.pre.5 lib/ruby_helm/commands/template.rb
ruby_helm-0.2.0.pre.4 lib/ruby_helm/commands/template.rb
ruby_helm-0.2.0.pre.3 lib/ruby_helm/commands/template.rb
ruby_helm-0.2.0.pre.2 lib/ruby_helm/commands/template.rb
ruby_helm-0.2.0.pre.1 lib/ruby_helm/commands/template.rb