2013-11-02 13 views
6

Octokit.rbを使用してGithubアカウントの詳細を一覧表示しようとしていますが、関連するURLを見つけることができません。Octokit.rbを使用してrepos URLを出力します

最初に、OAuthを使用してGithub APIで認証し、詳細をコンソールに出力するだけです。リポジトリごとなど(APIあたりなど)、私は私が何かを明らかに見落としてきたと確信している、しかし、あなたがhtml_urlを見つけるために何をすべきかが必要です

client = Octokit::Client.new :access_token => 'my_token' 

client.repos.each do |repo| 
    puts repo.name 
    puts repo.description 
    # html_url & clone_url go here. 
end 

clone_url:ここでは基本的な例は、これまでですか?

答えて

9

は、それはすべての後に明らかだったが判明:

client = Octokit::Client.new :access_token => 'my_token' 

client.repos.each do |repo| 
    puts repo.name 
    puts repo.description 

    # find the urls 
    puts repo.rels[:html].href 
    puts repo.rels[:git].href 
    puts repo.rels[:clone].href 
    puts repo.rels[:ssh].href 
end 
+1

はどのようにあなたが最後に「.HREF」を入れて持っていることを知っているのですか? APIドキュメントにありますか? – ms2

関連する問題