Sha256: 775151746cfcf40889408e7414fd6aedd43fc66db4ca99f25abbfc482761f91f

Contents?: true

Size: 702 Bytes

Versions: 6

Compression:

Stored size: 702 Bytes

Contents

# frozen_string_literal: true

module RubyEasyRSA
  module Commands
    module Mixins
      module EncryptKeyConfig
        private

        # rubocop:disable Style/RedundantAssignment
        def configure_command(initial_builder, parameters)
          builder = super
          builder = with_encrypt_key(builder, encrypt_key(parameters))
          builder
        end
        # rubocop:enable Style/RedundantAssignment

        def encrypt_key(opts)
          opts[:encrypt_key].nil? ? true : opts[:encrypt_key]
        end

        def with_encrypt_key(builder, encrypt_key)
          return builder if encrypt_key

          builder.with_argument('nopass')
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
ruby_easy_rsa-0.14.0.pre.2 lib/ruby_easy_rsa/commands/mixins/encrypt_key_config.rb
ruby_easy_rsa-0.14.0.pre.1 lib/ruby_easy_rsa/commands/mixins/encrypt_key_config.rb
ruby_easy_rsa-0.13.0 lib/ruby_easy_rsa/commands/mixins/encrypt_key_config.rb
ruby_easy_rsa-0.12.0.pre.7 lib/ruby_easy_rsa/commands/mixins/encrypt_key_config.rb
ruby_easy_rsa-0.12.0.pre.6 lib/ruby_easy_rsa/commands/mixins/encrypt_key_config.rb
ruby_easy_rsa-0.12.0.pre.5 lib/ruby_easy_rsa/commands/mixins/encrypt_key_config.rb