Sha256: 8d913d9c43d4f3af379d5aca998225d3b75291cc94b6afd9a41a814a6fc1a860

Contents?: true

Size: 1.19 KB

Versions: 6

Compression:

Stored size: 1.19 KB

Contents

# frozen_string_literal: true

module RubyEasyRSA
  module Commands
    module Mixins
      module NetscapeExtensionsConfig
        private

        # rubocop:disable Style/RedundantAssignment
        def configure_command(initial_builder, parameters)
          builder = super
          builder = with_netscape_extensions_support(
            builder, parameters[:netscape_extensions_support]
          )
          builder = with_netscape_extensions_comment(
            builder, parameters[:netscape_extensions_comment]
          )
          builder
        end
        # rubocop:enable Style/RedundantAssignment

        def with_netscape_extensions_support(
          builder, netscape_extensions_support
        )
          return builder if netscape_extensions_support.nil?

          builder.with_option(
            '--ns-cert', netscape_extensions_support ? 'yes' : 'no'
          )
        end

        def with_netscape_extensions_comment(
          builder, netscape_extensions_comment
        )
          return builder unless netscape_extensions_comment

          builder.with_option(
            '--ns-comment', netscape_extensions_comment, quoting: '"'
          )
        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/netscape_extensions_config.rb
ruby_easy_rsa-0.14.0.pre.1 lib/ruby_easy_rsa/commands/mixins/netscape_extensions_config.rb
ruby_easy_rsa-0.13.0 lib/ruby_easy_rsa/commands/mixins/netscape_extensions_config.rb
ruby_easy_rsa-0.12.0.pre.7 lib/ruby_easy_rsa/commands/mixins/netscape_extensions_config.rb
ruby_easy_rsa-0.12.0.pre.6 lib/ruby_easy_rsa/commands/mixins/netscape_extensions_config.rb
ruby_easy_rsa-0.12.0.pre.5 lib/ruby_easy_rsa/commands/mixins/netscape_extensions_config.rb