discourse/discourse_api — pull request #13 by michaelherold (2013-11-08 20:12:13+00:00)
Title: Refactor to a modularized, Faraday-based API structure

This is a large pull request, so I didn't feel it would be prudent to squash it into one commit. Here's a list of all the changes this pull contains:

* Refactors the client to use Faraday, much like John's `Api` class did, but pushing the functionality into the Client.
* Restructures the Client to have explicit `get`, `post`, `put`, and `delete` methods on the Faraday stack.
* Extracts all API methods into modules in the `api/` directory, for better organization.
* Converts the testing apparatus to RSpec. I made this decision for two reasons: (1) it looks like the Discourse testing stack uses RSpec and I wanted testing parity between the two, and (2) WebMock plays much nicer with RSpec than it does MiniTest.
* Adds support for a lot more API methods. We're up to: `latest_topics`, `hot_topics`, `new_topics`, `topics_by(username)`, `topic(id)`, `search(query)`, and `categories`.
* Adds SimpleCov for code coverage upon running `rake spec` or `rspec`.

@SamSaffron, if you need me to break these changes into smaller pieces, let me know.