Sha256: c168841b143c65a1fcac9e8a79a04601f96bf0023e5bc7132be5fc9565de38fc

Contents?: true

Size: 697 Bytes

Versions: 8

Compression:

Stored size: 697 Bytes

Contents

# frozen_string_literal: true

module RubyEasyRSA
  module Commands
    module Mixins
      module EncryptKeyConfig
        # rubocop:disable Style/RedundantAssignment
        def configure_command(builder, opts)
          builder = super(builder, opts)
          builder = with_encrypt_key(builder, encrypt_key(opts))
          builder
        end
        # rubocop:enable Style/RedundantAssignment

        private

        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

8 entries across 8 versions & 1 rubygems

Version Path
ruby_easy_rsa-0.12.0.pre.4 lib/ruby_easy_rsa/commands/mixins/encrypt_key_config.rb
ruby_easy_rsa-0.12.0.pre.3 lib/ruby_easy_rsa/commands/mixins/encrypt_key_config.rb
ruby_easy_rsa-0.12.0.pre.2 lib/ruby_easy_rsa/commands/mixins/encrypt_key_config.rb
ruby_easy_rsa-0.12.0.pre.1 lib/ruby_easy_rsa/commands/mixins/encrypt_key_config.rb
ruby_easy_rsa-0.11.0 lib/ruby_easy_rsa/commands/mixins/encrypt_key_config.rb
ruby_easy_rsa-0.10.0.pre.10 lib/ruby_easy_rsa/commands/mixins/encrypt_key_config.rb
ruby_easy_rsa-0.10.0.pre.9 lib/ruby_easy_rsa/commands/mixins/encrypt_key_config.rb
ruby_easy_rsa-0.10.0.pre.8 lib/ruby_easy_rsa/commands/mixins/encrypt_key_config.rb