HTTP/1.1 200 OK Server: nginx/0.6.26 Date: Sat, 01 Aug 2009 07:05:16 GMT Content-Type: application/x-yaml; charset=utf-8 Connection: keep-alive Set-Cookie: _github_ses=BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNoSGFzaHsABjoKQHVzZWR7AA%3D%3D--884981fc5aa85daf318eeff084d98e2cff92578f; path=/; expires=Wed, 01 Jan 2020 08:00:00 GMT; HttpOnly Status: 200 OK X-Runtime: 874ms ETag: "6fe879a22f5d8d301384fa7fb2cabde6" Cache-Control: private, max-age=0, must-revalidate Content-Length: 2781 --- commit: removed: [] added: [] message: |- Fix pulling issues from private repos. Signed-off-by: Felipe Coury modified: - diff: |- @@ -23,13 +23,14 @@ module Octopi # find_all(:user => "fcoury", :repo => "octopi") # state defaults to open # def self.find_all(*args) + api = (args.length == 4 ? args.pop : nil) || ANONYMOUS_API repo = args.first user, repo_name, opts = extract_user_repository(*args) state = opts[:state] || "open" state.downcase! if state validate_args(user => :user, repo_name => :repo, state => :state) - issues = super user, repo_name, state + issues = super user, repo_name, state, api issues.each { |i| i.repository = repo } if repo.is_a? Repository issues end @@ -39,7 +40,7 @@ module Octopi if args.length < 2 raise "Issue.find needs user, repository and issue number" end - + api = (args.length == 3 ? args.pop : nil) || ANONYMOUS_API number = args.pop.to_i if args.last.respond_to?(:to_i) number = args.pop if args.last.is_a?(Integer) @@ -55,7 +56,7 @@ module Octopi user, repo = extract_names(user, repo) validate_args(user => :user, repo => :repo) - super user, repo, number + super user, repo, number, api end def self.open(user, repo, params, api = ANONYMOUS_API) filename: lib/octopi/issue.rb - diff: |- @@ -79,7 +79,8 @@ module Octopi end def issues(state = "open") - Issue.find_all(self, :state => state) + api = self.api || ANONYMOUS_API + Issue.find_all(self, { :state => state }, api) end def all_issues @@ -87,7 +88,8 @@ module Octopi end def issue(number) - Issue.find(self, number) + api = self.api || ANONYMOUS_API + Issue.find(self, number, api) end def collaborators filename: lib/octopi/repository.rb parents: - id: 737650490a3cf3689f92644126407b21c4493d9a url: http://github.com/fcoury/octopi/commit/f6609209c3ac0badd004512d318bfaa508ea10ae author: name: Andrew Moreland email: andy@andymo.org id: f6609209c3ac0badd004512d318bfaa508ea10ae committed_date: "2009-07-27T18:24:59-07:00" authored_date: "2009-07-26T17:37:41-07:00" tree: a59231d4e3b99d6aaf349344ad0306b1bee7622d committer: name: Felipe Coury email: felipe.coury@gmail.com