Created
June 21, 2011 18:28
-
-
Save chischaschos/1038523 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Access USER info without authenticating yourself | |
ruby-1.8.7-p334 :003 > client = Octokit::Client.new(:login => 'clutchapp') | |
=> #<Octokit::Client:0x10514a568 @endpoint="https://github.com/", @user_agent="Octokit Ruby Gem 0.6.3", @format=:json, @adapter=:net_http, @version=2, @oauth_token=nil, @token=nil, @password=nil, @login="clutchapp", @proxy=nil> | |
ruby-1.8.7-p334 :004 > client.user | |
Octokit::Unauthorized: GET https://github.com/api/v2/json/user/show: 401: <#Hashie::Mash error="not authorized"> | |
from /Users/emmanueldelgado/.rvm/gems/ruby-1.8.7-p334@clutch/gems/hybridgroup-octokit-0.6.3/lib/faraday/response/raise_error.rb:11:in `on_complete' | |
from /Users/emmanueldelgado/.rvm/gems/ruby-1.8.7-p334@clutch/gems/faraday-0.6.1/lib/faraday/response.rb:9:in `call' | |
from /Users/emmanueldelgado/.rvm/gems/ruby-1.8.7-p334@clutch/gems/faraday-0.6.1/lib/faraday/response.rb:62:in `on_complete' | |
from /Users/emmanueldelgado/.rvm/gems/ruby-1.8.7-p334@clutch/gems/faraday-0.6.1/lib/faraday/response.rb:8:in `call' | |
from /Users/emmanueldelgado/.rvm/gems/ruby-1.8.7-p334@clutch/gems/faraday-0.6.1/lib/faraday/request.rb:88:in `run' | |
from /Users/emmanueldelgado/.rvm/gems/ruby-1.8.7-p334@clutch/gems/faraday-0.6.1/lib/faraday/request.rb:28:in `run' | |
from /Users/emmanueldelgado/.rvm/gems/ruby-1.8.7-p334@clutch/gems/faraday-0.6.1/lib/faraday/connection.rb:170:in `run_request' | |
from /Users/emmanueldelgado/.rvm/gems/ruby-1.8.7-p334@clutch/gems/faraday-0.6.1/lib/faraday/connection.rb:64:in `get' | |
from /Users/emmanueldelgado/.rvm/gems/ruby-1.8.7-p334@clutch/gems/hybridgroup-octokit-0.6.3/lib/octokit/client/request.rb:23:in `send' | |
from /Users/emmanueldelgado/.rvm/gems/ruby-1.8.7-p334@clutch/gems/hybridgroup-octokit-0.6.3/lib/octokit/client/request.rb:23:in `request' | |
from /Users/emmanueldelgado/.rvm/gems/ruby-1.8.7-p334@clutch/gems/hybridgroup-octokit-0.6.3/lib/octokit/client/request.rb:5:in `get' | |
from /Users/emmanueldelgado/.rvm/gems/ruby-1.8.7-p334@clutch/gems/hybridgroup-octokit-0.6.3/lib/octokit/client/users.rb:15:in `user' | |
from (irb):4 | |
# Access USER info authentication yourself | |
uby-1.8.7-p334 :001 > client = Octokit::Client.new(:login => 'clutchapp', :token => 'the_correct_token') | |
=> #<Octokit::Client:0x1051b7190 @endpoint="https://github.com/", @user_agent="Octokit Ruby Gem 0.6.3", @format=:json, @adapter=:net_http, @version=2, @oauth_token=nil, @token="the_correct_token", @password=nil, @login="clutchapp", @proxy=nil> | |
ruby-1.8.7-p334 :002 > client.user | |
=> <#Hashie::Mash collaborators=0 created_at="2011/04/11 15:35:13 -0700" disk_usage=0 followers_count=0 following_count=0 gravatar_id="5e22173d1c82ec43d8f1b7b8ab197b67" id=723566 login="clutchapp" owned_private_repo_count=0 permission=nil plan=<#Hashie::Mash collaborators=0 name="free" private_repos=0 space=307200> private_gist_count=0 public_gist_count=0 public_repo_count=0 total_private_repo_count=0 type="User"> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment