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.102.1 lib/avm/git/issue/complete/_validations.rb
avm-tools-0.102.0 lib/avm/git/issue/complete/_validations.rb
avm-tools-0.101.0 lib/avm/git/issue/complete/_validations.rb
avm-tools-0.100.0 lib/avm/git/issue/complete/_validations.rb
avm-tools-0.99.1 lib/avm/git/issue/complete/_validations.rb
avm-tools-0.99.0 lib/avm/git/issue/complete/_validations.rb
avm-tools-0.98.0 lib/avm/git/issue/complete/_validations.rb
avm-tools-0.97.0 lib/avm/git/issue/complete/_validations.rb
avm-tools-0.96.0 lib/avm/git/issue/complete/_validations.rb
avm-tools-0.95.0 lib/avm/git/issue/complete/_validations.rb
avm-tools-0.94.3 lib/avm/git/issue/complete/_validations.rb
avm-tools-0.94.2 lib/avm/git/issue/complete/_validations.rb
avm-tools-0.94.1 lib/avm/git/issue/complete/_validations.rb
avm-tools-0.94.0 lib/avm/git/issue/complete/_validations.rb
avm-tools-0.93.0 lib/avm/git/issue/complete/_validations.rb
avm-tools-0.92.0 lib/avm/git/issue/complete/_validations.rb
avm-tools-0.91.0 lib/avm/git/issue/complete/_validations.rb
avm-tools-0.90.0 lib/avm/git/issue/complete/_validations.rb
avm-tools-0.89.0 lib/avm/git/issue/complete/_validations.rb
avm-tools-0.88.0 lib/avm/git/issue/complete/_validations.rb