Name: gris
Owner: Artsy
Description: Gris is a framework for building hypermedia API services using Grape, Roar and ActiveRecord
Created: 2015-02-02 18:51:18.0
Updated: 2017-11-28 03:03:04.0
Pushed: 2016-09-08 22:27:06.0
Size: 212
Language: Ruby
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
Gris is a framework for building opinionated Rack-based hypermedia APIs. Gris aims to provide useful generators, helpers and middleware common to API microservices. Note that Gris is in development and that the ground may shift.
It makes use of Grape, Roar, RSpec, Hyperclient, and Active Record with PostgreSQL among other excellent projects. Gris is derived from/inspired by the stellar and more sophisticated Napa framework by Bellycard Inc.. We stand on the shoulders of tall people.
Gris is available as a gem on rubygems, to install it run:
install gris
Otherwise, if your project uses Bundler, add gris to your Gemfile:
'gris'
And run:
ndle install
You can find example pull requests providing walkthroughs of new app set up here: https://github.com/artsy/gris-demo/pulls
Run the gris
terminal prompt to see available features:
ands:
is console [environment] # Start the Gris console
is generate api <api_name> # Generate a Grape API, Model and Representer
is generate migration <migration_name> [field[:type][:index] field[:type][:index]] # Generate a Database Migration
is help [COMMAND] # Describe available commands or one specific command
is new <app_name> [app_path] # Generates a scaffold for a new Gris service
is version # Shows the Gris version number
You can use caching by including this module in your ActiveRecord models,
class OfferEvent < ActiveRecord::Base
include Gris::Caching
end
and then cache inside GET requests like this
offer_event = OfferEvent.cached_find(id)
To expire the cache for an object, call
OfferEvent.expire_cache_for(id)
or, if you have an instance, use
offer_event.expire_cache
Gris is named for the Cubist painter Juan Gris.