tools: remove JSON schema validation tool

I'm now using the json_schema gem which already includes such a tool.
This commit is contained in:
Moritz Bunkus 2015-11-28 13:35:00 +01:00
parent 2c11d3f3bd
commit c6e3ea35ea

View File

@ -1,17 +0,0 @@
#!/usr/bin/env ruby
require 'json'
require 'jschema'
fail "Required parameters: <schema> <file to validate>" if ARGV.count != 2
content = JSON.parse File.read(ARGV[1])
schema_data = JSON.parse File.read(ARGV[0])
schema = JSchema.build(schema_data)
errors = schema.validate content
exit 0 if errors.empty?
puts errors.join("\n")
exit 1