#!/usr/bin/env ruby $LOAD_PATH.unshift File.expand_path("../../lib", __FILE__) require "jdoc" require "yaml" unless path = ARGV[0] puts "usage: #{$0} " exit end case File.extname(path) when ".yml", ".yaml" schema = YAML.load_file(path) else str = File.read(path) schema = JSON.parse(str) end puts Jdoc::Generator.call(schema)