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

Version Path
dc-kwalify-0.7.2 test/data/users-guide/howto-validation.rb
config_gems_initialization_aim-0.1.4 vendor/bundle/ruby/2.5.0/gems/config_gems_initialization_aim-0.1.1/vendor/bundle/ruby/2.5.0/gems/kwalify-0.7.2/test/data/users-guide/howto-validation.rb
config_gems_initialization_aim-0.1.4 vendor/bundle/ruby/2.5.0/gems/kwalify-0.7.2/test/data/users-guide/howto-validation.rb
config_gems_initialization_aim-0.1.3 vendor/bundle/ruby/2.5.0/gems/kwalify-0.7.2/test/data/users-guide/howto-validation.rb
config_gems_initialization_aim-0.1.3 vendor/bundle/ruby/2.5.0/gems/config_gems_initialization_aim-0.1.1/vendor/bundle/ruby/2.5.0/gems/kwalify-0.7.2/test/data/users-guide/howto-validation.rb
kwalify-0.7.2 test/data/users-guide/howto-validation.rb
ddao-kwalify-0.7.1 test/data/users-guide/howto-validation.rb
kwalify-0.7.1 test/data/users-guide/howto-validation.rb