octokit 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,7 +1,9 @@
1
+ language: ruby
1
2
  rvm:
2
3
  - 1.8.7
3
4
  - 1.9.2
4
5
  - 1.9.3
5
- - jruby
6
- - rbx
7
- - ree
6
+ - jruby-18mode
7
+ - jruby-19mode
8
+ - rbx-18mode
9
+ - rbx-19mode
@@ -1,5 +1,6 @@
1
1
  # CHANGELOG
2
2
 
3
+ * [1.0.0 - February 12, 2012](https://github.com/pengwynn/octokit/compare/v0.6.5...v1.0.0)
3
4
  * [0.6.5 - October 15, 2011](https://github.com/pengwynn/octokit/compare/v0.6.4...v0.6.5)
4
5
  * [0.6.4 - July 2, 2011](https://github.com/pengwynn/octokit/compare/v0.6.3...v0.6.4)
5
6
  * [0.6.3 - May 5, 2011](https://github.com/pengwynn/octokit/compare/v0.6.2...v0.6.3)
data/README.md CHANGED
@@ -71,11 +71,9 @@ implementations:
71
71
  * Ruby 1.9.3
72
72
  * [JRuby][]
73
73
  * [Rubinius][]
74
- * [Ruby Enterprise Edition][ree]
75
74
 
76
75
  [jruby]: http://www.jruby.org/
77
76
  [rubinius]: http://rubini.us/
78
- [ree]: http://www.rubyenterpriseedition.com/
79
77
 
80
78
  If something doesn't work on one of these interpreters, it should be considered
81
79
  a bug.
@@ -4,6 +4,7 @@ require 'octokit/repository'
4
4
  require 'octokit/request'
5
5
 
6
6
  require 'octokit/client/commits'
7
+ require 'octokit/client/downloads'
7
8
  require 'octokit/client/issues'
8
9
  require 'octokit/client/labels'
9
10
  require 'octokit/client/network'
@@ -34,6 +35,7 @@ module Octokit
34
35
  include Octokit::Request
35
36
 
36
37
  include Octokit::Client::Commits
38
+ include Octokit::Client::Downloads
37
39
  include Octokit::Client::Issues
38
40
  include Octokit::Client::Labels
39
41
  include Octokit::Client::Network
@@ -0,0 +1,29 @@
1
+ module Octokit
2
+ class Client
3
+ module Downloads
4
+
5
+ # List available downloads for a repository
6
+ #
7
+ # @param repo [String, Repository, Hash] A Github Repository
8
+ # @return [Array] A list of available downloads
9
+ # @see http://developer.github.com/v3/repos/downloads/#list-downloads-for-a-repository
10
+ # @example List all downloads for Github/Hubot
11
+ # Octokit.downloads("github/hubot")
12
+ def downloads(repo, options={})
13
+ get("repos/#{Repository.new(repo)}/downloads", options, 3)
14
+ end
15
+
16
+ # Get single download for a repository
17
+ #
18
+ # @param repo [String, Repository, Hash] A GitHub repository
19
+ # @param id [Integer] ID of the download
20
+ # @return [Download] A single download from the repository
21
+ # @see http://developer.github.com/v3/repos/downloads/#get-a-single-download
22
+ # @example Get the "Robawt" download from Github/Hubot
23
+ # Octokit.download("github/hubot")
24
+ def download(repo, id, options={})
25
+ get("repos/#{Repository.new(repo)}/downloads/#{id}", options, 3)
26
+ end
27
+ end
28
+ end
29
+ end
@@ -10,6 +10,16 @@ module Octokit
10
10
  def public_events(options={})
11
11
  get("/events", options, 3)
12
12
  end
13
+
14
+ # List all user events
15
+ #
16
+ # @return [Array] A list of all user events
17
+ # @see http://developer.github.com/v3/events
18
+ # @example List all user events
19
+ # Octokit.user_events("sferik")
20
+ def user_events(user, options={})
21
+ get("/users/#{user}/events", options, 3)
22
+ end
13
23
 
14
24
  # List events for a repository
15
25
  #
@@ -8,7 +8,7 @@ module Octokit
8
8
  :title => title,
9
9
  :body => body,
10
10
  }
11
- post("repos/#{Repository.new(repo)}/pulls", options.merge({:pull => pull}))
11
+ post("repos/#{Repository.new(repo)}/pulls", options.merge(pull))
12
12
  end
13
13
 
14
14
  def create_pull_request_for_issue(repo, base, head, issue, options={})
@@ -17,7 +17,7 @@ module Octokit
17
17
  :head => head,
18
18
  :issue => issue
19
19
  }
20
- post("repos/#{Repository.new(repo)}/pulls", options.merge({:pull => pull}))
20
+ post("repos/#{Repository.new(repo)}/pulls", options.merge(pull))
21
21
  end
22
22
 
23
23
  def pull_requests(repo, state='open', options={})
@@ -1,3 +1,3 @@
1
1
  module Octokit
2
- VERSION = "1.0.0".freeze unless defined?(Octokit::VERSION)
2
+ VERSION = "1.0.1".freeze unless defined?(Octokit::VERSION)
3
3
  end
@@ -8,12 +8,12 @@ Gem::Specification.new do |gem|
8
8
  gem.add_dependency 'hashie', '~> 1.2'
9
9
  gem.add_dependency 'multi_json', '~> 1.0'
10
10
  gem.add_development_dependency 'json'
11
+ gem.add_development_dependency 'maruku'
11
12
  gem.add_development_dependency 'rake'
12
13
  gem.add_development_dependency 'rspec', '~> 2.8'
13
14
  gem.add_development_dependency 'simplecov'
14
15
  gem.add_development_dependency 'webmock'
15
16
  gem.add_development_dependency 'yard'
16
- gem.add_development_dependency 'rdiscount'
17
17
  gem.authors = ["Wynn Netherland", "Adam Stacoviak", "Erik Michaels-Ober"]
18
18
  gem.description = %q{Simple wrapper for the GitHub API (v2 and v3)}
19
19
  gem.email = ['wynn.netherland@gmail.com', 'adam@stacoviak.com', 'sferik@gmail.com']
@@ -0,0 +1,11 @@
1
+ {
2
+ "content_type": "application/gzip",
3
+ "created_at": "2011-12-24T05:18:20Z",
4
+ "description": "Robawt",
5
+ "html_url": "https://github.com/downloads/github/hubot/hubot-2.1.0.tar.gz",
6
+ "download_count": 267,
7
+ "size": 6144,
8
+ "name": "hubot-2.1.0.tar.gz",
9
+ "id": 165347,
10
+ "url": "https://api.github.com/repos/github/hubot/downloads/165347"
11
+ }
@@ -0,0 +1,35 @@
1
+ [
2
+ {
3
+ "content_type": "application/gzip",
4
+ "created_at": "2011-12-24T05:18:20Z",
5
+ "description": "Robawt",
6
+ "size": 6144,
7
+ "html_url": "https://github.com/downloads/github/hubot/hubot-2.1.0.tar.gz",
8
+ "name": "hubot-2.1.0.tar.gz",
9
+ "download_count": 267,
10
+ "id": 165347,
11
+ "url": "https://api.github.com/repos/github/hubot/downloads/165347"
12
+ },
13
+ {
14
+ "content_type": "application/gzip",
15
+ "created_at": "2011-12-01T08:48:32Z",
16
+ "description": "Robawt",
17
+ "size": 6144,
18
+ "html_url": "https://github.com/downloads/github/hubot/hubot-2.0.5.tar.gz",
19
+ "name": "hubot-2.0.5.tar.gz",
20
+ "download_count": 3602,
21
+ "id": 155291,
22
+ "url": "https://api.github.com/repos/github/hubot/downloads/155291"
23
+ },
24
+ {
25
+ "content_type": "application/gzip",
26
+ "created_at": "2011-11-25T20:07:31Z",
27
+ "description": "Robawt",
28
+ "size": 6144,
29
+ "html_url": "https://github.com/downloads/github/hubot/hubot-2.0.4.tar.gz",
30
+ "name": "hubot-2.0.4.tar.gz",
31
+ "download_count": 383,
32
+ "id": 153174,
33
+ "url": "https://api.github.com/repos/github/hubot/downloads/153174"
34
+ }
35
+ ]
@@ -0,0 +1,102 @@
1
+
2
+ [
3
+ {
4
+ "type": "PushEvent",
5
+ "payload": {
6
+ "head": "e99fc3fedd7fa79a590911ef5c3415a6ab4d5d5f",
7
+ "size": 2,
8
+ "push_id": 65327953,
9
+ "commits": [
10
+ {
11
+ "sha": "eae82e96148fa21d7e062d89f683567f3decf07c",
12
+ "author": {
13
+ "name": "Erik Michaels-Ober",
14
+ "email": "sferik@gmail.com"
15
+ },
16
+ "url": "https://api.github.com/repos/codeforamerica/follow-all/commits/eae82e96148fa21d7e062d89f683567f3decf07c",
17
+ "distinct": true,
18
+ "message": "Update rails dependency to version 3.2.2"
19
+ },
20
+ {
21
+ "sha": "e99fc3fedd7fa79a590911ef5c3415a6ab4d5d5f",
22
+ "author": {
23
+ "name": "Erik Michaels-Ober",
24
+ "email": "sferik@gmail.com"
25
+ },
26
+ "url": "https://api.github.com/repos/codeforamerica/follow-all/commits/e99fc3fedd7fa79a590911ef5c3415a6ab4d5d5f",
27
+ "distinct": true,
28
+ "message": "Update omniauth-oauth dependency to version 1.0.1"
29
+ }
30
+ ],
31
+ "ref": "refs/heads/master"
32
+ },
33
+ "public": true,
34
+ "org": {
35
+ "gravatar_id": "ec81184c572bc827b72ebb489d49f821",
36
+ "id": 337792,
37
+ "url": "https://api.github.com/orgs/",
38
+ "login": "codeforamerica"
39
+ },
40
+ "repo": {
41
+ "id": 1255356,
42
+ "url": "https://api.github.com/repos/codeforamerica/follow-all",
43
+ "name": "codeforamerica/follow-all"
44
+ },
45
+ "actor": {
46
+ "gravatar_id": "1f74b13f1e5c6c69cb5d7fbaabb1e2cb",
47
+ "id": 10308,
48
+ "url": "https://api.github.com/users/sferik",
49
+ "login": "sferik"
50
+ },
51
+ "created_at": "2012-03-02T22:01:29Z",
52
+ "id": "1525888969"
53
+ },
54
+ {
55
+ "type": "PushEvent",
56
+ "payload": {
57
+ "head": "092cb80b33268ed6b49b45d58ef3e50d4c9eca85",
58
+ "size": 2,
59
+ "push_id": 65327945,
60
+ "commits": [
61
+ {
62
+ "sha": "f1f47383f20a05ecda1b4cb34378408c53a7fbc3",
63
+ "author": {
64
+ "name": "Erik Michaels-Ober",
65
+ "email": "sferik@gmail.com"
66
+ },
67
+ "url": "https://api.github.com/repos/sferik/sign-in-with-twitter/commits/f1f47383f20a05ecda1b4cb34378408c53a7fbc3",
68
+ "distinct": true,
69
+ "message": "Update rails dependency to version 3.2.2"
70
+ },
71
+ {
72
+ "sha": "092cb80b33268ed6b49b45d58ef3e50d4c9eca85",
73
+ "author": {
74
+ "name": "Erik Michaels-Ober",
75
+ "email": "sferik@gmail.com"
76
+ },
77
+ "url": "https://api.github.com/repos/sferik/sign-in-with-twitter/commits/092cb80b33268ed6b49b45d58ef3e50d4c9eca85",
78
+ "distinct": true,
79
+ "message": "Update omniauth-oauth dependency to version 1.0.1"
80
+ }
81
+ ],
82
+ "ref": "refs/heads/master"
83
+ },
84
+ "public": true,
85
+ "org": {
86
+ "url": "https://api.github.com/orgs/"
87
+ },
88
+ "repo": {
89
+ "id": 1716295,
90
+ "url": "https://api.github.com/repos/sferik/sign-in-with-twitter",
91
+ "name": "sferik/sign-in-with-twitter"
92
+ },
93
+ "actor": {
94
+ "gravatar_id": "1f74b13f1e5c6c69cb5d7fbaabb1e2cb",
95
+ "id": 10308,
96
+ "url": "https://api.github.com/users/sferik",
97
+ "login": "sferik"
98
+ },
99
+ "created_at": "2012-03-02T22:01:27Z",
100
+ "id": "1525888950"
101
+ }
102
+ ]
@@ -1,6 +1,8 @@
1
- require 'simplecov'
2
- SimpleCov.start do
3
- add_filter "/spec"
1
+ unless ENV['CI']
2
+ require 'simplecov'
3
+ SimpleCov.start do
4
+ add_filter "/spec"
5
+ end
4
6
  end
5
7
  require 'octokit'
6
8
  require 'rspec'
@@ -0,0 +1,33 @@
1
+ # -*- encoding: utf-8 -*-
2
+ require 'helper'
3
+
4
+ describe Octokit::Client::Downloads do
5
+
6
+ before do
7
+ @client = Octokit::Client.new(:login => 'sferik')
8
+ end
9
+
10
+ describe ".downloads" do
11
+
12
+ it "should list available downloads" do
13
+ stub_get("/repos/github/hubot/downloads").
14
+ to_return(:body => fixture("v3/downloads.json"))
15
+ downloads = @client.downloads("github/hubot")
16
+ downloads.first.description.should == "Robawt"
17
+ end
18
+
19
+ end
20
+
21
+ describe ".download" do
22
+
23
+ it "should get a single download" do
24
+ stub_get("/repos/github/hubot/downloads/165347").
25
+ to_return(:body => fixture("v3/download.json"))
26
+ download = @client.download("github/hubot", 165347)
27
+ download.id.should == 165347
28
+ download.name.should == 'hubot-2.1.0.tar.gz'
29
+ end
30
+
31
+ end
32
+
33
+ end
@@ -14,6 +14,15 @@ describe Octokit::Client::Events do
14
14
  public_events.first.id.should == '1513284759'
15
15
  end
16
16
  end
17
+
18
+ describe ".user_events" do
19
+ it "should return all user events" do
20
+ stub_get("/users/sferik/events").
21
+ to_return(:body => fixture("v3/user_events.json"))
22
+ user_events = @client.user_events('sferik')
23
+ user_events.first.id.should == '1525888969'
24
+ end
25
+ end
17
26
 
18
27
  describe ".repository_events" do
19
28
  it "should return events for a repository" do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: octokit
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -11,11 +11,11 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2012-02-13 00:00:00.000000000 Z
14
+ date: 2012-03-31 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: addressable
18
- requirement: &70290067718980 !ruby/object:Gem::Requirement
18
+ requirement: &70223355576780 !ruby/object:Gem::Requirement
19
19
  none: false
20
20
  requirements:
21
21
  - - ~>
@@ -23,10 +23,10 @@ dependencies:
23
23
  version: '2.2'
24
24
  type: :runtime
25
25
  prerelease: false
26
- version_requirements: *70290067718980
26
+ version_requirements: *70223355576780
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: faraday
29
- requirement: &70290067721200 !ruby/object:Gem::Requirement
29
+ requirement: &70223355598600 !ruby/object:Gem::Requirement
30
30
  none: false
31
31
  requirements:
32
32
  - - ~>
@@ -34,10 +34,10 @@ dependencies:
34
34
  version: '0.7'
35
35
  type: :runtime
36
36
  prerelease: false
37
- version_requirements: *70290067721200
37
+ version_requirements: *70223355598600
38
38
  - !ruby/object:Gem::Dependency
39
39
  name: faraday_middleware
40
- requirement: &70290067730980 !ruby/object:Gem::Requirement
40
+ requirement: &70223355597960 !ruby/object:Gem::Requirement
41
41
  none: false
42
42
  requirements:
43
43
  - - ~>
@@ -45,10 +45,10 @@ dependencies:
45
45
  version: '0.8'
46
46
  type: :runtime
47
47
  prerelease: false
48
- version_requirements: *70290067730980
48
+ version_requirements: *70223355597960
49
49
  - !ruby/object:Gem::Dependency
50
50
  name: hashie
51
- requirement: &70290067778320 !ruby/object:Gem::Requirement
51
+ requirement: &70223355596920 !ruby/object:Gem::Requirement
52
52
  none: false
53
53
  requirements:
54
54
  - - ~>
@@ -56,10 +56,10 @@ dependencies:
56
56
  version: '1.2'
57
57
  type: :runtime
58
58
  prerelease: false
59
- version_requirements: *70290067778320
59
+ version_requirements: *70223355596920
60
60
  - !ruby/object:Gem::Dependency
61
61
  name: multi_json
62
- requirement: &70290067795800 !ruby/object:Gem::Requirement
62
+ requirement: &70223355596420 !ruby/object:Gem::Requirement
63
63
  none: false
64
64
  requirements:
65
65
  - - ~>
@@ -67,10 +67,10 @@ dependencies:
67
67
  version: '1.0'
68
68
  type: :runtime
69
69
  prerelease: false
70
- version_requirements: *70290067795800
70
+ version_requirements: *70223355596420
71
71
  - !ruby/object:Gem::Dependency
72
72
  name: json
73
- requirement: &70290067805640 !ruby/object:Gem::Requirement
73
+ requirement: &70223355595900 !ruby/object:Gem::Requirement
74
74
  none: false
75
75
  requirements:
76
76
  - - ! '>='
@@ -78,10 +78,21 @@ dependencies:
78
78
  version: '0'
79
79
  type: :development
80
80
  prerelease: false
81
- version_requirements: *70290067805640
81
+ version_requirements: *70223355595900
82
+ - !ruby/object:Gem::Dependency
83
+ name: maruku
84
+ requirement: &70223355595220 !ruby/object:Gem::Requirement
85
+ none: false
86
+ requirements:
87
+ - - ! '>='
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: *70223355595220
82
93
  - !ruby/object:Gem::Dependency
83
94
  name: rake
84
- requirement: &70290067814300 !ruby/object:Gem::Requirement
95
+ requirement: &70223355594780 !ruby/object:Gem::Requirement
85
96
  none: false
86
97
  requirements:
87
98
  - - ! '>='
@@ -89,10 +100,10 @@ dependencies:
89
100
  version: '0'
90
101
  type: :development
91
102
  prerelease: false
92
- version_requirements: *70290067814300
103
+ version_requirements: *70223355594780
93
104
  - !ruby/object:Gem::Dependency
94
105
  name: rspec
95
- requirement: &70290067823200 !ruby/object:Gem::Requirement
106
+ requirement: &70223355594200 !ruby/object:Gem::Requirement
96
107
  none: false
97
108
  requirements:
98
109
  - - ~>
@@ -100,10 +111,10 @@ dependencies:
100
111
  version: '2.8'
101
112
  type: :development
102
113
  prerelease: false
103
- version_requirements: *70290067823200
114
+ version_requirements: *70223355594200
104
115
  - !ruby/object:Gem::Dependency
105
116
  name: simplecov
106
- requirement: &70290067833280 !ruby/object:Gem::Requirement
117
+ requirement: &70223355593620 !ruby/object:Gem::Requirement
107
118
  none: false
108
119
  requirements:
109
120
  - - ! '>='
@@ -111,10 +122,10 @@ dependencies:
111
122
  version: '0'
112
123
  type: :development
113
124
  prerelease: false
114
- version_requirements: *70290067833280
125
+ version_requirements: *70223355593620
115
126
  - !ruby/object:Gem::Dependency
116
127
  name: webmock
117
- requirement: &70290067832080 !ruby/object:Gem::Requirement
128
+ requirement: &70223355593040 !ruby/object:Gem::Requirement
118
129
  none: false
119
130
  requirements:
120
131
  - - ! '>='
@@ -122,21 +133,10 @@ dependencies:
122
133
  version: '0'
123
134
  type: :development
124
135
  prerelease: false
125
- version_requirements: *70290067832080
136
+ version_requirements: *70223355593040
126
137
  - !ruby/object:Gem::Dependency
127
138
  name: yard
128
- requirement: &70290067831340 !ruby/object:Gem::Requirement
129
- none: false
130
- requirements:
131
- - - ! '>='
132
- - !ruby/object:Gem::Version
133
- version: '0'
134
- type: :development
135
- prerelease: false
136
- version_requirements: *70290067831340
137
- - !ruby/object:Gem::Dependency
138
- name: rdiscount
139
- requirement: &70290067830080 !ruby/object:Gem::Requirement
139
+ requirement: &70223355592460 !ruby/object:Gem::Requirement
140
140
  none: false
141
141
  requirements:
142
142
  - - ! '>='
@@ -144,7 +144,7 @@ dependencies:
144
144
  version: '0'
145
145
  type: :development
146
146
  prerelease: false
147
- version_requirements: *70290067830080
147
+ version_requirements: *70223355592460
148
148
  description: Simple wrapper for the GitHub API (v2 and v3)
149
149
  email:
150
150
  - wynn.netherland@gmail.com
@@ -169,6 +169,7 @@ files:
169
169
  - lib/octokit/authentication.rb
170
170
  - lib/octokit/client.rb
171
171
  - lib/octokit/client/commits.rb
172
+ - lib/octokit/client/downloads.rb
172
173
  - lib/octokit/client/events.rb
173
174
  - lib/octokit/client/issues.rb
174
175
  - lib/octokit/client/labels.rb
@@ -211,6 +212,8 @@ files:
211
212
  - spec/fixtures/v3/commit_comments.json
212
213
  - spec/fixtures/v3/commits.json
213
214
  - spec/fixtures/v3/contributors.json
215
+ - spec/fixtures/v3/download.json
216
+ - spec/fixtures/v3/downloads.json
214
217
  - spec/fixtures/v3/emails.json
215
218
  - spec/fixtures/v3/followers.json
216
219
  - spec/fixtures/v3/following.json
@@ -249,10 +252,12 @@ files:
249
252
  - spec/fixtures/v3/teams.json
250
253
  - spec/fixtures/v3/tree.json
251
254
  - spec/fixtures/v3/user.json
255
+ - spec/fixtures/v3/user_events.json
252
256
  - spec/fixtures/v3/watched.json
253
257
  - spec/fixtures/v3/watchers.json
254
258
  - spec/helper.rb
255
259
  - spec/octokit/client/commits_spec.rb
260
+ - spec/octokit/client/downloads_spec.rb
256
261
  - spec/octokit/client/events_spec.rb
257
262
  - spec/octokit/client/issue_events_spec.rb
258
263
  - spec/octokit/client/issues_spec.rb
@@ -317,6 +322,8 @@ test_files:
317
322
  - spec/fixtures/v3/commit_comments.json
318
323
  - spec/fixtures/v3/commits.json
319
324
  - spec/fixtures/v3/contributors.json
325
+ - spec/fixtures/v3/download.json
326
+ - spec/fixtures/v3/downloads.json
320
327
  - spec/fixtures/v3/emails.json
321
328
  - spec/fixtures/v3/followers.json
322
329
  - spec/fixtures/v3/following.json
@@ -355,10 +362,12 @@ test_files:
355
362
  - spec/fixtures/v3/teams.json
356
363
  - spec/fixtures/v3/tree.json
357
364
  - spec/fixtures/v3/user.json
365
+ - spec/fixtures/v3/user_events.json
358
366
  - spec/fixtures/v3/watched.json
359
367
  - spec/fixtures/v3/watchers.json
360
368
  - spec/helper.rb
361
369
  - spec/octokit/client/commits_spec.rb
370
+ - spec/octokit/client/downloads_spec.rb
362
371
  - spec/octokit/client/events_spec.rb
363
372
  - spec/octokit/client/issue_events_spec.rb
364
373
  - spec/octokit/client/issues_spec.rb
@@ -376,3 +385,4 @@ test_files:
376
385
  - spec/octokit/client_spec.rb
377
386
  - spec/octokit_spec.rb
378
387
  - spec/repository_spec.rb
388
+ has_rdoc: