Sha256: d848b0f26946ba7f8f8819375a8aa32a95bc1acfacb2a82963b96c28b9540454
Contents?: true
Size: 972 Bytes
Versions: 5
Compression:
Stored size: 972 Bytes
Contents
#!/usr/bin/env ruby require 'thor' require 'colorize' require_relative '../lib/yaml-validator' class YamlValidatorApp < Thor desc "validate [ROOT_PATH]", "validates the files in the current directory" option :missing, :type => :boolean, :default => true, :aliases => '-m', :desc => 'show missing translations' option :sanitize, :type => :boolean, :default => false, :aliases => '-s', :desc => 'check for sanitized html' def validate(root_path = '.') puts "Validating #{root_path}...\n\n".colorize(:blue).underline validator = YamlValidator.new(root_path, options) errors = validator.validate() puts errors if errors.length > 0 puts "\nfound #{errors.length} error(s)".colorize(:red).underline else puts "no errors".colorize(:green).underline end end desc "version", "shows the version of Yaml Validator" def version puts YamlValidator::VERSION end default_task :validate end YamlValidatorApp.start
Version data entries
5 entries across 5 versions & 1 rubygems