github_api 0.1.0.pre
Sign up to get free protection for your applications and to get access to all the features.
- data/LICENSE.txt +20 -0
- data/README.rdoc +159 -0
- data/Rakefile +52 -0
- data/features/github.feature +9 -0
- data/features/step_definitions/github_steps.rb +0 -0
- data/features/support/env.rb +13 -0
- data/lib/github_api.rb +55 -0
- data/lib/github_api/api.rb +133 -0
- data/lib/github_api/api/extract_options.rb +17 -0
- data/lib/github_api/api/mime.rb +5 -0
- data/lib/github_api/api/utils.rb +9 -0
- data/lib/github_api/client.rb +35 -0
- data/lib/github_api/configuration.rb +84 -0
- data/lib/github_api/connection.rb +91 -0
- data/lib/github_api/error.rb +35 -0
- data/lib/github_api/gists.rb +199 -0
- data/lib/github_api/gists/comments.rb +74 -0
- data/lib/github_api/git_data.rb +26 -0
- data/lib/github_api/git_data/blobs.rb +9 -0
- data/lib/github_api/git_data/commits.rb +9 -0
- data/lib/github_api/git_data/references.rb +9 -0
- data/lib/github_api/git_data/tags.rb +9 -0
- data/lib/github_api/git_data/trees.rb +9 -0
- data/lib/github_api/issues.rb +201 -0
- data/lib/github_api/issues/comments.rb +98 -0
- data/lib/github_api/issues/events.rb +50 -0
- data/lib/github_api/issues/labels.rb +191 -0
- data/lib/github_api/issues/milestones.rb +119 -0
- data/lib/github_api/orgs.rb +90 -0
- data/lib/github_api/orgs/members.rb +109 -0
- data/lib/github_api/orgs/teams.rb +236 -0
- data/lib/github_api/pull_requests.rb +210 -0
- data/lib/github_api/pull_requests/comments.rb +134 -0
- data/lib/github_api/repos.rb +256 -0
- data/lib/github_api/repos/collaborators.rb +59 -0
- data/lib/github_api/repos/commits.rb +115 -0
- data/lib/github_api/repos/downloads.rb +77 -0
- data/lib/github_api/repos/forks.rb +29 -0
- data/lib/github_api/repos/hooks.rb +67 -0
- data/lib/github_api/repos/keys.rb +53 -0
- data/lib/github_api/repos/watching.rb +50 -0
- data/lib/github_api/request.rb +75 -0
- data/lib/github_api/request/oauth2.rb +33 -0
- data/lib/github_api/response.rb +10 -0
- data/lib/github_api/response/jsonize.rb +22 -0
- data/lib/github_api/response/mashify.rb +26 -0
- data/lib/github_api/response/raise_error.rb +33 -0
- data/lib/github_api/users.rb +82 -0
- data/lib/github_api/users/emails.rb +49 -0
- data/lib/github_api/users/followers.rb +98 -0
- data/lib/github_api/users/keys.rb +84 -0
- data/lib/github_api/version.rb +12 -0
- data/spec/fixtures/collaborators_list.json +6 -0
- data/spec/fixtures/commits_list.json +25 -0
- data/spec/fixtures/repos_branches_list.json +7 -0
- data/spec/fixtures/repos_list.json +27 -0
- data/spec/github/api_spec.rb +6 -0
- data/spec/github/client_spec.rb +6 -0
- data/spec/github/gists/comments_spec.rb +5 -0
- data/spec/github/gists_spec.rb +5 -0
- data/spec/github/git_data/blobs_spec.rb +5 -0
- data/spec/github/git_data/commits_spec.rb +5 -0
- data/spec/github/git_data/references_spec.rb +5 -0
- data/spec/github/git_data/tags_spec.rb +5 -0
- data/spec/github/git_data/trees_spec.rb +5 -0
- data/spec/github/git_data_spec.rb +5 -0
- data/spec/github/issues/comments_spec.rb +5 -0
- data/spec/github/issues/events_spec.rb +5 -0
- data/spec/github/issues/labels_spec.rb +5 -0
- data/spec/github/issues/milestones_spec.rb +5 -0
- data/spec/github/issues_spec.rb +5 -0
- data/spec/github/orgs/members_spec.rb +5 -0
- data/spec/github/orgs/teams_spec.rb +5 -0
- data/spec/github/orgs_spec.rb +5 -0
- data/spec/github/repos/collaborators_spec.rb +6 -0
- data/spec/github/repos/commits_spec.rb +5 -0
- data/spec/github/repos/downloads_spec.rb +5 -0
- data/spec/github/repos/forks_spec.rb +5 -0
- data/spec/github/repos/hooks_spec.rb +5 -0
- data/spec/github/repos/keys_spec.rb +5 -0
- data/spec/github/repos/watching_spec.rb +5 -0
- data/spec/github/repos_spec.rb +35 -0
- data/spec/github_spec.rb +5 -0
- data/spec/spec_helper.rb +15 -0
- metadata +284 -0
@@ -0,0 +1,25 @@
|
|
1
|
+
{
|
2
|
+
"sha": "7638417db6d59f3c431d3e1f261cc637155684cd",
|
3
|
+
"url": "https://api.github.com/repos/octocat/Hello-World/git/commits/7638417db6d59f3c431d3e1f261cc637155684cd",
|
4
|
+
"author": {
|
5
|
+
"date": "2010-04-10T14:10:01-07:00",
|
6
|
+
"name": "Scott Chacon",
|
7
|
+
"email": "schacon@gmail.com"
|
8
|
+
},
|
9
|
+
"committer": {
|
10
|
+
"date": "2010-04-10T14:10:01-07:00",
|
11
|
+
"name": "Scott Chacon",
|
12
|
+
"email": "schacon@gmail.com"
|
13
|
+
},
|
14
|
+
"message": "added readme, because im a good github citizen\n",
|
15
|
+
"tree": {
|
16
|
+
"url": "https://api.github.com/repos/octocat/Hello-World/git/trees/691272480426f78a0138979dd3ce63b77f706feb",
|
17
|
+
"sha": "691272480426f78a0138979dd3ce63b77f706feb"
|
18
|
+
},
|
19
|
+
"parents": [
|
20
|
+
{
|
21
|
+
"url": "https://api.github.com/repos/octocat/Hello-World/git/commits/1acc419d4d6a9ce985db7be48c6349a0475975b5",
|
22
|
+
"sha": "1acc419d4d6a9ce985db7be48c6349a0475975b5"
|
23
|
+
}
|
24
|
+
]
|
25
|
+
}
|
@@ -0,0 +1,27 @@
|
|
1
|
+
{
|
2
|
+
"url": "https://api.github.com/repos/octocat/Hello-World",
|
3
|
+
"html_url": "https://github.com/octocat/Hello-World",
|
4
|
+
"clone_url": "https://github.com/octocat/Hello-World.git",
|
5
|
+
"git_url": "git://github.com/octocat/Hello-World.git",
|
6
|
+
"ssh_url": "git@github.com:octocat/Hello-World.git",
|
7
|
+
"svn_url": "https://svn.github.com/octocat/Hello-World",
|
8
|
+
"owner": {
|
9
|
+
"login": "octocat",
|
10
|
+
"id": 1,
|
11
|
+
"avatar_url": "https://github.com/images/error/octocat_happy.gif",
|
12
|
+
"url": "https://api.github.com/users/octocat"
|
13
|
+
},
|
14
|
+
"name": "Hello-World",
|
15
|
+
"description": "This your first repo!",
|
16
|
+
"homepage": "https://github.com",
|
17
|
+
"language": null,
|
18
|
+
"private": false,
|
19
|
+
"fork": false,
|
20
|
+
"forks": 9,
|
21
|
+
"watchers": 80,
|
22
|
+
"size": 108,
|
23
|
+
"master_branch": "master",
|
24
|
+
"open_issues": 0,
|
25
|
+
"pushed_at": "2011-01-26T19:06:43Z",
|
26
|
+
"created_at": "2011-01-26T19:01:12Z"
|
27
|
+
}
|
@@ -0,0 +1,35 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Github::Repos do
|
4
|
+
|
5
|
+
let(:github) { Github.new }
|
6
|
+
let(:repo) { mock('object').as_null_object }
|
7
|
+
|
8
|
+
before do
|
9
|
+
github.stub(:repos).and_return(repo)
|
10
|
+
end
|
11
|
+
|
12
|
+
context "branches" do
|
13
|
+
|
14
|
+
before do
|
15
|
+
@branches = []
|
16
|
+
repo.stub(:branches).and_return([])
|
17
|
+
end
|
18
|
+
|
19
|
+
it "should raise error when no user" do
|
20
|
+
expect {
|
21
|
+
Github.new.repos.branches
|
22
|
+
}.to raise_error(ArgumentError, /\[user\] parameter cannot be nil/)
|
23
|
+
end
|
24
|
+
|
25
|
+
it "should raise error when no repo" do
|
26
|
+
expect {
|
27
|
+
Github.new(:user => 'peter-murach').repos.branches
|
28
|
+
}.to raise_error(ArgumentError, /\[repo\] parameter cannot be nil/)
|
29
|
+
end
|
30
|
+
|
31
|
+
it "should list all branches" do
|
32
|
+
github.repos.should_receive(:branches).and_return(@branches)
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
data/spec/github_spec.rb
ADDED
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
|
3
|
+
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
4
|
+
$LOAD_PATH.unshift(File.dirname(__FILE__))
|
5
|
+
|
6
|
+
require 'rspec'
|
7
|
+
require 'github_api'
|
8
|
+
|
9
|
+
# Requires supporting files with custom matchers and macros, etc,
|
10
|
+
# in ./support/ and its subdirectories.
|
11
|
+
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}
|
12
|
+
|
13
|
+
RSpec.configure do |config|
|
14
|
+
|
15
|
+
end
|
metadata
ADDED
@@ -0,0 +1,284 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: github_api
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
prerelease: true
|
5
|
+
segments:
|
6
|
+
- 0
|
7
|
+
- 1
|
8
|
+
- 0
|
9
|
+
- pre
|
10
|
+
version: 0.1.0.pre
|
11
|
+
platform: ruby
|
12
|
+
authors:
|
13
|
+
- Piotr Murach
|
14
|
+
autorequire:
|
15
|
+
bindir: bin
|
16
|
+
cert_chain: []
|
17
|
+
|
18
|
+
date: 2011-10-08 00:00:00 +01:00
|
19
|
+
default_executable:
|
20
|
+
dependencies:
|
21
|
+
- !ruby/object:Gem::Dependency
|
22
|
+
name: hashie
|
23
|
+
prerelease: false
|
24
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
25
|
+
requirements:
|
26
|
+
- - ~>
|
27
|
+
- !ruby/object:Gem::Version
|
28
|
+
segments:
|
29
|
+
- 1
|
30
|
+
- 1
|
31
|
+
- 0
|
32
|
+
version: 1.1.0
|
33
|
+
type: :runtime
|
34
|
+
version_requirements: *id001
|
35
|
+
- !ruby/object:Gem::Dependency
|
36
|
+
name: faraday
|
37
|
+
prerelease: false
|
38
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
39
|
+
requirements:
|
40
|
+
- - ~>
|
41
|
+
- !ruby/object:Gem::Version
|
42
|
+
segments:
|
43
|
+
- 0
|
44
|
+
- 7
|
45
|
+
- 4
|
46
|
+
version: 0.7.4
|
47
|
+
type: :runtime
|
48
|
+
version_requirements: *id002
|
49
|
+
- !ruby/object:Gem::Dependency
|
50
|
+
name: multi_json
|
51
|
+
prerelease: false
|
52
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
53
|
+
requirements:
|
54
|
+
- - ~>
|
55
|
+
- !ruby/object:Gem::Version
|
56
|
+
segments:
|
57
|
+
- 1
|
58
|
+
- 0
|
59
|
+
- 3
|
60
|
+
version: 1.0.3
|
61
|
+
type: :runtime
|
62
|
+
version_requirements: *id003
|
63
|
+
- !ruby/object:Gem::Dependency
|
64
|
+
name: oauth2
|
65
|
+
prerelease: false
|
66
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
67
|
+
requirements:
|
68
|
+
- - ~>
|
69
|
+
- !ruby/object:Gem::Version
|
70
|
+
segments:
|
71
|
+
- 0
|
72
|
+
- 5
|
73
|
+
- 0
|
74
|
+
version: 0.5.0
|
75
|
+
type: :runtime
|
76
|
+
version_requirements: *id004
|
77
|
+
- !ruby/object:Gem::Dependency
|
78
|
+
name: rspec
|
79
|
+
prerelease: false
|
80
|
+
requirement: &id005 !ruby/object:Gem::Requirement
|
81
|
+
requirements:
|
82
|
+
- - ~>
|
83
|
+
- !ruby/object:Gem::Version
|
84
|
+
segments:
|
85
|
+
- 2
|
86
|
+
- 4
|
87
|
+
- 0
|
88
|
+
version: 2.4.0
|
89
|
+
type: :development
|
90
|
+
version_requirements: *id005
|
91
|
+
- !ruby/object:Gem::Dependency
|
92
|
+
name: cucumber
|
93
|
+
prerelease: false
|
94
|
+
requirement: &id006 !ruby/object:Gem::Requirement
|
95
|
+
requirements:
|
96
|
+
- - ">="
|
97
|
+
- !ruby/object:Gem::Version
|
98
|
+
segments:
|
99
|
+
- 0
|
100
|
+
version: "0"
|
101
|
+
type: :development
|
102
|
+
version_requirements: *id006
|
103
|
+
- !ruby/object:Gem::Dependency
|
104
|
+
name: bundler
|
105
|
+
prerelease: false
|
106
|
+
requirement: &id007 !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ~>
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
segments:
|
111
|
+
- 1
|
112
|
+
- 0
|
113
|
+
- 0
|
114
|
+
version: 1.0.0
|
115
|
+
type: :development
|
116
|
+
version_requirements: *id007
|
117
|
+
- !ruby/object:Gem::Dependency
|
118
|
+
name: jeweler
|
119
|
+
prerelease: false
|
120
|
+
requirement: &id008 !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - ~>
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
segments:
|
125
|
+
- 1
|
126
|
+
- 6
|
127
|
+
- 4
|
128
|
+
version: 1.6.4
|
129
|
+
type: :development
|
130
|
+
version_requirements: *id008
|
131
|
+
- !ruby/object:Gem::Dependency
|
132
|
+
name: webmock
|
133
|
+
prerelease: false
|
134
|
+
requirement: &id009 !ruby/object:Gem::Requirement
|
135
|
+
requirements:
|
136
|
+
- - ~>
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
segments:
|
139
|
+
- 1
|
140
|
+
- 7
|
141
|
+
- 6
|
142
|
+
version: 1.7.6
|
143
|
+
type: :development
|
144
|
+
version_requirements: *id009
|
145
|
+
- !ruby/object:Gem::Dependency
|
146
|
+
name: simplecov
|
147
|
+
prerelease: false
|
148
|
+
requirement: &id010 !ruby/object:Gem::Requirement
|
149
|
+
requirements:
|
150
|
+
- - ~>
|
151
|
+
- !ruby/object:Gem::Version
|
152
|
+
segments:
|
153
|
+
- 0
|
154
|
+
- 4
|
155
|
+
version: "0.4"
|
156
|
+
type: :development
|
157
|
+
version_requirements: *id010
|
158
|
+
description: " Ruby wrapper that supports all of the GitHub API methods(nearly 200). It's build in a modular way, that is, you can either instantiate the whole api wrapper Github.new or use parts of it e.i. Github::Repos.new if working solely with repositories is your main concern. "
|
159
|
+
email: ""
|
160
|
+
executables: []
|
161
|
+
|
162
|
+
extensions: []
|
163
|
+
|
164
|
+
extra_rdoc_files: []
|
165
|
+
|
166
|
+
files:
|
167
|
+
- Rakefile
|
168
|
+
- features/github.feature
|
169
|
+
- features/step_definitions/github_steps.rb
|
170
|
+
- features/support/env.rb
|
171
|
+
- lib/github_api/api/extract_options.rb
|
172
|
+
- lib/github_api/api/mime.rb
|
173
|
+
- lib/github_api/api/utils.rb
|
174
|
+
- lib/github_api/api.rb
|
175
|
+
- lib/github_api/client.rb
|
176
|
+
- lib/github_api/configuration.rb
|
177
|
+
- lib/github_api/connection.rb
|
178
|
+
- lib/github_api/error.rb
|
179
|
+
- lib/github_api/gists/comments.rb
|
180
|
+
- lib/github_api/gists.rb
|
181
|
+
- lib/github_api/git_data/blobs.rb
|
182
|
+
- lib/github_api/git_data/commits.rb
|
183
|
+
- lib/github_api/git_data/references.rb
|
184
|
+
- lib/github_api/git_data/tags.rb
|
185
|
+
- lib/github_api/git_data/trees.rb
|
186
|
+
- lib/github_api/git_data.rb
|
187
|
+
- lib/github_api/issues/comments.rb
|
188
|
+
- lib/github_api/issues/events.rb
|
189
|
+
- lib/github_api/issues/labels.rb
|
190
|
+
- lib/github_api/issues/milestones.rb
|
191
|
+
- lib/github_api/issues.rb
|
192
|
+
- lib/github_api/orgs/members.rb
|
193
|
+
- lib/github_api/orgs/teams.rb
|
194
|
+
- lib/github_api/orgs.rb
|
195
|
+
- lib/github_api/pull_requests/comments.rb
|
196
|
+
- lib/github_api/pull_requests.rb
|
197
|
+
- lib/github_api/repos/collaborators.rb
|
198
|
+
- lib/github_api/repos/commits.rb
|
199
|
+
- lib/github_api/repos/downloads.rb
|
200
|
+
- lib/github_api/repos/forks.rb
|
201
|
+
- lib/github_api/repos/hooks.rb
|
202
|
+
- lib/github_api/repos/keys.rb
|
203
|
+
- lib/github_api/repos/watching.rb
|
204
|
+
- lib/github_api/repos.rb
|
205
|
+
- lib/github_api/request/oauth2.rb
|
206
|
+
- lib/github_api/request.rb
|
207
|
+
- lib/github_api/response/jsonize.rb
|
208
|
+
- lib/github_api/response/mashify.rb
|
209
|
+
- lib/github_api/response/raise_error.rb
|
210
|
+
- lib/github_api/response.rb
|
211
|
+
- lib/github_api/users/emails.rb
|
212
|
+
- lib/github_api/users/followers.rb
|
213
|
+
- lib/github_api/users/keys.rb
|
214
|
+
- lib/github_api/users.rb
|
215
|
+
- lib/github_api/version.rb
|
216
|
+
- lib/github_api.rb
|
217
|
+
- spec/fixtures/collaborators_list.json
|
218
|
+
- spec/fixtures/commits_list.json
|
219
|
+
- spec/fixtures/repos_branches_list.json
|
220
|
+
- spec/fixtures/repos_list.json
|
221
|
+
- spec/github/api_spec.rb
|
222
|
+
- spec/github/client_spec.rb
|
223
|
+
- spec/github/gists/comments_spec.rb
|
224
|
+
- spec/github/gists_spec.rb
|
225
|
+
- spec/github/git_data/blobs_spec.rb
|
226
|
+
- spec/github/git_data/commits_spec.rb
|
227
|
+
- spec/github/git_data/references_spec.rb
|
228
|
+
- spec/github/git_data/tags_spec.rb
|
229
|
+
- spec/github/git_data/trees_spec.rb
|
230
|
+
- spec/github/git_data_spec.rb
|
231
|
+
- spec/github/issues/comments_spec.rb
|
232
|
+
- spec/github/issues/events_spec.rb
|
233
|
+
- spec/github/issues/labels_spec.rb
|
234
|
+
- spec/github/issues/milestones_spec.rb
|
235
|
+
- spec/github/issues_spec.rb
|
236
|
+
- spec/github/orgs/members_spec.rb
|
237
|
+
- spec/github/orgs/teams_spec.rb
|
238
|
+
- spec/github/orgs_spec.rb
|
239
|
+
- spec/github/repos/collaborators_spec.rb
|
240
|
+
- spec/github/repos/commits_spec.rb
|
241
|
+
- spec/github/repos/downloads_spec.rb
|
242
|
+
- spec/github/repos/forks_spec.rb
|
243
|
+
- spec/github/repos/hooks_spec.rb
|
244
|
+
- spec/github/repos/keys_spec.rb
|
245
|
+
- spec/github/repos/watching_spec.rb
|
246
|
+
- spec/github/repos_spec.rb
|
247
|
+
- spec/github_spec.rb
|
248
|
+
- spec/spec_helper.rb
|
249
|
+
- README.rdoc
|
250
|
+
- LICENSE.txt
|
251
|
+
has_rdoc: true
|
252
|
+
homepage: https://github.com/peter-murach/github
|
253
|
+
licenses: []
|
254
|
+
|
255
|
+
post_install_message:
|
256
|
+
rdoc_options: []
|
257
|
+
|
258
|
+
require_paths:
|
259
|
+
- lib
|
260
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
261
|
+
requirements:
|
262
|
+
- - ">="
|
263
|
+
- !ruby/object:Gem::Version
|
264
|
+
segments:
|
265
|
+
- 0
|
266
|
+
version: "0"
|
267
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
268
|
+
requirements:
|
269
|
+
- - ">"
|
270
|
+
- !ruby/object:Gem::Version
|
271
|
+
segments:
|
272
|
+
- 1
|
273
|
+
- 3
|
274
|
+
- 1
|
275
|
+
version: 1.3.1
|
276
|
+
requirements: []
|
277
|
+
|
278
|
+
rubyforge_project:
|
279
|
+
rubygems_version: 1.3.6
|
280
|
+
signing_key:
|
281
|
+
specification_version: 3
|
282
|
+
summary: Ruby wrapper for the GitHub API v3
|
283
|
+
test_files: []
|
284
|
+
|