Sha256: 9540953b48a099736870ffc6a192f87e73d033242d7992ef295707f7e5303f13

Contents?: true

Size: 909 Bytes

Versions: 1

Compression:

Stored size: 909 Bytes

Contents

require 'panamax_template_validator/version'
require 'panamax_template_validator/repo'
require 'panamax_template_validator/template_file'
require 'panamax_template_validator/template'
require 'panamax_template_validator/image'
require 'refinements/string_colorization'

using StringColorization

module PanamaxTemplateValidator
  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

  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

  def self.validate_repo
    Repo.new.validate
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
panamax_template_validator-0.0.2 lib/panamax_template_validator.rb