octokit 1.0.7 → 1.1.0

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 (75) hide show
  1. data/CHANGELOG.md +1 -0
  2. data/lib/octokit/client.rb +3 -0
  3. data/lib/octokit/client/gists.rb +66 -0
  4. data/lib/octokit/gist.rb +27 -0
  5. data/lib/octokit/version.rb +1 -1
  6. data/spec/fixtures/timeline.json +1408 -1237
  7. data/spec/fixtures/v2/blob_metadata.json +2052 -1
  8. data/spec/fixtures/v2/blobs.json +260 -1
  9. data/spec/fixtures/v2/issues.json +49 -1
  10. data/spec/fixtures/v2/network_data.json +3551 -1
  11. data/spec/fixtures/v2/network_meta.json +2530 -1
  12. data/spec/fixtures/v2/repositories.json +173 -1
  13. data/spec/fixtures/v2/tree_metadata.json +2612 -1
  14. data/spec/fixtures/v2/user.json +19 -1
  15. data/spec/fixtures/v2/users.json +24 -1
  16. data/spec/fixtures/v3/blob.json +5 -5
  17. data/spec/fixtures/v3/branches.json +14 -14
  18. data/spec/fixtures/v3/collaborators.json +60 -60
  19. data/spec/fixtures/v3/comment.json +12 -12
  20. data/spec/fixtures/v3/comments.json +41 -41
  21. data/spec/fixtures/v3/commit.json +50 -1
  22. data/spec/fixtures/v3/commit_comment.json +17 -17
  23. data/spec/fixtures/v3/commit_comments.json +76 -76
  24. data/spec/fixtures/v3/commits.json +1414 -1
  25. data/spec/fixtures/v3/contributors.json +889 -889
  26. data/spec/fixtures/v3/download.json +9 -9
  27. data/spec/fixtures/v3/downloads.json +33 -33
  28. data/spec/fixtures/v3/emails.json +3 -3
  29. data/spec/fixtures/v3/followers.json +210 -210
  30. data/spec/fixtures/v3/following.json +207 -207
  31. data/spec/fixtures/v3/forks.json +870 -870
  32. data/spec/fixtures/v3/gist.json +51 -0
  33. data/spec/fixtures/v3/gists.json +548 -0
  34. data/spec/fixtures/v3/issue.json +33 -35
  35. data/spec/fixtures/v3/issue_closed.json +34 -36
  36. data/spec/fixtures/v3/issue_event.json +40 -42
  37. data/spec/fixtures/v3/issue_events.json +70 -70
  38. data/spec/fixtures/v3/issues.json +1559 -1577
  39. data/spec/fixtures/v3/label.json +3 -3
  40. data/spec/fixtures/v3/labels.json +15 -15
  41. data/spec/fixtures/v3/languages.json +3 -3
  42. data/spec/fixtures/v3/list_commit_comments.json +570 -570
  43. data/spec/fixtures/v3/milestone.json +9 -10
  44. data/spec/fixtures/v3/milestones.json +25 -25
  45. data/spec/fixtures/v3/not_found.json +1 -1
  46. data/spec/fixtures/v3/organization-repositories.json +4290 -4290
  47. data/spec/fixtures/v3/organization-repository.json +41 -41
  48. data/spec/fixtures/v3/organization.json +16 -16
  49. data/spec/fixtures/v3/organization_members.json +574 -574
  50. data/spec/fixtures/v3/organization_team_members.json +14 -14
  51. data/spec/fixtures/v3/organization_team_repos.json +60 -60
  52. data/spec/fixtures/v3/organizations.json +42 -42
  53. data/spec/fixtures/v3/public_events.json +1101 -1107
  54. data/spec/fixtures/v3/public_gists.json +968 -0
  55. data/spec/fixtures/v3/public_key.json +3 -3
  56. data/spec/fixtures/v3/public_keys.json +5 -5
  57. data/spec/fixtures/v3/pull_created.json +134 -134
  58. data/spec/fixtures/v3/pull_request.json +134 -134
  59. data/spec/fixtures/v3/pull_requests.json +185 -185
  60. data/spec/fixtures/v3/repo_events.json +1644 -1660
  61. data/spec/fixtures/v3/repo_issues_events.json +127 -133
  62. data/spec/fixtures/v3/repositories.json +871 -871
  63. data/spec/fixtures/v3/repository.json +33 -33
  64. data/spec/fixtures/v3/starred_gists.json +30 -0
  65. data/spec/fixtures/v3/tags.json +171 -171
  66. data/spec/fixtures/v3/team.json +6 -6
  67. data/spec/fixtures/v3/teams.json +10 -10
  68. data/spec/fixtures/v3/tree.json +110 -110
  69. data/spec/fixtures/v3/user.json +18 -18
  70. data/spec/fixtures/v3/user_events.json +99 -100
  71. data/spec/fixtures/v3/watched.json +1020 -1020
  72. data/spec/fixtures/v3/watchers.json +180 -180
  73. data/spec/octokit/client/gists_spec.rb +133 -0
  74. data/spec/octokit/gist_spec.rb +49 -0
  75. metadata +40 -26
