Project

gris

0.02
No release in over 3 years
Low commit activity in last 3 years
Gris is a generator for Grape, Roar, Hypermedia, PG API apps.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

Runtime

>= 4.2.0, ~> 4.2
~> 0.10.0
~> 2.7
>= 1.2.8, ~> 1.2
>= 0.11.0
>= 0.3.0, ~> 0.3.0
~> 0.10.0
~> 2.0
~> 1.0
>= 0
~> 1.0.1
>= 0.19.1, ~> 0.19
 Project Readme

Gris

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.

Build Status

Gem Version Code Climate Dependency Status


Installation

Gris is available as a gem on rubygems, to install it run:

gem install gris

Otherwise, if your project uses Bundler, add gris to your Gemfile:

gem 'gris'

And run:

$ bundle install

Quickstart Demo(s)

You can find example pull requests providing walkthroughs of new app set up here: https://github.com/artsy/gris-demo/pulls


Usage

CLI & Generators

Run the gris terminal prompt to see available features:

Commands:
  gris console [environment]                                                            # Start the Gris console
  gris generate api <api_name>                                                          # Generate a Grape API, Model and Representer
  gris generate migration <migration_name> [field[:type][:index] field[:type][:index]]  # Generate a Database Migration
  gris help [COMMAND]                                                                   # Describe available commands or one specific command
  gris new <app_name> [app_path]                                                        # Generates a scaffold for a new Gris service
  gris version                                                                          # Shows the Gris version number

Caching

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

The name

Gris is named for the Cubist painter Juan Gris.

juan-gris-bottles-and-bowl-1911