Skip to content

Commit

Permalink
README - Top section improved with links
Browse files Browse the repository at this point in the history
- License file updated accordingly.
  • Loading branch information
juanroldan1989 committed Oct 3, 2024
1 parent f5a6aa8 commit 3e0ae20
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 26 deletions.
2 changes: 1 addition & 1 deletion LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2023 Juan Roldan
Copyright (c) 2024 Juan Roldan

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
Expand Down
64 changes: 39 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,41 +2,49 @@

# ShakenNotStirred

Ruby client for [Cocktails API](https://cocktailsapi.xyz)

<!-- ![https://github.com/juanroldan1989/shaken_not_stirred/pulls](https://img.shields.io/github/issues-pr-raw/juanroldan1989/shaken_not_stirred.svg?style=flat-square&logo=github&logoColor=white) -->

![https://github.com/juanroldan1989/shaken_not_stirred/commits/main](https://img.shields.io/github/last-commit/juanroldan1989/shaken_not_stirred.svg?style=flat-square&logo=github&logoColor=white)
![https://github.com/juanroldan1989/shaken_not_stirred/issues](https://img.shields.io/github/issues-raw/juanroldan1989/shaken_not_stirred.svg?style=flat-square&logo=github&logoColor=white)
[![Gem Version](https://badge.fury.io/rb/shaken_not_stirred.svg)](https://badge.fury.io/rb/shaken_not_stirred)
[![Code Climate](https://codeclimate.com/github/juanroldan1989/shaken_not_stirred/badges/gpa.svg)](https://codeclimate.com/github/juanroldan1989/shaken_not_stirred)
[![Downloads](http://ruby-gem-downloads-badge.herokuapp.com/shaken_not_stirred/0.0.7?type=total&color=brightgreen)](https://rubygems.org/gems/shaken_not_stirred)
![Downloads](https://img.shields.io/gem/dv/shaken_not_stirred/0.0.7)
[![License](https://img.shields.io/badge/license-MIT-brightgreen.svg)](http://opensource.org/licenses/MIT)

<!-- [![Build Status](https://travis-ci.com/juanroldan1989/shaken_not_stirred.svg?branch=master)](https://travis-ci.com/juanroldan1989/shaken_not_stirred) -->
<!-- [![Coverage Status](https://coveralls.io/repos/github/juanroldan1989/shaken_not_stirred/badge.svg?branch=master)](https://coveralls.io/github/juanroldan1989/shaken_not_stirred?branch=master) -->

Ruby client for [Cocktails API](https://cocktailsapi.xyz)

<!-- API Docs [here](https://juanroldan.com.ar/cocktails-api-docs) -->
<p align="left">
<a href="#features">Features</a> •
<a href="#setup">Setup</a> •
<a href="#usage">Usage</a> •
<a href="#implementation">Implementation</a> •
<a href="#response">Response</a> •
<a href="#contribute">Contribute</a>
</p>

## Features
# Features

- Providing developers with THE best dataset of cocktails & drinks from all over the world.
- Search through well known cocktails by `name`, `description`, `ingredients`, `categories`, `timing`, `rating` and more.
- Intuitive API interface navigation.
- URL generation process fully tested when applying filters for each request.
- API integration tests recorded and fully tested using [VCR](https://github.com/vcr/vcr) gem: fast tests (first HTTP request is real and it's response is stored for future runs), deterministic (tests will continue to pass, even if you are offline, or API goes down for maintenance) and accurate (responses will contain the same headers and body you get from a real request).

## Installation
# Setup

Install the gem by running:

```ruby
gem install shaken_not_stirred
```

or put it in your Gemfile and run `bundle install`:
or add it to your Gemfile and run `bundle install`:

```ruby
gem "shaken_not_stirred", "~> 0.0.7"
```

## 1. Usage
# Usage

All `Free`, `Basic`, `Advanced` and `Premium` plans available [here](https://cocktailsapi.xyz)

Expand All @@ -60,7 +68,7 @@ filter = ShakenNotStirred.new

then call API methods, for instance:

### `Cocktails` endpoint (Library vs. REST)
## `Cocktails` endpoint (Library vs. REST)

To fetch cocktails with `ginger` on its name:

Expand Down Expand Up @@ -185,7 +193,7 @@ $ curl "http://api-cocktails.herokuapp.com/api/v1/cocktails?random=2" -H "Author
$ curl "http://api-cocktails.herokuapp.com/api/v1/cocktails?random=n" -H "Authorization: Token token=your_api_key"
```

#### All filters are chainable
### All filters are chainable

To fetch cocktails that:

Expand All @@ -209,7 +217,7 @@ filter.results
$ curl "http://api-cocktails.herokuapp.com/api/v1/cocktails?categories[]=classic&iba=true&ingredients[]=rum" -H "Authorization: Token token=your_api_key"
```

### `Categories` endpoint
## `Categories` endpoint

Cocktails API also provides an endpoint with all `categories` available to search by.

Expand All @@ -225,7 +233,7 @@ filter.results
$ curl "http://api-cocktails.herokuapp.com/api/v1/categories" -H "Authorization: Token token=your_api_key"
```

### `Ingredients` endpoint
## `Ingredients` endpoint

Cocktails API also provides an endpoint with all `ingredients` available to search by.

Expand All @@ -241,13 +249,13 @@ filter.results
$ curl "http://api-cocktails.herokuapp.com/api/v1/ingredients" -H "Authorization: Token token=your_api_key"
```

### Pagination
## Pagination

Results returned per page: 20.

Pagination behavior is present in all 3 endpoints

#### Cocktails
### Cocktails

```ruby
filter = ShakenNotStirred.new
Expand All @@ -262,7 +270,7 @@ filter.results
$ curl "http://api-cocktails.herokuapp.com/api/v1/cocktails?page=2" -H "Authorization: Token token=your_api_key"
```

#### Categories
### Categories

```ruby
filter = ShakenNotStirred.new
Expand All @@ -277,7 +285,7 @@ filter.results
$ curl "http://api-cocktails.herokuapp.com/api/v1/categories?page=4" -H "Authorization: Token token=your_api_key"
```

#### Ingredients
### Ingredients

```ruby
filter = ShakenNotStirred.new
Expand All @@ -292,7 +300,7 @@ filter.results
$ curl "http://api-cocktails.herokuapp.com/api/v1/ingredients?page=5" -H "Authorization: Token token=your_api_key"
```

## 2. Implementation
# Implementation

Setting up this gem to work is really easy. Even more if you use `has_scope` gem:

Expand Down Expand Up @@ -325,7 +333,7 @@ class CocktailsController < ApplicationController
end
```

## 3. Response
# Response

The response format is JSON by default. Results are provided as an array of objects with the following structure:

Expand Down Expand Up @@ -375,10 +383,16 @@ filter.results
]
```

## 4. Development
# Contribute

Got **something interesting** you'd like to **add or change**? Please feel free to [Open a Pull Request](https://github.com/juanroldan1989/shaken_not_stirred/pulls)

If you want to say **thank you** and/or support the active development of `Shaken Not Stirred`:

Questions or problems? Please post them on the [issue tracker](https://github.com/juanroldan1989/shaken_not_stirred/issues). You can contribute changes by forking the project and submitting a pull request. You can ensure the tests are passing by running `bundle` and `rake`.
1. Add a [GitHub Star](https://github.com/juanroldan1989/shaken_not_stirred/stargazers) to the project.
2. Tweet about the project [on your Twitter](https://twitter.com/intent/tweet?text=Hey%20I've%20just%20discovered%20this%20cool%20app%20on%20Github%20by%20@JhonnyDaNiro%20-%20Deploy%20ECS%20Blueprint&url=https://github.com/juanroldan1989/shaken_not_stirred/&via=Github).
3. Write a review or tutorial on [Medium](https://medium.com), [Dev.to](https://dev.to) or personal blog.

## 5. Copyright
# Copyright

Copyright © 2023 Juan Roldan. See [LICENSE.txt](https://github.com/juanroldan1989/shaken_not_stirred/blob/master/LICENSE.txt) for further details.
Copyright © 2024 Juan Roldan. See [LICENSE.txt](https://github.com/juanroldan1989/shaken_not_stirred/blob/master/LICENSE.txt) for further details.

0 comments on commit 3e0ae20

Please sign in to comment.