Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactoring #12

Open
ches opened this issue Nov 27, 2012 · 0 comments
Open

Refactoring #12

ches opened this issue Nov 27, 2012 · 0 comments
Labels
Milestone

Comments

@ches
Copy link
Collaborator

ches commented Nov 27, 2012

There's a lot that I'd like to do for a 2.0 of this gem dealing with making it more focused on domain models in an object-oriented way, instead of just a glorified JSON-to-Hashie::Mash deserializer (like the similar direction that the Twitter gem that was our genesis has taken). So I'm just creating this issue to acknowledge that some thought has been given to it.

Leading up to a major rewrite though, there's plenty of internal ugly hackery that could stand a good hosing-off too. Someone asked me questions about the code recently and I was appalled by some things I never paid much attention to 😉 (legacy code we inherited from the old, misguided Twitter gem I think). The worst offense I noticed was that the top-level module extends itself with the Configuration module, and then proceeds to define a liberal method_missing. The result is that Configuration attribute accessors like connection_options are in scope throughout most of the library. Gross, and probably a thread safety nightmare as this is singleton state.

Consider using HTTPI, Faraday's future is in question and we've had dependency hell from it in the past—it bugs me how many libraries in the Ruby ecosystem chain applications to dependence on a range of different HTTP clients outside the standard lib (ahem, oauth2).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant