Sha256: 55caf5d598216df4138e69a012f092800d0db0390dda0ab8fe04b9b1ac50f6b8

Contents?: true

Size: 1.54 KB

Versions: 1

Compression:

Stored size: 1.54 KB

Contents

# RocketShorts

This is an extension or set of overrides that sit on top of [RocketPants](https://github.com/filtersquad/rocket_pants). This is not an elegant extension by any means, but rather a set of modules that leverage the RocketPants load order to monkey-patch functionality.

## Why RocketShorts over RocketPants?

There are a few differentiators: (neither is the 'right way', its personal preference)

**Note** Support for points 3 and 4 are planned, but not included in the current gem.

1. Version control is done through the `Accept` HTTP Header instead of a `:version` parameter.
2. Support for a default version. Making HTTP testing possible for a single version.
3. Pagination should use the `link` HTTP Header and not the content body.
4. Clean up the payload body to avoid nesting under a `resource` key.

## Installation

Add this line to your application's Gemfile:

    gem 'rocket_shorts'

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install rocket_shorts

## Usage

Remove `rocket_pants` from your Gemfile and replace with `rocket_shorts`.

Add a `config/inititalizers/rocket_shorts.rb` and specify what header format
your API should look for.

```ruby
# config/initializers/rocket_shorts.rb
require 'rocket\_shorts'

RocketShorts.header_format = /application\/vnd\.yourcompany\.v/
```

## Contributing

1. Fork it
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Added some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rocket_shorts-0.0.1 README.md