octokit 0.4.0 → 0.4.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.
data/changelog.markdown CHANGED
@@ -1,4 +1,9 @@
1
1
  # Changelog
2
+ ## 0.4.1
3
+ * Patch from [karlfreeman](http://github.com/karlfreeman) to fix user search
4
+ ## 0.4.0
5
+ * Renamed to Ocotokit
6
+ * Switched to Faraday from HTTParty
2
7
  ## 0.3.0
3
8
  * Added set_repo_info patch from [Scott Bronson](http://github.com/bronson)
4
9
  ## 0.2.4
@@ -5,10 +5,10 @@ module Octokit
5
5
 
6
6
  def search_users(search, options={})
7
7
  if search.match(EMAIL_RE)
8
- get("user/email/#{search}", options)
8
+ get("user/email/#{search}", options)['user']
9
9
  else
10
- get("user/search/#{search}", options)
11
- end['users']
10
+ get("user/search/#{search}", options)['users']
11
+ end
12
12
  end
13
13
 
14
14
  def user(username=nil, options={})
@@ -1,3 +1,3 @@
1
1
  module Octokit
2
- VERSION = "0.4.0".freeze unless defined?(Octokit::VERSION)
2
+ VERSION = "0.4.1".freeze unless defined?(Octokit::VERSION)
3
3
  end
@@ -0,0 +1,19 @@
1
+ {
2
+ "user":{
3
+ "gravatar_id":"7e19cd5486b5d6dc1ef90e671ba52ae0",
4
+ "company":"Hewlett Packard",
5
+ "name":"Wynn Netherland",
6
+ "created_at":"2008/02/25 10:24:19 -0800",
7
+ "location":"Dallas, TX",
8
+ "public_repo_count":33,
9
+ "public_gist_count":21,
10
+ "blog":"http://wynnnetherland.com",
11
+ "following_count":141,
12
+ "id":865,
13
+ "type":"User",
14
+ "permission":null,
15
+ "followers_count":152,
16
+ "login":"pengwynn",
17
+ "email":"wynn.netherland@gmail.com"
18
+ }
19
+ }
File without changes
data/test/octokit_test.rb CHANGED
@@ -7,11 +7,17 @@ class OctokitTest < Test::Unit::TestCase
7
7
  @client = Octokit::Client.new(:login => 'pengwynn', :token => 'OU812')
8
8
  end
9
9
 
10
- should "should search users" do
11
- stub_get("user/search/wynn", "search.json")
10
+ should "should search users by username" do
11
+ stub_get("user/search/wynn", "search-username.json")
12
12
  users = @client.search_users("wynn")
13
13
  users.first.username.should == 'pengwynn'
14
14
  end
15
+
16
+ should "should search users by email" do
17
+ stub_get("user/email/wynn.netherland@gmail.com", "search-email.json")
18
+ users = @client.search_users("wynn.netherland@gmail.com")
19
+ users.login.should == 'pengwynn'
20
+ end
15
21
 
16
22
  should "return full user info for the authenticated user" do
17
23
  stub_get("user/show", "full_user.json")
@@ -256,10 +262,16 @@ class OctokitTest < Test::Unit::TestCase
256
262
  context "when unauthenticated" do
257
263
 
258
264
  should "search users" do
259
- stub_get("user/search/wynn", "search.json")
265
+ stub_get("user/search/wynn", "search-username.json")
260
266
  users = Octokit.search_users("wynn")
261
267
  users.first.username.should == 'pengwynn'
262
268
  end
269
+
270
+ should "should search users by email" do
271
+ stub_get("user/email/wynn.netherland@gmail.com", "search-email.json")
272
+ users = Octokit.search_users("wynn.netherland@gmail.com")
273
+ users.login.should == 'pengwynn'
274
+ end
263
275
 
264
276
  should "return user info" do
265
277
  stub_get("user/show/pengwynn", "user.json")
@@ -11,7 +11,7 @@ class RepoTest < Test::Unit::TestCase
11
11
  @repo.username.should == "pengwynn"
12
12
  end
13
13
 
14
- should "repond to user and repo" do
14
+ should "respond to user and repo" do
15
15
  @repo.repo.should == "linkedin"
16
16
  @repo.user.should == "pengwynn"
17
17
  end
metadata CHANGED
@@ -1,12 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: octokit
3
3
  version: !ruby/object:Gem::Version
4
+ hash: 13
4
5
  prerelease: false
5
6
  segments:
6
7
  - 0
7
8
  - 4
8
- - 0
9
- version: 0.4.0
9
+ - 1
10
+ version: 0.4.1
10
11
  platform: ruby
11
12
  authors:
12
13
  - Wynn Netherland
@@ -16,7 +17,7 @@ autorequire:
16
17
  bindir: bin
17
18
  cert_chain: []
18
19
 
19
- date: 2011-01-06 00:00:00 -08:00
20
+ date: 2011-01-08 00:00:00 -06:00
20
21
  default_executable:
21
22
  dependencies:
22
23
  - !ruby/object:Gem::Dependency
@@ -27,6 +28,7 @@ dependencies:
27
28
  requirements:
28
29
  - - ~>
29
30
  - !ruby/object:Gem::Version
31
+ hash: 9
30
32
  segments:
31
33
  - 1
32
34
  - 3
@@ -41,6 +43,7 @@ dependencies:
41
43
  requirements:
42
44
  - - ~>
43
45
  - !ruby/object:Gem::Version
46
+ hash: 3
44
47
  segments:
45
48
  - 0
46
49
  - 4
@@ -55,6 +58,7 @@ dependencies:
55
58
  requirements:
56
59
  - - ~>
57
60
  - !ruby/object:Gem::Version
61
+ hash: 7
58
62
  segments:
59
63
  - 1
60
64
  - 4
@@ -69,6 +73,7 @@ dependencies:
69
73
  requirements:
70
74
  - - ~>
71
75
  - !ruby/object:Gem::Version
76
+ hash: 25
72
77
  segments:
73
78
  - 0
74
79
  - 9
@@ -83,6 +88,7 @@ dependencies:
83
88
  requirements:
84
89
  - - ~>
85
90
  - !ruby/object:Gem::Version
91
+ hash: 7
86
92
  segments:
87
93
  - 1
88
94
  - 4
@@ -97,6 +103,7 @@ dependencies:
97
103
  requirements:
98
104
  - - ~>
99
105
  - !ruby/object:Gem::Version
106
+ hash: 27
100
107
  segments:
101
108
  - 0
102
109
  - 8
@@ -111,6 +118,7 @@ dependencies:
111
118
  requirements:
112
119
  - - ~>
113
120
  - !ruby/object:Gem::Version
121
+ hash: 21
114
122
  segments:
115
123
  - 2
116
124
  - 11
@@ -125,6 +133,7 @@ dependencies:
125
133
  requirements:
126
134
  - - ~>
127
135
  - !ruby/object:Gem::Version
136
+ hash: 3
128
137
  segments:
129
138
  - 1
130
139
  - 6
@@ -139,6 +148,7 @@ dependencies:
139
148
  requirements:
140
149
  - - ~>
141
150
  - !ruby/object:Gem::Version
151
+ hash: 19
142
152
  segments:
143
153
  - 4
144
154
  - 4
@@ -153,6 +163,7 @@ dependencies:
153
163
  requirements:
154
164
  - - ~>
155
165
  - !ruby/object:Gem::Version
166
+ hash: 3
156
167
  segments:
157
168
  - 2
158
169
  - 2
@@ -168,6 +179,7 @@ dependencies:
168
179
  requirements:
169
180
  - - ~>
170
181
  - !ruby/object:Gem::Version
182
+ hash: 15
171
183
  segments:
172
184
  - 0
173
185
  - 4
@@ -183,6 +195,7 @@ dependencies:
183
195
  requirements:
184
196
  - - ~>
185
197
  - !ruby/object:Gem::Version
198
+ hash: 13
186
199
  segments:
187
200
  - 0
188
201
  - 5
@@ -198,6 +211,7 @@ dependencies:
198
211
  requirements:
199
212
  - - ~>
200
213
  - !ruby/object:Gem::Version
214
+ hash: 17
201
215
  segments:
202
216
  - 0
203
217
  - 3
@@ -213,6 +227,7 @@ dependencies:
213
227
  requirements:
214
228
  - - ~>
215
229
  - !ruby/object:Gem::Version
230
+ hash: 21
216
231
  segments:
217
232
  - 0
218
233
  - 0
@@ -228,6 +243,7 @@ dependencies:
228
243
  requirements:
229
244
  - - ~>
230
245
  - !ruby/object:Gem::Version
246
+ hash: 23
231
247
  segments:
232
248
  - 0
233
249
  - 2
@@ -297,7 +313,8 @@ files:
297
313
  - test/fixtures/repo.json
298
314
  - test/fixtures/repo_search.json
299
315
  - test/fixtures/repos.json
300
- - test/fixtures/search.json
316
+ - test/fixtures/search-email.json
317
+ - test/fixtures/search-username.json
301
318
  - test/fixtures/show_commit.json
302
319
  - test/fixtures/tags.json
303
320
  - test/fixtures/timeline.json
@@ -320,6 +337,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
320
337
  requirements:
321
338
  - - ">="
322
339
  - !ruby/object:Gem::Version
340
+ hash: 3
323
341
  segments:
324
342
  - 0
325
343
  version: "0"
@@ -328,6 +346,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
328
346
  requirements:
329
347
  - - ">="
330
348
  - !ruby/object:Gem::Version
349
+ hash: 23
331
350
  segments:
332
351
  - 1
333
352
  - 3
@@ -366,7 +385,8 @@ test_files:
366
385
  - test/fixtures/repo.json
367
386
  - test/fixtures/repo_search.json
368
387
  - test/fixtures/repos.json
369
- - test/fixtures/search.json
388
+ - test/fixtures/search-email.json
389
+ - test/fixtures/search-username.json
370
390
  - test/fixtures/show_commit.json
371
391
  - test/fixtures/tags.json
372
392
  - test/fixtures/timeline.json