hayesdavis / grackle

Lightweight Ruby library for the Twitter API that goes with the flow.
228 stars 36 forks source link

Make json gem optional #13

Closed tilsammans closed 12 years ago

tilsammans commented 13 years ago

On my production environment I cannot compile gems. This makes the json gem requirement problematic, especially since I can use the xml format just fine.

After stripping out the json dependency, Grackle works fine with xml format. i.e. the json dependency would better be optional.

hayesdavis commented 13 years ago

I appreciate the situation you're in but I don't see the JSON gem becoming an optional component. JSON is grackle's default format and Twitter has indicated that supporting XML has become a very large burden for them. I don't know that they'll deprecate XML any time soon but I think JSON is the way of the future for them.

That said, I could try to make grackle smarter by attempting to detect whatever JSON serializer/deserializer is available in the system and use that (JSON pure, for example, would eliminate the need for compilation, I believe). I could also detect if no JSON implementation is available and set the default to XML.

tilsammans commented 13 years ago

Fallback to a pure json gem would be a perfect solution indeed! That would work nicely for me as well. It would be slower, but speed is not really important for me since I am posting asynchronously.