Sha256: 6d262855ff2be258c0a57b5e0e7313ff2e57868c1bce33532c14ff9902f1191c

Contents?: true

Size: 1.13 KB

Versions: 3

Compression:

Stored size: 1.13 KB

Contents

# frozen_string_literal: true

# takelage info status git
module InfoStatusGit
  # Backend method for info status git.
  # @return [Boolean] is the git gpg signing key available?
  # rubocop:disable Metrics/MethodLength
  # rubocop:disable Metrics/AbcSize
  def info_status_git
    log.debug 'Check git status'

    root = config.active['project_root_dir']

    if root.strip.empty?
      log.error 'Cannot determine project root directory'
      log.info 'Is there a Rakefile in the project root directory?'
      return false
    end

    if _info_status_lib_git_name(root).strip.empty?
      log.error 'git config user.name is not available'
      return false
    end

    if _info_status_lib_git_email(root).strip.empty?
      log.error 'git config user.email is not available'
      return false
    end

    key = _info_status_lib_git_signingkey(root)

    unless _info_status_lib_git_key_available(key).exitstatus.zero?
      log.error 'git config user.signingkey is not available'
      return false
    end

    log.debug 'git config is available'
    true
  end
  # rubocop:enable Metrics/AbcSize
  # rubocop:enable Metrics/MethodLength
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
takelage-0.26.4 lib/takelage/info/status/git.rb
takelage-0.26.3 lib/takelage/info/status/git.rb
takelage-0.26.2 lib/takelage/info/status/git.rb