@@ -0,0 +1,49 @@
1
+ # -*- encoding: utf-8 -*-
2
+ require 'helper'
3
+
4
+ describe Octokit::Gist do
5
+
6
+ context "when given a URL" do
7
+ it "should set the id" do
8
+ gist = Octokit::Gist.from_url("https://gist.github.com/12345")
9
+ gist.id.should == '12345'
10
+ end
11
+ end
12
+
13
+ context "when passed a string ID" do
14
+ before do
15
+ @gist = Octokit::Gist.new('12345')
16
+ end
17
+
18
+ it "should set the gist ID" do
19
+ @gist.id.should == '12345'
20
+ end
21
+
22
+ it "should set the url" do
23
+ @gist.url.should == 'https://gist.github.com/12345'
24
+ end
25
+
26
+ it "should render id as string" do
27
+ @gist.to_s.should == @gist.id
28
+ end
29
+ end
30
+
31
+ context "when passed a Fixnum ID" do
32
+ before do
33
+ @gist = Octokit::Gist.new(12345)
34
+ end
35
+
36
+ it "should set the gist ID as a string" do
37
+ @gist.id.should == '12345'
38
+ end
39
+
40
+ it "should set the url" do
41
+ @gist.url.should == 'https://gist.github.com/12345'
42
+ end
43
+
44
+ it "should render id as string" do
45
+ @gist.to_s.should == @gist.id
46
+ end
47
+ end
48
+
49
+ end
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.7
4
+ version: 1.1.0
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-05-11 00:00:00.000000000 Z
14
+ date: 2012-05-14 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: addressable
18
- requirement: &70146290234980 !ruby/object:Gem::Requirement
18
+ requirement: &70192014785860 !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: *70146290234980
26
+ version_requirements: *70192014785860
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: faraday
29
- requirement: &70146290234400 !ruby/object:Gem::Requirement
29
+ requirement: &70192014781940 !ruby/object:Gem::Requirement
30
30
  none: false
31
31
  requirements:
32
32
  - - ~>
@@ -34,10 +34,10 @@ dependencies:
34
34
  version: '0.8'
35
35
  type: :runtime
36
36
  prerelease: false
37
- version_requirements: *70146290234400
37
+ version_requirements: *70192014781940
38
38
  - !ruby/object:Gem::Dependency
39
39
  name: faraday_middleware
40
- requirement: &70146290233920 !ruby/object:Gem::Requirement
40
+ requirement: &70192014779940 !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: *70146290233920
48
+ version_requirements: *70192014779940
49
49
  - !ruby/object:Gem::Dependency
50
50
  name: hashie
51
- requirement: &70146290233380 !ruby/object:Gem::Requirement
51
+ requirement: &70192014775500 !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: *70146290233380
59
+ version_requirements: *70192014775500
60
60
  - !ruby/object:Gem::Dependency
61
61
  name: multi_json
62
- requirement: &70146290232860 !ruby/object:Gem::Requirement
62
+ requirement: &70192014774620 !ruby/object:Gem::Requirement
63
63
  none: false
64
64
  requirements:
65
65
  - - ~>
@@ -67,10 +67,10 @@ dependencies:
67
67
  version: '1.3'
68
68
  type: :runtime
69
69
  prerelease: false
70
- version_requirements: *70146290232860
70
+ version_requirements: *70192014774620
71
71
  - !ruby/object:Gem::Dependency
72
72
  name: json
73
- requirement: &70146290232460 !ruby/object:Gem::Requirement
73
+ requirement: &70192014773700 !ruby/object:Gem::Requirement
74
74
  none: false
75
75
  requirements:
76
76
  - - ! '>='
