Module: Avm::Git::Issue::Complete::Validations

Defined in:
lib/avm/git/issue/complete/validations.rb

Constant Summary collapse

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

Instance Method Summary collapse

Instance Method Details

#valid?Boolean

Returns:

  • (Boolean)


24
25
26
# File 'lib/avm/git/issue/complete/validations.rb', line 24

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

#validate_skip_validationsObject



34
35
36
37
38
39
40
# File 'lib/avm/git/issue/complete/validations.rb', line 34

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

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

#validations_bannerObject



28
29
30
31
32
# File 'lib/avm/git/issue/complete/validations.rb', line 28

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