This repo is a template for building Faraday adapters. Faraday is an HTTP client library that provides a common interface over many adapters. Every adapter is defined into it's own gem. Use this repository to create your own adapter gem.
You can start using GitHub's Use this template button.
This will create a repository based off from this template. After that is created, you can clone it locally to start working on it.
The next step is for you to find and replace all the "parametrised" names in this template and change them to make it unique.
First of all, you should decide on the name of your adapter.
The current convention (which is by no means mandatory) is to call adapter gems as faraday-<adapter_name>
.
Here are some examples:
HTTP
:faraday-http
Net::HTTP
:faraday-net_http
In this template repository, the placeholder for your chosen adapter name is MyAdapter
(my_adapter
).
So once you decide on the final name you want to use you should update all occurrences of MyAdapter
and all files with my_adapter
in their name with the new name you chose.
The bulk of the implementation is in the Faraday::Adapter::MyAdapter
class.
We've added lots of comments in there to guide you through it, but if you have any doubt/question please don't hesitate to get in touch!