huboard / ghee

This is an unofficial ruby client for the Github API. The end goal is a complete, simple, and intuitive ruby API for all things Github.
http://documentup.com/huboard/ghee
MIT License
161 stars 51 forks source link

JSON for Faraday moved to faraday_middleware #12

Closed willrax closed 12 years ago

willrax commented 12 years ago

I was having issues getting Ghee to authenticate with this error:

>> require 'ghee'
Faraday: you may want to install system_timer for reliable timeouts
=> true
>> user_name, password, scopes = "willrax", "secret", ["user","repos"]
=> ["willrax", "secret", ["user", "repos"]]
>> token = Ghee.create_token(user_name, password, scopes)
NameError: uninitialized constant Faraday::Request::JSON

I traced this back to connection.rb which i then traced to faraday which then went to faraday_middleware. It seems that this:

Faraday::Request::JSON

was stripped from faraday and placed in to faraday_middleware.

technoweenie/faraday@db554b29260ff469e40e530af498b38433ede8ab

This small change seems to fix it. I was getting some errors complaining that the json gem wasn't loaded but haven't been able to recreate. This would most likely be an issue with faraday_middleware anyway.

rauhryan commented 12 years ago

Awesome!

What version of ruby are you running? Did you check if this works in 1.8?

willrax commented 12 years ago

Im running 1.8.7 here. Haven't tried on 1.9.

rauhryan commented 12 years ago

Great! I will run all my spec and publish a new gem

willrax commented 12 years ago

Sounds good. Let me know if you need anything else.