xn-octokit 0.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (82) hide show
  1. data/.document +4 -0
  2. data/.gemtest +0 -0
  3. data/.gitignore +24 -0
  4. data/.rspec +3 -0
  5. data/.travis.yml +6 -0
  6. data/Gemfile +3 -0
  7. data/LICENSE +20 -0
  8. data/README.markdown +73 -0
  9. data/Rakefile +8 -0
  10. data/changelog.markdown +42 -0
  11. data/lib/faraday/response/raise_error.rb +33 -0
  12. data/lib/octokit.rb +53 -0
  13. data/lib/octokit/client.rb +40 -0
  14. data/lib/octokit/client/authentication.rb +23 -0
  15. data/lib/octokit/client/commits.rb +16 -0
  16. data/lib/octokit/client/connection.rb +34 -0
  17. data/lib/octokit/client/issues.rb +60 -0
  18. data/lib/octokit/client/network.rb +15 -0
  19. data/lib/octokit/client/objects.rb +33 -0
  20. data/lib/octokit/client/organizations.rb +90 -0
  21. data/lib/octokit/client/pulls.rb +25 -0
  22. data/lib/octokit/client/repositories.rb +138 -0
  23. data/lib/octokit/client/request.rb +41 -0
  24. data/lib/octokit/client/timelines.rb +22 -0
  25. data/lib/octokit/client/users.rb +75 -0
  26. data/lib/octokit/configuration.rb +61 -0
  27. data/lib/octokit/repository.rb +39 -0
  28. data/lib/octokit/version.rb +3 -0
  29. data/octokit.gemspec +33 -0
  30. data/spec/faraday/response_spec.rb +34 -0
  31. data/spec/fixtures/blob.json +1 -0
  32. data/spec/fixtures/blob_metadata.json +1 -0
  33. data/spec/fixtures/blobs.json +1 -0
  34. data/spec/fixtures/branches.json +1 -0
  35. data/spec/fixtures/collaborators.json +1 -0
  36. data/spec/fixtures/comment.json +1 -0
  37. data/spec/fixtures/comments.json +1 -0
  38. data/spec/fixtures/commit.json +1 -0
  39. data/spec/fixtures/commits.json +1 -0
  40. data/spec/fixtures/contributors.json +1 -0
  41. data/spec/fixtures/delete_token.json +1 -0
  42. data/spec/fixtures/emails.json +1 -0
  43. data/spec/fixtures/followers.json +1 -0
  44. data/spec/fixtures/following.json +1 -0
  45. data/spec/fixtures/issue.json +1 -0
  46. data/spec/fixtures/issues.json +1 -0
  47. data/spec/fixtures/labels.json +1 -0
  48. data/spec/fixtures/languages.json +1 -0
  49. data/spec/fixtures/network.json +1 -0
  50. data/spec/fixtures/network_data.json +1 -0
  51. data/spec/fixtures/network_meta.json +1 -0
  52. data/spec/fixtures/organization.json +1 -0
  53. data/spec/fixtures/organizations.json +1 -0
  54. data/spec/fixtures/public_keys.json +1 -0
  55. data/spec/fixtures/pull.json +1 -0
  56. data/spec/fixtures/pulls.json +1 -0
  57. data/spec/fixtures/raw.txt +7 -0
  58. data/spec/fixtures/repositories.json +1 -0
  59. data/spec/fixtures/repository.json +1 -0
  60. data/spec/fixtures/tags.json +1 -0
  61. data/spec/fixtures/team.json +1 -0
  62. data/spec/fixtures/teams.json +1 -0
  63. data/spec/fixtures/timeline.json +1237 -0
  64. data/spec/fixtures/tree.json +1 -0
  65. data/spec/fixtures/tree_metadata.json +1 -0
  66. data/spec/fixtures/user.json +1 -0
  67. data/spec/fixtures/users.json +1 -0
  68. data/spec/fixtures/watchers.json +1 -0
  69. data/spec/helper.rb +64 -0
  70. data/spec/octokit/client/commits_spec.rb +32 -0
  71. data/spec/octokit/client/issues_spec.rb +154 -0
  72. data/spec/octokit/client/network_spec.rb +32 -0
  73. data/spec/octokit/client/objects_spec.rb +81 -0
  74. data/spec/octokit/client/organizations_spec.rb +234 -0
  75. data/spec/octokit/client/pulls_spec.rb +44 -0
  76. data/spec/octokit/client/repositories_spec.rb +331 -0
  77. data/spec/octokit/client/timelines_spec.rb +42 -0
  78. data/spec/octokit/client/users_spec.rb +274 -0
  79. data/spec/octokit/client_spec.rb +12 -0
  80. data/spec/octokit_spec.rb +15 -0
  81. data/spec/repository_spec.rb +54 -0
  82. metadata +336 -0
