Sha256: 14525d92db5f2ea06f09504ba60a00c3db079923a18e42790355fe24da6bf0f7
Contents?: true
Size: 492 Bytes
Versions: 8
Compression:
Stored size: 492 Bytes
Contents
require 'kwalify' #require 'yaml' ## load schema data schema = Kwalify::Yaml.load_file('schema.yaml') ## or #schema = YAML.load_file('schema.yaml') ## create validator validator = Kwalify::Validator.new(schema) ## load document document = Kwalify::Yaml.load_file('document.yaml') ## or #document = YAML.load_file('document.yaml') ## validate errors = validator.validate(document) ## show errors if errors && !errors.empty? for e in errors puts "[#{e.path}] #{e.message}" end end
Version data entries
8 entries across 6 versions & 4 rubygems