Sha256: b8f40ada1f0fdab511991bed4d7b0c827abc1cd354ed5c300377156f356d71a0

Contents?: true

Size: 1.25 KB

Versions: 74

Compression:

Stored size: 1.25 KB

Contents

# frozen_string_literal: true

require 'avm/git/issue/complete/validation'
require 'avm/result'
require 'ostruct'

module Avm
  module Git
    module Issue
      class Complete
        VALIDATIONS = {
          clean_workspace: 'Clean workspace?',
          branch_name: 'Branch name',
          branch_hash: 'Branch hash',
          follow_master: 'Follow master?',
          commits: 'Commits?',
          bifurcations: 'Bifurcations?',
          dry_push: 'Dry push?',
          git_subrepos: 'Git subrepos ok?',
          test: 'Test ok?'
        }.with_indifferent_access.freeze

        def valid?
          validations.map(&:result).none?(&:error?)
        end

        def validations_banner
          validations.each do |v|
            infov "[#{v.key}] #{v.label}", v.result.label
          end
        end

        def validate_skip_validations
          skip_validations.each do |validation|
            next if VALIDATIONS.keys.include?(validation)

            raise "\"#{validation}\" is not a registered validation"
          end
        end

        private

        def validations_uncached
          VALIDATIONS.map do |key, label|
            ::Avm::Git::Issue::Complete::Validation.new(self, key, label)
          end
        end
      end
    end
  end
end

Version data entries

74 entries across 74 versions & 1 rubygems

Version Path
avm-tools-0.73.0 lib/avm/git/issue/complete/_validations.rb
avm-tools-0.72.0 lib/avm/git/issue/complete/_validations.rb
avm-tools-0.71.0 lib/avm/git/issue/complete/_validations.rb
avm-tools-0.70.2 lib/avm/git/issue/complete/_validations.rb
avm-tools-0.70.1 lib/avm/git/issue/complete/_validations.rb
avm-tools-0.70.0 lib/avm/git/issue/complete/_validations.rb
avm-tools-0.69.3 lib/avm/git/issue/complete/_validations.rb
avm-tools-0.69.2 lib/avm/git/issue/complete/_validations.rb
avm-tools-0.69.1 lib/avm/git/issue/complete/_validations.rb
avm-tools-0.69.0 lib/avm/git/issue/complete/_validations.rb
avm-tools-0.68.0 lib/avm/git/issue/complete/_validations.rb
avm-tools-0.67.0 lib/avm/git/issue/complete/_validations.rb
avm-tools-0.66.0 lib/avm/git/issue/complete/_validations.rb
avm-tools-0.65.0 lib/avm/git/issue/complete/_validations.rb
avm-tools-0.64.2 lib/avm/git/issue/complete/_validations.rb
avm-tools-0.64.1 lib/avm/git/issue/complete/_validations.rb
avm-tools-0.64.0 lib/avm/git/issue/complete/_validations.rb
avm-tools-0.63.0 lib/avm/git/issue/complete/_validations.rb
avm-tools-0.62.4 lib/avm/git/issue/complete/_validations.rb
avm-tools-0.62.3 lib/avm/git/issue/complete/_validations.rb