An opinionated toolkit for writing excellent APIs in Ruby.
An opinionated toolkit for writing excellent APIs in Ruby.
Pliny helps Ruby developers write and maintain excellent APIs.
It bundles the best patterns, libraries and practices we've seen after writing a lot of APIs.
Install gem:
$ gem install plinyAnd initialize your new API app:
$ pliny-new myapp
$ cd myapp && bin/setupPliny bundles generators to help you get started:
…To test your application:
$ bundle exec rakeOr to run a single test suite:
$ bundle exec rspec spec/acceptance/artists_spec.rb$ bundle exec pliny-generateCommands:
pliny-generate endpoint NAME # Generates an endpoint
pliny-generate help [COMMAND] # Describe available commands or one specific command
pliny-generate mediator NAME # Generates a mediator
pliny-generate migration NAME # Generates a migration
pliny-generate model NAME # Generates a model
pliny-generate scaffold NAME # Generates a scaffold of endpoint, model, schema and serializer
pliny-generate schema NAME # Generates a schema
pliny-generate serializer NAME # Generates a serializerPliny adds common Rake tasks to help maintain your app:
rake db:create # Create the database
rake db:drop # Drop the database
rake db:migrate # Run database migrations
rake db:rollback # Rollback last database migration
rake db:schema:dump # Dump the database schema
rake db:schema:load # Load the database schema
rake db:schema:merge # Merges migrations into schema and removes them
rake db:seed # Seed the database with data
rake db:setup # Setup the database
rake schema # Rebuild schema.jsonAnd provides the following commands:
$ foreman start # Starts server
$ foreman run bin/console # IRB/Pry console
$ foreman run bin/run 'puts "hello world"' # Run automated code(hint: don't forget foreman run in development)
Use pliny-update to update the Pliny app in the current directory.
This not only bumps the version dependency, but also applies any changes that happened in the template app (for instance: new initializer, tweaks in the base endpoint, etc).
Run tests:
$ bundle install
$ createdb pliny-gem-test
$ rakeCreated by Brandur Leach and Pedro Belo.
MIT licensed.
No open issues yet, or sync has not completed.