octokit 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.document +4 -0
- data/.gitignore +24 -0
- data/Gemfile +3 -0
- data/LICENSE +20 -0
- data/README.markdown +69 -0
- data/Rakefile +14 -0
- data/changelog.markdown +34 -0
- data/lib/faraday/raise_error.rb +41 -0
- data/lib/octokit.rb +49 -0
- data/lib/octokit/client.rb +30 -0
- data/lib/octokit/client/authentication.rb +19 -0
- data/lib/octokit/client/commits.rb +16 -0
- data/lib/octokit/client/connection.rb +32 -0
- data/lib/octokit/client/issues.rb +60 -0
- data/lib/octokit/client/network.rb +15 -0
- data/lib/octokit/client/objects.rb +33 -0
- data/lib/octokit/client/organizations.rb +89 -0
- data/lib/octokit/client/pulls.rb +19 -0
- data/lib/octokit/client/repositories.rb +130 -0
- data/lib/octokit/client/request.rb +41 -0
- data/lib/octokit/client/timelines.rb +20 -0
- data/lib/octokit/client/users.rb +77 -0
- data/lib/octokit/configuration.rb +45 -0
- data/lib/octokit/event.rb +76 -0
- data/lib/octokit/repository.rb +39 -0
- data/lib/octokit/version.rb +3 -0
- data/octokit.gemspec +33 -0
- data/test/fixtures/blob.json +10 -0
- data/test/fixtures/branch_commits.json +48 -0
- data/test/fixtures/branches.json +6 -0
- data/test/fixtures/close_issue.json +1 -0
- data/test/fixtures/collaborators.json +1 -0
- data/test/fixtures/comment.json +1 -0
- data/test/fixtures/commits.json +824 -0
- data/test/fixtures/contributors.json +6 -0
- data/test/fixtures/emails.json +1 -0
- data/test/fixtures/followers.json +3 -0
- data/test/fixtures/full_user.json +27 -0
- data/test/fixtures/issue.json +14 -0
- data/test/fixtures/issues.json +50 -0
- data/test/fixtures/keys.json +1 -0
- data/test/fixtures/labels.json +1 -0
- data/test/fixtures/languages.json +1 -0
- data/test/fixtures/network.json +26 -0
- data/test/fixtures/network_data.json +1 -0
- data/test/fixtures/network_meta.json +109 -0
- data/test/fixtures/open_issue.json +1 -0
- data/test/fixtures/raw_git_data.yaml +7 -0
- data/test/fixtures/reopen_issue.json +1 -0
- data/test/fixtures/repo.json +14 -0
- data/test/fixtures/repo_search.json +452 -0
- data/test/fixtures/repos.json +830 -0
- data/test/fixtures/search.json +44 -0
- data/test/fixtures/show_commit.json +37 -0
- data/test/fixtures/tags.json +8 -0
- data/test/fixtures/timeline.json +1018 -0
- data/test/fixtures/trees.json +140 -0
- data/test/fixtures/user.json +16 -0
- data/test/helper.rb +57 -0
- data/test/octokit_test.rb +765 -0
- data/test/repository_test.rb +45 -0
- metadata +377 -0
@@ -0,0 +1,45 @@
|
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + '/helper')
|
2
|
+
|
3
|
+
class RepoTest < Test::Unit::TestCase
|
4
|
+
context "when passed a string containg a forward slash" do
|
5
|
+
setup do
|
6
|
+
@repo = Octokit::Repository.new("pengwynn/linkedin")
|
7
|
+
end
|
8
|
+
|
9
|
+
should "set the username and repo name" do
|
10
|
+
@repo.name.should == "linkedin"
|
11
|
+
@repo.username.should == "pengwynn"
|
12
|
+
end
|
13
|
+
|
14
|
+
should "repond to user and repo" do
|
15
|
+
@repo.repo.should == "linkedin"
|
16
|
+
@repo.user.should == "pengwynn"
|
17
|
+
end
|
18
|
+
|
19
|
+
should "render slug as string" do
|
20
|
+
@repo.slug.should == "pengwynn/linkedin"
|
21
|
+
@repo.to_s.should == @repo.slug
|
22
|
+
end
|
23
|
+
|
24
|
+
should "render url as string" do
|
25
|
+
@repo.url.should == 'https://github.com/pengwynn/linkedin'
|
26
|
+
end
|
27
|
+
|
28
|
+
end
|
29
|
+
|
30
|
+
context "when passed a hash" do
|
31
|
+
should "should set username and repo" do
|
32
|
+
repo = Octokit::Repository.new({:username => 'pengwynn', :name => 'linkedin'})
|
33
|
+
repo.name.should == "linkedin"
|
34
|
+
repo.username.should == "pengwynn"
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
context "when passed a Repo" do
|
39
|
+
should "set username and repo" do
|
40
|
+
repo = Octokit::Repository.new(Octokit::Repository.new('pengwynn/linkedin'))
|
41
|
+
repo.name.should == "linkedin"
|
42
|
+
repo.username.should == "pengwynn"
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
metadata
ADDED
@@ -0,0 +1,377 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: octokit
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
prerelease: false
|
5
|
+
segments:
|
6
|
+
- 0
|
7
|
+
- 4
|
8
|
+
- 0
|
9
|
+
version: 0.4.0
|
10
|
+
platform: ruby
|
11
|
+
authors:
|
12
|
+
- Wynn Netherland
|
13
|
+
- Adam Stacoviak
|
14
|
+
- Erik Michaels-Ober
|
15
|
+
autorequire:
|
16
|
+
bindir: bin
|
17
|
+
cert_chain: []
|
18
|
+
|
19
|
+
date: 2011-01-06 00:00:00 -08:00
|
20
|
+
default_executable:
|
21
|
+
dependencies:
|
22
|
+
- !ruby/object:Gem::Dependency
|
23
|
+
name: fakeweb
|
24
|
+
prerelease: false
|
25
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
26
|
+
none: false
|
27
|
+
requirements:
|
28
|
+
- - ~>
|
29
|
+
- !ruby/object:Gem::Version
|
30
|
+
segments:
|
31
|
+
- 1
|
32
|
+
- 3
|
33
|
+
version: "1.3"
|
34
|
+
type: :development
|
35
|
+
version_requirements: *id001
|
36
|
+
- !ruby/object:Gem::Dependency
|
37
|
+
name: jnunemaker-matchy
|
38
|
+
prerelease: false
|
39
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
40
|
+
none: false
|
41
|
+
requirements:
|
42
|
+
- - ~>
|
43
|
+
- !ruby/object:Gem::Version
|
44
|
+
segments:
|
45
|
+
- 0
|
46
|
+
- 4
|
47
|
+
version: "0.4"
|
48
|
+
type: :development
|
49
|
+
version_requirements: *id002
|
50
|
+
- !ruby/object:Gem::Dependency
|
51
|
+
name: json
|
52
|
+
prerelease: false
|
53
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
54
|
+
none: false
|
55
|
+
requirements:
|
56
|
+
- - ~>
|
57
|
+
- !ruby/object:Gem::Version
|
58
|
+
segments:
|
59
|
+
- 1
|
60
|
+
- 4
|
61
|
+
version: "1.4"
|
62
|
+
type: :development
|
63
|
+
version_requirements: *id003
|
64
|
+
- !ruby/object:Gem::Dependency
|
65
|
+
name: mocha
|
66
|
+
prerelease: false
|
67
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
68
|
+
none: false
|
69
|
+
requirements:
|
70
|
+
- - ~>
|
71
|
+
- !ruby/object:Gem::Version
|
72
|
+
segments:
|
73
|
+
- 0
|
74
|
+
- 9
|
75
|
+
version: "0.9"
|
76
|
+
type: :development
|
77
|
+
version_requirements: *id004
|
78
|
+
- !ruby/object:Gem::Dependency
|
79
|
+
name: nokogiri
|
80
|
+
prerelease: false
|
81
|
+
requirement: &id005 !ruby/object:Gem::Requirement
|
82
|
+
none: false
|
83
|
+
requirements:
|
84
|
+
- - ~>
|
85
|
+
- !ruby/object:Gem::Version
|
86
|
+
segments:
|
87
|
+
- 1
|
88
|
+
- 4
|
89
|
+
version: "1.4"
|
90
|
+
type: :development
|
91
|
+
version_requirements: *id005
|
92
|
+
- !ruby/object:Gem::Dependency
|
93
|
+
name: rake
|
94
|
+
prerelease: false
|
95
|
+
requirement: &id006 !ruby/object:Gem::Requirement
|
96
|
+
none: false
|
97
|
+
requirements:
|
98
|
+
- - ~>
|
99
|
+
- !ruby/object:Gem::Version
|
100
|
+
segments:
|
101
|
+
- 0
|
102
|
+
- 8
|
103
|
+
version: "0.8"
|
104
|
+
type: :development
|
105
|
+
version_requirements: *id006
|
106
|
+
- !ruby/object:Gem::Dependency
|
107
|
+
name: shoulda
|
108
|
+
prerelease: false
|
109
|
+
requirement: &id007 !ruby/object:Gem::Requirement
|
110
|
+
none: false
|
111
|
+
requirements:
|
112
|
+
- - ~>
|
113
|
+
- !ruby/object:Gem::Version
|
114
|
+
segments:
|
115
|
+
- 2
|
116
|
+
- 11
|
117
|
+
version: "2.11"
|
118
|
+
type: :development
|
119
|
+
version_requirements: *id007
|
120
|
+
- !ruby/object:Gem::Dependency
|
121
|
+
name: webmock
|
122
|
+
prerelease: false
|
123
|
+
requirement: &id008 !ruby/object:Gem::Requirement
|
124
|
+
none: false
|
125
|
+
requirements:
|
126
|
+
- - ~>
|
127
|
+
- !ruby/object:Gem::Version
|
128
|
+
segments:
|
129
|
+
- 1
|
130
|
+
- 6
|
131
|
+
version: "1.6"
|
132
|
+
type: :development
|
133
|
+
version_requirements: *id008
|
134
|
+
- !ruby/object:Gem::Dependency
|
135
|
+
name: ZenTest
|
136
|
+
prerelease: false
|
137
|
+
requirement: &id009 !ruby/object:Gem::Requirement
|
138
|
+
none: false
|
139
|
+
requirements:
|
140
|
+
- - ~>
|
141
|
+
- !ruby/object:Gem::Version
|
142
|
+
segments:
|
143
|
+
- 4
|
144
|
+
- 4
|
145
|
+
version: "4.4"
|
146
|
+
type: :development
|
147
|
+
version_requirements: *id009
|
148
|
+
- !ruby/object:Gem::Dependency
|
149
|
+
name: addressable
|
150
|
+
prerelease: false
|
151
|
+
requirement: &id010 !ruby/object:Gem::Requirement
|
152
|
+
none: false
|
153
|
+
requirements:
|
154
|
+
- - ~>
|
155
|
+
- !ruby/object:Gem::Version
|
156
|
+
segments:
|
157
|
+
- 2
|
158
|
+
- 2
|
159
|
+
- 2
|
160
|
+
version: 2.2.2
|
161
|
+
type: :runtime
|
162
|
+
version_requirements: *id010
|
163
|
+
- !ruby/object:Gem::Dependency
|
164
|
+
name: hashie
|
165
|
+
prerelease: false
|
166
|
+
requirement: &id011 !ruby/object:Gem::Requirement
|
167
|
+
none: false
|
168
|
+
requirements:
|
169
|
+
- - ~>
|
170
|
+
- !ruby/object:Gem::Version
|
171
|
+
segments:
|
172
|
+
- 0
|
173
|
+
- 4
|
174
|
+
- 0
|
175
|
+
version: 0.4.0
|
176
|
+
type: :runtime
|
177
|
+
version_requirements: *id011
|
178
|
+
- !ruby/object:Gem::Dependency
|
179
|
+
name: faraday
|
180
|
+
prerelease: false
|
181
|
+
requirement: &id012 !ruby/object:Gem::Requirement
|
182
|
+
none: false
|
183
|
+
requirements:
|
184
|
+
- - ~>
|
185
|
+
- !ruby/object:Gem::Version
|
186
|
+
segments:
|
187
|
+
- 0
|
188
|
+
- 5
|
189
|
+
- 3
|
190
|
+
version: 0.5.3
|
191
|
+
type: :runtime
|
192
|
+
version_requirements: *id012
|
193
|
+
- !ruby/object:Gem::Dependency
|
194
|
+
name: faraday_middleware
|
195
|
+
prerelease: false
|
196
|
+
requirement: &id013 !ruby/object:Gem::Requirement
|
197
|
+
none: false
|
198
|
+
requirements:
|
199
|
+
- - ~>
|
200
|
+
- !ruby/object:Gem::Version
|
201
|
+
segments:
|
202
|
+
- 0
|
203
|
+
- 3
|
204
|
+
- 1
|
205
|
+
version: 0.3.1
|
206
|
+
type: :runtime
|
207
|
+
version_requirements: *id013
|
208
|
+
- !ruby/object:Gem::Dependency
|
209
|
+
name: multi_json
|
210
|
+
prerelease: false
|
211
|
+
requirement: &id014 !ruby/object:Gem::Requirement
|
212
|
+
none: false
|
213
|
+
requirements:
|
214
|
+
- - ~>
|
215
|
+
- !ruby/object:Gem::Version
|
216
|
+
segments:
|
217
|
+
- 0
|
218
|
+
- 0
|
219
|
+
- 5
|
220
|
+
version: 0.0.5
|
221
|
+
type: :runtime
|
222
|
+
version_requirements: *id014
|
223
|
+
- !ruby/object:Gem::Dependency
|
224
|
+
name: multi_xml
|
225
|
+
prerelease: false
|
226
|
+
requirement: &id015 !ruby/object:Gem::Requirement
|
227
|
+
none: false
|
228
|
+
requirements:
|
229
|
+
- - ~>
|
230
|
+
- !ruby/object:Gem::Version
|
231
|
+
segments:
|
232
|
+
- 0
|
233
|
+
- 2
|
234
|
+
- 0
|
235
|
+
version: 0.2.0
|
236
|
+
type: :runtime
|
237
|
+
version_requirements: *id015
|
238
|
+
description: Simple wrapper for the GitHub API v2
|
239
|
+
email:
|
240
|
+
- wynn.netherland@gmail.com
|
241
|
+
executables: []
|
242
|
+
|
243
|
+
extensions: []
|
244
|
+
|
245
|
+
extra_rdoc_files: []
|
246
|
+
|
247
|
+
files:
|
248
|
+
- .document
|
249
|
+
- .gitignore
|
250
|
+
- Gemfile
|
251
|
+
- LICENSE
|
252
|
+
- README.markdown
|
253
|
+
- Rakefile
|
254
|
+
- changelog.markdown
|
255
|
+
- lib/faraday/raise_error.rb
|
256
|
+
- lib/octokit.rb
|
257
|
+
- lib/octokit/client.rb
|
258
|
+
- lib/octokit/client/authentication.rb
|
259
|
+
- lib/octokit/client/commits.rb
|
260
|
+
- lib/octokit/client/connection.rb
|
261
|
+
- lib/octokit/client/issues.rb
|
262
|
+
- lib/octokit/client/network.rb
|
263
|
+
- lib/octokit/client/objects.rb
|
264
|
+
- lib/octokit/client/organizations.rb
|
265
|
+
- lib/octokit/client/pulls.rb
|
266
|
+
- lib/octokit/client/repositories.rb
|
267
|
+
- lib/octokit/client/request.rb
|
268
|
+
- lib/octokit/client/timelines.rb
|
269
|
+
- lib/octokit/client/users.rb
|
270
|
+
- lib/octokit/configuration.rb
|
271
|
+
- lib/octokit/event.rb
|
272
|
+
- lib/octokit/repository.rb
|
273
|
+
- lib/octokit/version.rb
|
274
|
+
- octokit.gemspec
|
275
|
+
- test/fixtures/blob.json
|
276
|
+
- test/fixtures/branch_commits.json
|
277
|
+
- test/fixtures/branches.json
|
278
|
+
- test/fixtures/close_issue.json
|
279
|
+
- test/fixtures/collaborators.json
|
280
|
+
- test/fixtures/comment.json
|
281
|
+
- test/fixtures/commits.json
|
282
|
+
- test/fixtures/contributors.json
|
283
|
+
- test/fixtures/emails.json
|
284
|
+
- test/fixtures/followers.json
|
285
|
+
- test/fixtures/full_user.json
|
286
|
+
- test/fixtures/issue.json
|
287
|
+
- test/fixtures/issues.json
|
288
|
+
- test/fixtures/keys.json
|
289
|
+
- test/fixtures/labels.json
|
290
|
+
- test/fixtures/languages.json
|
291
|
+
- test/fixtures/network.json
|
292
|
+
- test/fixtures/network_data.json
|
293
|
+
- test/fixtures/network_meta.json
|
294
|
+
- test/fixtures/open_issue.json
|
295
|
+
- test/fixtures/raw_git_data.yaml
|
296
|
+
- test/fixtures/reopen_issue.json
|
297
|
+
- test/fixtures/repo.json
|
298
|
+
- test/fixtures/repo_search.json
|
299
|
+
- test/fixtures/repos.json
|
300
|
+
- test/fixtures/search.json
|
301
|
+
- test/fixtures/show_commit.json
|
302
|
+
- test/fixtures/tags.json
|
303
|
+
- test/fixtures/timeline.json
|
304
|
+
- test/fixtures/trees.json
|
305
|
+
- test/fixtures/user.json
|
306
|
+
- test/helper.rb
|
307
|
+
- test/octokit_test.rb
|
308
|
+
- test/repository_test.rb
|
309
|
+
has_rdoc: true
|
310
|
+
homepage: http://wynnnetherland.com/projects/octokit/
|
311
|
+
licenses: []
|
312
|
+
|
313
|
+
post_install_message:
|
314
|
+
rdoc_options: []
|
315
|
+
|
316
|
+
require_paths:
|
317
|
+
- lib
|
318
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
319
|
+
none: false
|
320
|
+
requirements:
|
321
|
+
- - ">="
|
322
|
+
- !ruby/object:Gem::Version
|
323
|
+
segments:
|
324
|
+
- 0
|
325
|
+
version: "0"
|
326
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
327
|
+
none: false
|
328
|
+
requirements:
|
329
|
+
- - ">="
|
330
|
+
- !ruby/object:Gem::Version
|
331
|
+
segments:
|
332
|
+
- 1
|
333
|
+
- 3
|
334
|
+
- 6
|
335
|
+
version: 1.3.6
|
336
|
+
requirements: []
|
337
|
+
|
338
|
+
rubyforge_project:
|
339
|
+
rubygems_version: 1.3.7
|
340
|
+
signing_key:
|
341
|
+
specification_version: 3
|
342
|
+
summary: Wrapper for the GitHub API
|
343
|
+
test_files:
|
344
|
+
- test/fixtures/blob.json
|
345
|
+
- test/fixtures/branch_commits.json
|
346
|
+
- test/fixtures/branches.json
|
347
|
+
- test/fixtures/close_issue.json
|
348
|
+
- test/fixtures/collaborators.json
|
349
|
+
- test/fixtures/comment.json
|
350
|
+
- test/fixtures/commits.json
|
351
|
+
- test/fixtures/contributors.json
|
352
|
+
- test/fixtures/emails.json
|
353
|
+
- test/fixtures/followers.json
|
354
|
+
- test/fixtures/full_user.json
|
355
|
+
- test/fixtures/issue.json
|
356
|
+
- test/fixtures/issues.json
|
357
|
+
- test/fixtures/keys.json
|
358
|
+
- test/fixtures/labels.json
|
359
|
+
- test/fixtures/languages.json
|
360
|
+
- test/fixtures/network.json
|
361
|
+
- test/fixtures/network_data.json
|
362
|
+
- test/fixtures/network_meta.json
|
363
|
+
- test/fixtures/open_issue.json
|
364
|
+
- test/fixtures/raw_git_data.yaml
|
365
|
+
- test/fixtures/reopen_issue.json
|
366
|
+
- test/fixtures/repo.json
|
367
|
+
- test/fixtures/repo_search.json
|
368
|
+
- test/fixtures/repos.json
|
369
|
+
- test/fixtures/search.json
|
370
|
+
- test/fixtures/show_commit.json
|
371
|
+
- test/fixtures/tags.json
|
372
|
+
- test/fixtures/timeline.json
|
373
|
+
- test/fixtures/trees.json
|
374
|
+
- test/fixtures/user.json
|
375
|
+
- test/helper.rb
|
376
|
+
- test/octokit_test.rb
|
377
|
+
- test/repository_test.rb
|