/vitruvius

Vitruvius is a library for automatically converting API schemas into compliant Sinatra apps

Primary LanguageRuby

Vitruvius

Vitruvius is a gem for generating Sinatra fakes for use in testing from a schema. It is built in a modular fashion to support multiple schema types.

Name

Vitruvius was an ancient Roman architect and engineer, famous for authoring the definitive guide to ancient architectural techniques.

Installation

Add this line to your application's Gemfile:

gem 'vitruvius', github: "JoelQ/vitruvius"

And then execute:

$ bundle

Usage

require "vitruvius"
require "vitruvius/parser/json_schema"

parser = Vitruvius::Parser::JSONSchema.new(path_to_schema)
app = Vitruvius::App.new(parser).build
# => returns a Sinatra application

Development

After checking out the repo, run bin/setup to install dependencies. Then, run rake spec to run the tests. You can also run bin/console for an interactive prompt that will allow you to experiment.

To release a new version, update the version number in version.rb, and then run bundle exec rake release, which will create a git tag for the version, push git commits and tags, and push the .gem file to rubygems.org.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/JoelQ/vitruvius.