There are many different Ruby libraries that allow you to interact with an API:
- Net/Http: The HTTP client built into Ruby standard library.
- Httparty: Built on top of Net/Http by John Nunemaker, you can GET the HTTP Response HTTP Code, Response Message, and the HTTP Headers with one call. The Google Group was last active in 2017.
- Faraday: Also allows you to get the status, headers, and body, allowing you a bit more to customize the HTTP request.
- Rest-Client: a "simple HTTP and REST client for Ruby, inspired by the Sinatra’s microframework style of specifying actions: get, put, post, delete".
For this sample project, where we are simply getting data from the MBTA API, we will use:
- Net/HTTP to get data from the API
- The JSON library to parse the data
- The test/unit library to assert that the expected values and the actual values match up
- ThoughtWorks Gauge as the test framework.