octopussy 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
data/lib/octopussy.rb CHANGED
@@ -43,7 +43,7 @@ module Octopussy
43
43
  def_delegators :client, :search_issues, :issues, :issue
44
44
 
45
45
  # Repos
46
- def_delegators :client, :branches, :collaborators, :languages, :list_repos,
46
+ def_delegators :client, :branches, :collaborators, :contributors, :languages, :list_repos,
47
47
  :network, :repo, :search_repos, :tags
48
48
 
49
49
  # Network Meta
@@ -239,6 +239,12 @@ module Octopussy
239
239
  Hashie::Mash.new(response).collaborators
240
240
  end
241
241
 
242
+ def contributors(repo)
243
+ repo = Repo.new(repo)
244
+ response = self.class.get("/repos/show/#{repo.username}/#{repo.name}/contributors")
245
+ Hashie::Mash.new(response).contributors
246
+ end
247
+
242
248
  def repo(repo)
243
249
  repo = Repo.new(repo)
244
250
  response = self.class.get("/repos/show/#{repo.username}/#{repo.name}")
@@ -282,7 +288,7 @@ module Octopussy
282
288
 
283
289
  def branches(repo)
284
290
  repo = Repo.new(repo)
285
- response = self.class.get("/repos/show/#{repo.username}/#{repo.name}/branches")
291
+ response = self.class.get("/repos/show/#{repo.username}/#{repo.name}/branches", :query => auth_params)
286
292
  Hashie::Mash.new(response).branches
287
293
  end
288
294
 
data/octopussy.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{octopussy}
8
- s.version = "0.2.0"
8
+ s.version = "0.2.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Wynn Netherland", "Adam Stacoviak"]
12
- s.date = %q{2010-04-30}
12
+ s.date = %q{2010-05-04}
13
13
  s.description = %q{Simple wrapper for the GitHub API v2}
14
14
  s.email = %q{wynn.netherland@gmail.com}
15
15
  s.extra_rdoc_files = [
@@ -34,6 +34,7 @@ Gem::Specification.new do |s|
34
34
  "test/fixtures/close_issue.json",
35
35
  "test/fixtures/collaborators.json",
36
36
  "test/fixtures/comment.json",
37
+ "test/fixtures/contributors.json",
37
38
  "test/fixtures/emails.json",
38
39
  "test/fixtures/followers.json",
39
40
  "test/fixtures/full_user.json",
@@ -0,0 +1,6 @@
1
+ {
2
+ "contributors": [
3
+ ["pengwynn", 39],
4
+ ["holman", 1]
5
+ ]
6
+ }
@@ -318,6 +318,12 @@ class OctopussyTest < Test::Unit::TestCase
318
318
  repo = Octopussy.repo({:username => "pengwynn", :repo => "linkedin"})
319
319
  repo.homepage.should == "http://bit.ly/ruby-linkedin"
320
320
  end
321
+
322
+ should "return a repo's contributors list" do
323
+ stub_get("/repos/show/pengwynn/linkedin/contributors", "contributors.json")
324
+ contributors_list = Octopussy.contributors({:username => "pengwynn", :repo => "linkedin"})
325
+ assert contributors_list.include?(["holman", 1])
326
+ end
321
327
 
322
328
  should "list repos for a user" do
323
329
  stub_get("/repos/show/pengwynn", "repos.json")
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 2
8
- - 0
9
- version: 0.2.0
8
+ - 1
9
+ version: 0.2.1
10
10
  platform: ruby
11
11
  authors:
12
12
  - Wynn Netherland
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-04-30 00:00:00 -05:00
18
+ date: 2010-05-04 00:00:00 -05:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -129,6 +129,7 @@ files:
129
129
  - test/fixtures/close_issue.json
130
130
  - test/fixtures/collaborators.json
131
131
  - test/fixtures/comment.json
132
+ - test/fixtures/contributors.json
132
133
  - test/fixtures/emails.json
133
134
  - test/fixtures/followers.json
134
135
  - test/fixtures/full_user.json