@@ -78,10 +78,10 @@ dependencies:
78
78
  version: '0'
79
79
  type: :development
80
80
  prerelease: false
81
- version_requirements: *70146290232460
81
+ version_requirements: *70192014773700
82
82
  - !ruby/object:Gem::Dependency
83
83
  name: maruku
84
- requirement: &70146290231880 !ruby/object:Gem::Requirement
84
+ requirement: &70192014772500 !ruby/object:Gem::Requirement
85
85
  none: false
86
86
  requirements:
87
87
  - - ! '>='
@@ -89,10 +89,10 @@ dependencies:
89
89
  version: '0'
90
90
  type: :development
91
91
  prerelease: false
92
- version_requirements: *70146290231880
92
+ version_requirements: *70192014772500
93
93
  - !ruby/object:Gem::Dependency
94
94
  name: rake
95
- requirement: &70146290231360 !ruby/object:Gem::Requirement
95
+ requirement: &70192014771680 !ruby/object:Gem::Requirement
96
96
  none: false
97
97
  requirements:
98
98
  - - ! '>='
@@ -100,10 +100,10 @@ dependencies:
100
100
  version: '0'
101
101
  type: :development
102
102
  prerelease: false
103
- version_requirements: *70146290231360
103
+ version_requirements: *70192014771680
104
104
  - !ruby/object:Gem::Dependency
105
105
  name: rspec
106
- requirement: &70146290230680 !ruby/object:Gem::Requirement
106
+ requirement: &70192014770480 !ruby/object:Gem::Requirement
107
107
  none: false
108
108
  requirements:
109
109
  - - ! '>='
@@ -111,10 +111,10 @@ dependencies:
111
111
  version: '0'
112
112
  type: :development
113
113
  prerelease: false
114
- version_requirements: *70146290230680
114
+ version_requirements: *70192014770480
115
115
  - !ruby/object:Gem::Dependency
116
116
  name: simplecov
117
- requirement: &70146290223020 !ruby/object:Gem::Requirement
117
+ requirement: &70192014770020 !ruby/object:Gem::Requirement
118
118
  none: false
119
119
  requirements:
120
120
  - - ! '>='
@@ -122,10 +122,10 @@ dependencies:
122
122
  version: '0'
123
123
  type: :development
124
124
  prerelease: false
125
- version_requirements: *70146290223020
125
+ version_requirements: *70192014770020
126
126
  - !ruby/object:Gem::Dependency
127
127
  name: webmock
128
- requirement: &70146290222300 !ruby/object:Gem::Requirement
128
+ requirement: &70192014769220 !ruby/object:Gem::Requirement
129
129
  none: false
130
130
  requirements:
131
131
  - - ! '>='
@@ -133,10 +133,10 @@ dependencies:
133
133
  version: '0'
134
134
  type: :development
135
135
  prerelease: false
136
- version_requirements: *70146290222300
136
+ version_requirements: *70192014769220
137
137
  - !ruby/object:Gem::Dependency
138
138
  name: yard
139
- requirement: &70146290221400 !ruby/object:Gem::Requirement
139
+ requirement: &70192014768340 !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: *70146290221400
147
+ version_requirements: *70192014768340
148
148
  description: Simple wrapper for the GitHub API (v2 and v3)
149
149
  email:
150
150
  - wynn.netherland@gmail.com
@@ -171,6 +171,7 @@ files:
171
171
  - lib/octokit/client/commits.rb
172
172
  - lib/octokit/client/downloads.rb
173
173
  - lib/octokit/client/events.rb
174
+ - lib/octokit/client/gists.rb
174
175
  - lib/octokit/client/issues.rb
175
176
  - lib/octokit/client/labels.rb
176
177
  - lib/octokit/client/milestones.rb
@@ -186,6 +187,7 @@ files:
186
187
  - lib/octokit/configuration.rb
187
188
  - lib/octokit/connection.rb
188
189
  - lib/octokit/error.rb
190
+ - lib/octokit/gist.rb
189
191
  - lib/octokit/repository.rb
190
192
  - lib/octokit/request.rb
191
193
  - lib/octokit/version.rb
@@ -218,6 +220,8 @@ files:
218
220
  - spec/fixtures/v3/followers.json
219
221
  - spec/fixtures/v3/following.json
220
222
  - spec/fixtures/v3/forks.json
