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

Bug while fetching repositories using Issue.find_all(user, repo) #11

Closed fcoury closed 15 years ago

fcoury commented 15 years ago

require File.join(File.dirname(FILE), '..', 'lib', 'octopi')

include Octopi

user = user.find("bcalloway")

It seems that when issue is called using your find method, there is the following error: ./lib/../lib/octopi.rb:139:in find_plural': undefined methodeach' for nil:NilClass (NoMethodError)

from ./lib/../lib/octopi.rb:133:in `find_all'
from ./lib/../lib/octopi.rb:237:in `find_all'
from lib/myissues.rb:17

This is the code that produces the error:

require File.join(File.dirname(FILE), '..', 'lib', 'octopi')
include Octopi

user = User.find("bcalloway")
puts user.name

repo = user.repository("myproject")
puts repo.description

issue = Issue.find_all(user.login, repo.name)
puts "First open issue: #{issue.number} - #{issue.title} - Created at: #{issue.created_at}"
fcoury commented 15 years ago

Added alternate syntax for fetching Issues and Commits: find_all(user, repo), with no hashes. Closed by 113ceee07f8d94fe6c82c5ad147084420f879615.