Sha256: bf2ef7d30b97792ee6dc3e69bc8b4980f88e5186818b4d2a2552ac84f280ebcd

Contents?: true

Size: 1.05 KB

Versions: 8

Compression:

Stored size: 1.05 KB

Contents

# frozen_string_literal: true

module RubyEasyRSA
  module Commands
    module Mixins
      module AlgorithmConfig
        # rubocop:disable Style/RedundantAssignment
        def configure_command(builder, opts)
          builder = super(builder, opts)
          builder = with_ec_directory(builder, opts[:ec_directory])
          builder = with_algorithm(builder, opts[:algorithm])
          builder = with_curve(builder, opts[:curve])
          builder
        end
        # rubocop:enable Style/RedundantAssignment

        private

        def with_ec_directory(builder, ec_directory)
          return builder unless ec_directory

          builder.with_environment_variable(
            'EASYRSA_EC_DIR', ec_directory
          )
        end

        def with_algorithm(builder, algorithm)
          return builder unless algorithm

          builder.with_option('--use-algo', algorithm)
        end

        def with_curve(builder, curve)
          return builder unless curve

          builder.with_option('--curve', curve)
        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/algorithm_config.rb
ruby_easy_rsa-0.12.0.pre.3 lib/ruby_easy_rsa/commands/mixins/algorithm_config.rb
ruby_easy_rsa-0.12.0.pre.2 lib/ruby_easy_rsa/commands/mixins/algorithm_config.rb
ruby_easy_rsa-0.12.0.pre.1 lib/ruby_easy_rsa/commands/mixins/algorithm_config.rb
ruby_easy_rsa-0.11.0 lib/ruby_easy_rsa/commands/mixins/algorithm_config.rb
ruby_easy_rsa-0.10.0.pre.10 lib/ruby_easy_rsa/commands/mixins/algorithm_config.rb
ruby_easy_rsa-0.10.0.pre.9 lib/ruby_easy_rsa/commands/mixins/algorithm_config.rb
ruby_easy_rsa-0.10.0.pre.8 lib/ruby_easy_rsa/commands/mixins/algorithm_config.rb