module PanamaxTemplateValidator

Constants

VERSION

Public Class Methods

validate(file) click to toggle source
# File lib/panamax_template_validator.rb, line 11
def self.validate(file)
  template_file = TemplateFile.new(file)
  template_file.validate

  if template_file.errors.empty?
    puts 'VALID!'.green
    exit 0
  else
    exit 1
  end
end
validate_file_list(files) click to toggle source
# File lib/panamax_template_validator.rb, line 23
def self.validate_file_list(files)
  errors = []

  files.each do |file|
    template_file = TemplateFile.new(file)
    template_file.validate
    errors += template_file.errors
  end

  if errors.empty?
    puts 'THESE FILES ARE ALL VALID!'.green
    exit 0
  else
    exit 1
  end
end
validate_repo() click to toggle source
# File lib/panamax_template_validator.rb, line 40
def self.validate_repo
  Repo.new.validate
end