@@ -0,0 +1,12 @@
1
+ require 'helper'
2
+
3
+ describe Octokit::Client do
4
+
5
+ it "should connect using the endpoint configuration" do
6
+ client = Octokit::Client.new
7
+ endpoint = URI.parse(client.endpoint)
8
+ connection = client.send(:connection).build_url(nil).to_s
9
+ connection.should == endpoint.to_s
10
+ end
11
+
12
+ end
@@ -0,0 +1,15 @@
1
+ # -*- encoding: utf-8 -*-
2
+ require 'helper'
3
+
4
+ describe Octokit do
5
+ after do
6
+ Octokit.reset
7
+ end
8
+
9
+ describe ".client" do
10
+ it "should be a Octokit::Client" do
11
+ Octokit.client.should be_a Octokit::Client
12
+ end
13
+ end
14
+
15
+ end
@@ -0,0 +1,54 @@
1
+ # -*- encoding: utf-8 -*-
2
+ require 'helper'
3
+
4
+ describe Octokit::Repository do
5
+ context "when passed a string containg a slash" do
6
+ before do
7
+ @repository = Octokit::Repository.new("sferik/octokit")
8
+ end
9
+
10
+ it "should set the repository name and username" do
11
+ @repository.name.should == "octokit"
12
+ @repository.username.should == "sferik"
13
+ end
14
+
15
+ it "should respond to repo and user" do
16
+ @repository.repo.should == "octokit"
17
+ @repository.user.should == "sferik"
18
+ end
19
+
20
+ it "should render slug as string" do
21
+ @repository.slug.should == "sferik/octokit"
22
+ @repository.to_s.should == @repository.slug
23
+ end
24
+
25
+ it "should render url as string" do
26
+ @repository.url.should == 'https://github.com/sferik/octokit'
27
+ end
28
+
29
+ end
30
+
31
+ context "when passed a hash" do
32
+ it "should set the repository name and username" do
33
+ repository = Octokit::Repository.new({:username => 'sferik', :name => 'octokit'})
34
+ repository.name.should == "octokit"
35
+ repository.username.should == "sferik"
36
+ end
37
+ end
38
+
39
+ context "when passed a Repo" do
40
+ it "should set the repository name and username" do
41
+ repository = Octokit::Repository.new(Octokit::Repository.new('sferik/octokit'))
42
+ repository.name.should == "octokit"
43
+ repository.username.should == "sferik"
44
+ end
45
+ end
46
+
47
+ context "when given a URL" do
48
+ it "should set the repository name and username" do
49
+ repository = Octokit::Repository.from_url("https://github.com/sferik/octokit")
50
+ repository.name.should == "octokit"
51
+ repository.username.should == "sferik"
52
+ end
53
+ end
54
+ end
metadata ADDED
@@ -0,0 +1,336 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: xn-octokit
3
+ version: !ruby/object:Gem::Version
4
+ prerelease: false
5
+ segments:
6
+ - 0
7
+ - 6
8
+ - 1
9
+ version: 0.6.1
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-04-09 00:00:00 -05:00
20
+ default_executable:
21
+ dependencies:
22
+ - !ruby/object:Gem::Dependency
23
+ name: json_pure
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
+ - 5
33
+ version: "1.5"
34
+ type: :development
35
+ version_requirements: *id001
36
+ - !ruby/object:Gem::Dependency
37
+ name: nokogiri
38
+ prerelease: false
39
+ requirement: &id002 !ruby/object:Gem::Requirement
40
+ none: false
41
+ requirements:
42
+ - - ~>
43
+ - !ruby/object:Gem::Version
44
+ segments:
45
+ - 1
46
+ - 4
47
+ version: "1.4"
48
+ type: :development
49
+ version_requirements: *id002
50
+ - !ruby/object:Gem::Dependency
51
+ name: rake
52
+ prerelease: false
53
+ requirement: &id003 !ruby/object:Gem::Requirement
54
+ none: false
55
+ requirements:
56
+ - - ~>
57
+ - !ruby/object:Gem::Version
58
+ segments:
59
+ - 0
60
+ - 8
61
+ version: "0.8"
62
+ type: :development
63
+ version_requirements: *id003
64
+ - !ruby/object:Gem::Dependency
65
+ name: rspec
66
+ prerelease: false
67
+ requirement: &id004 !ruby/object:Gem::Requirement
68
+ none: false
69
+ requirements:
70
+ - - ~>
71
+ - !ruby/object:Gem::Version
72
+ segments:
73
+ - 2
74
+ - 5
75
+ version: "2.5"
76
+ type: :development
77
+ version_requirements: *id004
78
+ - !ruby/object:Gem::Dependency
79
+ name: simplecov
80
+ prerelease: false
81
+ requirement: &id005 !ruby/object:Gem::Requirement
82
+ none: false
83
+ requirements:
84
+ - - ~>
85
+ - !ruby/object:Gem::Version
86
+ segments:
87
+ - 0
88
+ - 4
89
+ version: "0.4"
90
+ type: :development
91
+ version_requirements: *id005
92
+ - !ruby/object:Gem::Dependency
93
+ name: webmock
94
+ prerelease: false
95
+ requirement: &id006 !ruby/object:Gem::Requirement
96
+ none: false
97
+ requirements:
98
+ - - ~>
99
+ - !ruby/object:Gem::Version
100
+ segments:
101
+ - 1
102
+ - 6
103
+ version: "1.6"
104
+ type: :development
105
+ version_requirements: *id006
106
+ - !ruby/object:Gem::Dependency
107
+ name: ZenTest
108
+ prerelease: false
109
+ requirement: &id007 !ruby/object:Gem::Requirement
110
+ none: false
111
+ requirements:
112
+ - - ~>
113
+ - !ruby/object:Gem::Version
114
+ segments:
115
+ - 4
116
+ - 5
117
+ version: "4.5"
118
+ type: :development
119
+ version_requirements: *id007
120
+ - !ruby/object:Gem::Dependency
121
+ name: addressable
122
+ prerelease: false
123
+ requirement: &id008 !ruby/object:Gem::Requirement
124
+ none: false
125
+ requirements:
126
+ - - ~>
127
+ - !ruby/object:Gem::Version
128
+ segments:
129
+ - 2
130
+ - 2
131
+ - 4
132
+ version: 2.2.4
133
+ type: :runtime
134
+ version_requirements: *id008
135
+ - !ruby/object:Gem::Dependency
136
+ name: hashie
137
+ prerelease: false
138
+ requirement: &id009 !ruby/object:Gem::Requirement
139
+ none: false
140
+ requirements:
141
+ - - ~>
142
+ - !ruby/object:Gem::Version
143
+ segments:
144
+ - 1
145
+ - 0
146
+ - 0
147
+ version: 1.0.0
148
+ type: :runtime
149
+ version_requirements: *id009
150
+ - !ruby/object:Gem::Dependency
151
+ name: faraday
152
+ prerelease: false
153
+ requirement: &id010 !ruby/object:Gem::Requirement
154
+ none: false
155
+ requirements:
156
+ - - ~>
157
+ - !ruby/object:Gem::Version
158
+ segments:
159
+ - 0
160
+ - 6
161
+ - 0
162
+ version: 0.6.0
163
+ type: :runtime
164
+ version_requirements: *id010
165
+ - !ruby/object:Gem::Dependency
166
+ name: faraday_middleware
167
+ prerelease: false
168
+ requirement: &id011 !ruby/object:Gem::Requirement
169
+ none: false
170
+ requirements:
171
+ - - ~>
172
+ - !ruby/object:Gem::Version
173
+ segments:
174
+ - 0
175
+ - 6
176
+ - 0
177
+ version: 0.6.0
178
+ type: :runtime
179
+ version_requirements: *id011
180
+ - !ruby/object:Gem::Dependency
181
+ name: multi_json
182
+ prerelease: false
183
+ requirement: &id012 !ruby/object:Gem::Requirement
184
+ none: false
185
+ requirements:
186
+ - - ~>
187
+ - !ruby/object:Gem::Version
188
+ segments:
189
+ - 0
190
+ - 0
191
+ - 5
192
+ version: 0.0.5
193
+ type: :runtime
194
+ version_requirements: *id012
195
+ - !ruby/object:Gem::Dependency
196
+ name: multi_xml
197
+ prerelease: false
198
+ requirement: &id013 !ruby/object:Gem::Requirement
199
+ none: false
200
+ requirements:
201
+ - - ~>
202
+ - !ruby/object:Gem::Version
203
+ segments:
204
+ - 0
205
+ - 2
206
+ - 0
207
+ version: 0.2.0
208
+ type: :runtime
209
+ version_requirements: *id013
210
+ description: Simple wrapper for the GitHub API v2
211
+ email:
212
+ - wynn.netherland@gmail.com
213
+ executables: []
214
+
215
+ extensions: []
216
+
217
+ extra_rdoc_files: []
218
+
219
+ files:
220
+ - .document
221
+ - .gemtest
222
+ - .gitignore
223
+ - .rspec
224
+ - .travis.yml
225
+ - Gemfile
226
+ - LICENSE
227
+ - README.markdown
228
+ - Rakefile
229
+ - changelog.markdown
230
+ - lib/faraday/response/raise_error.rb
231
+ - lib/octokit.rb
232
+ - lib/octokit/client.rb
233
+ - lib/octokit/client/authentication.rb
234
+ - lib/octokit/client/commits.rb
235
+ - lib/octokit/client/connection.rb
236
+ - lib/octokit/client/issues.rb
237
+ - lib/octokit/client/network.rb
238
+ - lib/octokit/client/objects.rb
239
+ - lib/octokit/client/organizations.rb
240
+ - lib/octokit/client/pulls.rb
241
+ - lib/octokit/client/repositories.rb
242
+ - lib/octokit/client/request.rb
243
+ - lib/octokit/client/timelines.rb
244
+ - lib/octokit/client/users.rb
245
+ - lib/octokit/configuration.rb
246
+ - lib/octokit/repository.rb
247
+ - lib/octokit/version.rb
248
+ - octokit.gemspec
249
+ - spec/faraday/response_spec.rb
250
+ - spec/fixtures/blob.json
251
+ - spec/fixtures/blob_metadata.json
252
+ - spec/fixtures/blobs.json
253
+ - spec/fixtures/branches.json
254
+ - spec/fixtures/collaborators.json
255
+ - spec/fixtures/comment.json
256
+ - spec/fixtures/comments.json
257
+ - spec/fixtures/commit.json
258
+ - spec/fixtures/commits.json
259
+ - spec/fixtures/contributors.json
260
+ - spec/fixtures/delete_token.json
261
+ - spec/fixtures/emails.json
262
+ - spec/fixtures/followers.json
263
+ - spec/fixtures/following.json
264
+ - spec/fixtures/issue.json
265
+ - spec/fixtures/issues.json
266
+ - spec/fixtures/labels.json
267
+ - spec/fixtures/languages.json
268
+ - spec/fixtures/network.json
269
+ - spec/fixtures/network_data.json
270
+ - spec/fixtures/network_meta.json
271
+ - spec/fixtures/organization.json
272
+ - spec/fixtures/organizations.json
273
+ - spec/fixtures/public_keys.json
274
+ - spec/fixtures/pull.json
275
+ - spec/fixtures/pulls.json
276
+ - spec/fixtures/raw.txt
277
+ - spec/fixtures/repositories.json
278
+ - spec/fixtures/repository.json
279
+ - spec/fixtures/tags.json
280
+ - spec/fixtures/team.json
281
+ - spec/fixtures/teams.json
282
+ - spec/fixtures/timeline.json
283
+ - spec/fixtures/tree.json
284
+ - spec/fixtures/tree_metadata.json
285
+ - spec/fixtures/user.json
286
+ - spec/fixtures/users.json
287
+ - spec/fixtures/watchers.json
288
+ - spec/helper.rb
289
+ - spec/octokit/client/commits_spec.rb
290
+ - spec/octokit/client/issues_spec.rb
291
+ - spec/octokit/client/network_spec.rb
292
+ - spec/octokit/client/objects_spec.rb
293
+ - spec/octokit/client/organizations_spec.rb
294
+ - spec/octokit/client/pulls_spec.rb
295
+ - spec/octokit/client/repositories_spec.rb
296
+ - spec/octokit/client/timelines_spec.rb
297
+ - spec/octokit/client/users_spec.rb
298
+ - spec/octokit/client_spec.rb
299
+ - spec/octokit_spec.rb
300
+ - spec/repository_spec.rb
301
+ has_rdoc: true
302
+ homepage: http://wynnnetherland.com/projects/octokit/
303
+ licenses: []
304
+
305
+ post_install_message:
306
+ rdoc_options: []
307
+
308
+ require_paths:
309
+ - lib
310
+ required_ruby_version: !ruby/object:Gem::Requirement
311
+ none: false
312
+ requirements:
313
+ - - ">="
314
+ - !ruby/object:Gem::Version
315
+ segments:
316
+ - 0
317
+ version: "0"
318
+ required_rubygems_version: !ruby/object:Gem::Requirement
319
+ none: false
320
+ requirements:
321
+ - - ">="
322
+ - !ruby/object:Gem::Version
323
+ segments:
324
+ - 1
325
+ - 3
326
+ - 6
327
+ version: 1.3.6
328
+ requirements: []
329
+
330
+ rubyforge_project:
331
+ rubygems_version: 1.3.7
332
+ signing_key:
333
+ specification_version: 3
334
+ summary: Wrapper for the GitHub API
335
+ test_files: []
336
+