emorikawa/linkedin-oauth2 — pull request #15 by osbornebrook (2014-10-09 08:58:27+00:00)
Title: dont conflict with twitter library

Without this patch, if I have the twitter gem loaded in my app at the same time as this one, the LinkedIn API ends up with `Twitter::REST::Response::RaiseError` in its middleware chain rather than the `Faraday::Response::RaiseError` that it's expecting. The corresponding registration in the twitter gem is in the file `lib/twitter/rest/response/raise_error.rb`

I've looked inside faraday and it seems like these registrations should be scoped to the subclasses that each library makes for itself, but that's clearly not happening here. All in all the whole thing is ungodly complicated considering it just makes HTTP requests, there's a mutex controlling access to some kind of structure containing various constants that the library has modified, (I think) and basically I'm not interested in touching any of it with a ten foot pole.

This patch doesn't break any tests so I'm leaving it here in case anyone has the same problem.