223
+ - spec/fixtures/v3/gist.json
224
+ - spec/fixtures/v3/gists.json
221
225
  - spec/fixtures/v3/issue.json
222
226
  - spec/fixtures/v3/issue_closed.json
223
227
  - spec/fixtures/v3/issue_event.json
@@ -238,6 +242,7 @@ files:
238
242
  - spec/fixtures/v3/organization_team_repos.json
239
243
  - spec/fixtures/v3/organizations.json
240
244
  - spec/fixtures/v3/public_events.json
245
+ - spec/fixtures/v3/public_gists.json
241
246
  - spec/fixtures/v3/public_key.json
242
247
  - spec/fixtures/v3/public_keys.json
243
248
  - spec/fixtures/v3/pull_created.json
@@ -247,6 +252,7 @@ files:
247
252
  - spec/fixtures/v3/repo_issues_events.json
248
253
  - spec/fixtures/v3/repositories.json
249
254
  - spec/fixtures/v3/repository.json
255
+ - spec/fixtures/v3/starred_gists.json
250
256
  - spec/fixtures/v3/tags.json
251
257
  - spec/fixtures/v3/team.json
252
258
  - spec/fixtures/v3/teams.json
@@ -259,6 +265,7 @@ files:
259
265
  - spec/octokit/client/commits_spec.rb
260
266
  - spec/octokit/client/downloads_spec.rb
261
267
  - spec/octokit/client/events_spec.rb
268
+ - spec/octokit/client/gists_spec.rb
262
269
  - spec/octokit/client/issue_events_spec.rb
263
270
  - spec/octokit/client/issues_spec.rb
264
271
  - spec/octokit/client/labels_spec.rb
@@ -273,6 +280,7 @@ files:
273
280
  - spec/octokit/client/timelines_spec.rb
274
281
  - spec/octokit/client/users_spec.rb
275
282
  - spec/octokit/client_spec.rb
283
+ - spec/octokit/gist_spec.rb
276
284
  - spec/octokit_spec.rb
277
285
  - spec/repository_spec.rb
278
286
  homepage: https://github.com/pengwynn/octokit
@@ -328,6 +336,8 @@ test_files:
328
336
  - spec/fixtures/v3/followers.json
329
337
  - spec/fixtures/v3/following.json
330
338
  - spec/fixtures/v3/forks.json
339
+ - spec/fixtures/v3/gist.json
340
+ - spec/fixtures/v3/gists.json
331
341
  - spec/fixtures/v3/issue.json
332
342
  - spec/fixtures/v3/issue_closed.json
333
343
  - spec/fixtures/v3/issue_event.json
@@ -348,6 +358,7 @@ test_files:
348
358
  - spec/fixtures/v3/organization_team_repos.json
349
359
  - spec/fixtures/v3/organizations.json
350
360
  - spec/fixtures/v3/public_events.json
361
+ - spec/fixtures/v3/public_gists.json
351
362
  - spec/fixtures/v3/public_key.json
352
363
  - spec/fixtures/v3/public_keys.json
353
364
  - spec/fixtures/v3/pull_created.json
@@ -357,6 +368,7 @@ test_files:
357
368
  - spec/fixtures/v3/repo_issues_events.json
358
369
  - spec/fixtures/v3/repositories.json
359
370
  - spec/fixtures/v3/repository.json
371
+ - spec/fixtures/v3/starred_gists.json
360
372
  - spec/fixtures/v3/tags.json
361
373
  - spec/fixtures/v3/team.json
362
374
  - spec/fixtures/v3/teams.json
@@ -369,6 +381,7 @@ test_files:
369
381
  - spec/octokit/client/commits_spec.rb
370
382
  - spec/octokit/client/downloads_spec.rb
371
383
  - spec/octokit/client/events_spec.rb
384
+ - spec/octokit/client/gists_spec.rb
372
385
  - spec/octokit/client/issue_events_spec.rb
373
386
  - spec/octokit/client/issues_spec.rb
374
387
  - spec/octokit/client/labels_spec.rb
@@ -383,6 +396,7 @@ test_files:
383
396
  - spec/octokit/client/timelines_spec.rb
384
397
  - spec/octokit/client/users_spec.rb
385
398
  - spec/octokit/client_spec.rb
399
+ - spec/octokit/gist_spec.rb
386
400
  - spec/octokit_spec.rb
387
401
  - spec/repository_spec.rb
388
402
  has_rdoc: