Sha256: c6b6a7cde3ec5d8f661a4daa574521e07e0dfb8bfd9a448ad6d731a52b31c58e

Contents?: true

Size: 879 Bytes

Versions: 6

Compression:

Stored size: 879 Bytes

Contents

# frozen_string_literal: true

# takeltau info status gpg
module InfoStatusGPG
  # Backend method for info status gpg.
  # @return [Boolean] is GPG available?
  # rubocop:disable Metrics/MethodLength
  def info_status_gpg
    log.debug 'Check gpg status'

    unless _info_status_gpg_keys
      log.error 'gpg keys are not available'
      return false
    end

    unless _info_status_gpg_agent
      log.error 'gpg agent is not available'
      return false
    end

    log.debug 'gpg is available'
    true
  end
  # rubocop:enable Metrics/MethodLength

  private

  # Check gpg keys
  def _info_status_gpg_keys
    status_keys = try config.active['cmd_info_status_gpg_keys']
    status_keys.exitstatus.zero?
  end

  # Check gpg agent
  def _info_status_gpg_agent
    status_agent = try config.active['cmd_info_status_gpg_agent']
    status_agent.exitstatus.zero?
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
takeltau-0.34.15 lib/takeltau/info/status/gpg.rb
takeltau-0.34.14 lib/takeltau/info/status/gpg.rb
takeltau-0.34.13 lib/takeltau/info/status/gpg.rb
takeltau-0.34.12 lib/takeltau/info/status/gpg.rb
takeltau-0.34.11 lib/takeltau/info/status/gpg.rb
takeltau-0.34.9 lib/takeltau/info/status/gpg.rb