Sha256: 760b3d4155053e8bb51698e092e07297db5536c124832523f8f75a50ca01ba4c

Contents?: true

Size: 994 Bytes

Versions: 1

Compression:

Stored size: 994 Bytes

Contents

# frozen_string_literal: true

module RubyGPG2
  module Commands
    module Mixins
      module GlobalConfig
        private

        def parameter_defaults(parameters)
          without_tty = parameters[:without_tty]
          quiet = parameters[:quiet] == true
          super.merge(
            without_tty: without_tty.nil? ? true : without_tty,
            quiet:
          )
        end

        # rubocop:disable Metrics/MethodLength
        def configure_command(builder, parameters)
          home_directory = parameters[:home_directory]
          without_tty = parameters[:without_tty]
          quiet = parameters[:quiet]

          b = super
          if home_directory
            b = b.with_option(
              '--homedir', home_directory, quoting: '"'
            )
          end
          b = b.with_flag('--no-tty') if without_tty
          b = b.with_flag('--quiet') if quiet
          b
        end
        # rubocop:enable Metrics/MethodLength
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ruby_gpg2-0.13.0.pre.4 lib/ruby_gpg2/commands/mixins/global_config.rb