fcoury / octopi

A Ruby interface to GitHub API v2
http://hasmany.info/2009/4/18/ruby-interface-to-github-api
MIT License
216 stars 47 forks source link

Authenticated #user Method Returns Incomplete Data? #26

Closed runpaint closed 15 years ago

runpaint commented 15 years ago

Am I missing something, or is this a bug?

authenticated do |g|
  p g.user
end

#<Octopi::User:0xb781c880 @following_count=1, @public_repo_count=4, @followers_count=0, @location=nil, @name=nil, @company=nil, @id=70802, @keys=["company", "name", "created_at", "location", "blog", "public_repo_count", "public_gist_count", "following_count", "id", "followers_count", "login", "email"], @public_gist_count=2, @email="", @blog=nil, @login="runpaint", @created_at=Sun Apr 05 22:57:13 +0100 2009, @api=#<Octopi::Api:0xb78219e8 @read_only=false, @format="yaml", @token="REDACTED", @login="runpaint">>

Attributes such as _diskusage and the plan hash that are returned for authenticated users aren't available.

Using the curl trace mode I see the correct URL generated that, when fetched by curl, shows the correct data. This proves that my credentials are getting picked up and are right. Putting in some puts statements I see that the call to HTTParty isn't returning the complete data set. However, it doesn't seem to be a HTTParty bug because the following test script works fine:

class Foo
  require 'httparty'
  include HTTParty
  format :yaml
  def do
    p self.class.get('http://localhost/runpaint.yaml')
  end
end

(http://localhost/runpaint.yaml is the YAML downloaded with curl).

Anybody want to tell me that I'm being stupid before I look into this further?

runpaint commented 15 years ago

I think I've fixed this with commit 67320c5c3e09a23813367ff772d607d4a64642e5. This can be closed if that gets signed off.

fcoury commented 15 years ago

It's probably a bug, and if you can't take a look I probably can! Thanks.

radar commented 15 years ago

You can use Api.me.user for this.