octokit 1.0.4 → 1.0.5
Sign up to get free protection for your applications and to get access to all the features.
- data/.document +1 -0
- data/CHANGELOG.md +2 -0
- data/README.md +23 -14
- data/lib/octokit/client/issues.rb +1 -2
- data/lib/octokit/client/organizations.rb +4 -4
- data/lib/octokit/client/repositories.rb +1 -2
- data/lib/octokit/client/users.rb +2 -2
- data/lib/octokit/version.rb +1 -1
- data/spec/octokit/client/issues_spec.rb +2 -2
- data/spec/octokit/client/repositories_spec.rb +1 -1
- data/spec/octokit/client/users_spec.rb +1 -1
- metadata +27 -87
data/.document
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
# CHANGELOG
|
2
2
|
|
3
|
+
* [1.0.5 - May 2, 2012](https://github.com/pengwynn/octokit/compare/v1.0.4...v1.0.5)
|
4
|
+
* [1.0.4 - April 24, 2012](https://github.com/pengwynn/octokit/compare/v1.0.3...v1.0.4)
|
3
5
|
* [1.0.3 - April 18, 2012](https://github.com/pengwynn/octokit/compare/v1.0.2...v1.0.3)
|
4
6
|
* [1.0.2 - March 31, 2012](https://github.com/pengwynn/octokit/compare/v1.0.1...v1.0.2)
|
5
7
|
* [1.0.1 - March 31, 2012](https://github.com/pengwynn/octokit/compare/v1.0.0...v1.0.1)
|
data/README.md
CHANGED
@@ -14,38 +14,47 @@ Simple Ruby wrapper for the GitHub v2 & v3 API.
|
|
14
14
|
|
15
15
|
## <a name="examples"></a>Examples
|
16
16
|
### Show a user
|
17
|
-
|
18
|
-
|
17
|
+
```ruby
|
18
|
+
Octokit.user("sferik")
|
19
|
+
=> <#Hashie::Rash blog="http://twitter.com/sferik" company="Code for America" created_at="2008/05/14 13:36:12 -0700" email="sferik@gmail.com" followers_count=177 following_count=83 gravatar_id="1f74b13f1e5c6c69cb5d7fbaabb1e2cb" id=10308 location="San Francisco" login="sferik" name="Erik Michaels-Ober" permission=nil public_gist_count=16 public_repo_count=30 type="User">
|
20
|
+
```
|
19
21
|
|
20
22
|
### Show who a user follows
|
21
|
-
|
22
|
-
|
23
|
+
```ruby
|
24
|
+
Octokit.following("sferik")
|
25
|
+
=> ["rails", "puls", "wycats", "dhh", "jm3", "joshsusser", "nkallen", "technoweenie", "blaine", "al3x", "defunkt", "schacon", "bmizerany", "rtomayko", "jpr5", "lholden", "140proof", "ephramzerb", "carlhuda", "carllerche", "jnunemaker", "josh", "hoverbird", "jamiew", "jeremyevans", "brynary", "mojodna", "mojombo", "joshbuddy", "igrigorik", "perplexes", "joearasin", "hassox", "nickmarden", "pengwynn", "mmcgrana", "reddavis", "reinh", "mzsanford", "aanand", "pjhyett", "kneath", "tekkub", "adamstac", "timtrueman", "aaronblohowiak", "josevalim", "kaapa", "hurrycane", "jackdempsey", "drogus", "cameronpriest", "danmelton", "marcel", "r", "atmos", "mbleigh", "isaacs", "maxogden", "codeforamerica", "chadk", "laserlemon", "gruber", "lsegal", "bblimke", "wayneeseguin", "brixen", "dkubb", "bhb", "bcardarella", "elliottcable", "fbjork", "mlightner", "dianakimball", "amerine", "danchoi", "develop", "dmfrancisco", "unruthless", "trotter", "hannestyden", "codahale", "ry"]
|
26
|
+
```
|
23
27
|
|
24
28
|
### Repositories
|
25
29
|
For convenience, methods that require a repoistory argument may be passed in any of the following forms:
|
26
30
|
|
27
|
-
* "pengwynn/octokit"
|
28
|
-
* {:username => "pengwynn", :name => "octokit"}
|
29
|
-
* {:username => "pengwynn", :repo => "octokit"}
|
31
|
+
* `"pengwynn/octokit"`
|
32
|
+
* `{:username => "pengwynn", :name => "octokit"}`
|
33
|
+
* `{:username => "pengwynn", :repo => "octokit"}`
|
30
34
|
* instance of `Repository`
|
31
35
|
|
32
|
-
|
33
|
-
|
36
|
+
```ruby
|
37
|
+
Octokit.repo("pengwynn/octokit")
|
38
|
+
=> <#Hashie::Rash created_at="2009/12/10 13:41:49 -0800" description="Simple Ruby wrapper for the GitHub v2 API and feeds" fork=false forks=25 has_downloads=true has_issues=true has_wiki=true homepage="http://wynnnetherland.com/projects/octokit" integrate_branch="master" language="Ruby" name="octokit" open_issues=8 owner="pengwynn" private=false pushed_at="2011/05/05 10:48:57 -0700" size=1804 url="https://github.com/pengwynn/octokit" watchers=92>
|
39
|
+
```
|
34
40
|
|
35
41
|
## <a name="authenticated_requests"></a>Authenticated Requests
|
36
42
|
For methods that require authentication, you'll need to setup a client with
|
37
43
|
your login and password.
|
38
44
|
|
39
|
-
|
40
|
-
|
45
|
+
```ruby
|
46
|
+
client = Octokit::Client.new(:login => "me", :password => "sekret")
|
47
|
+
client.follow!("sferik")
|
48
|
+
```
|
41
49
|
|
42
50
|
Alternately, you can authenticate with a GitHub OAuth2 token. Note: this is
|
43
51
|
**NOT** the GitHub API token on your [account page][account].
|
44
52
|
|
45
53
|
[account]: https://github.com/account
|
46
|
-
|
47
|
-
|
48
|
-
|
54
|
+
```ruby
|
55
|
+
client = Octokit::Client.new(:login => "me", :oauth_token => "oauth2token")
|
56
|
+
client.follow!("sferik")
|
57
|
+
```
|
49
58
|
|
50
59
|
## <a name="pulls"></a>Submitting a Pull Request
|
51
60
|
1. Fork the project.
|
@@ -13,8 +13,7 @@ module Octokit
|
|
13
13
|
# Octokit.search_issues("sferik/rails_admin", 'test', 'open')
|
14
14
|
# @deprecated Please use `list_issues` instead
|
15
15
|
def search_issues(repo, search_term, state='open', options={})
|
16
|
-
|
17
|
-
get("/api/v2/json/issues/search/#{Repository.new(repo)}/#{state}/#{search_term}", options, 2)['issues']
|
16
|
+
get("/legacy/issues/search/#{Repository.new(repo)}/#{state}/#{search_term}", options, 3)['issues']
|
18
17
|
end
|
19
18
|
|
20
19
|
# List issues for a repository
|
@@ -43,16 +43,16 @@ module Octokit
|
|
43
43
|
end
|
44
44
|
alias :org_teams :organization_teams
|
45
45
|
|
46
|
-
def create_team(org,
|
47
|
-
post("orgs/#{org}/teams", options
|
46
|
+
def create_team(org, options={})
|
47
|
+
post("orgs/#{org}/teams", options, 3)
|
48
48
|
end
|
49
49
|
|
50
50
|
def team(team_id, options={})
|
51
51
|
get("teams/#{team_id}", options, 3)
|
52
52
|
end
|
53
53
|
|
54
|
-
def update_team(team_id,
|
55
|
-
patch("teams/#{team_id}", options
|
54
|
+
def update_team(team_id, options={})
|
55
|
+
patch("teams/#{team_id}", options, 3)
|
56
56
|
end
|
57
57
|
|
58
58
|
def delete_team(team_id, options={})
|
@@ -2,8 +2,7 @@ module Octokit
|
|
2
2
|
class Client
|
3
3
|
module Repositories
|
4
4
|
def search_repositories(q, options={})
|
5
|
-
|
6
|
-
get("/api/v2/json/repos/search/#{q}", options, 2)['repositories']
|
5
|
+
get("/legacy/repos/search/#{q}", options, 3)['repositories']
|
7
6
|
end
|
8
7
|
alias :search_repos :search_repositories
|
9
8
|
|
data/lib/octokit/client/users.rb
CHANGED
@@ -4,11 +4,11 @@ module Octokit
|
|
4
4
|
|
5
5
|
EMAIL_RE = /[\w.!#\$%+-]+@[\w-]+(?:\.[\w-]+)+/
|
6
6
|
def search_users(search, options={})
|
7
|
-
warn 'DEPRECATED: V3 of the API does not allow searching users.'
|
8
7
|
if search.match(EMAIL_RE)
|
8
|
+
warn 'DEPRECATED: V3 of the API does not allow searching users by email'
|
9
9
|
get("/api/v2/json/user/email/#{search}", options, 2)['user']
|
10
10
|
else
|
11
|
-
get("/
|
11
|
+
get("/legacy/user/search/#{search}", options, 3)['users']
|
12
12
|
end
|
13
13
|
end
|
14
14
|
|
data/lib/octokit/version.rb
CHANGED
@@ -10,7 +10,7 @@ describe Octokit::Client::Issues do
|
|
10
10
|
describe ".search_issues" do
|
11
11
|
|
12
12
|
it "should return matching issues" do
|
13
|
-
stub_get("https://github.com/
|
13
|
+
stub_get("https://api.github.com/legacy/issues/search/sferik/rails_admin/open/activerecord").
|
14
14
|
to_return(:body => fixture("v2/issues.json"))
|
15
15
|
issues = @client.search_issues("sferik/rails_admin", "activerecord")
|
16
16
|
issues.first.number.should == 105
|
@@ -37,7 +37,7 @@ describe Octokit::Client::Issues do
|
|
37
37
|
:headers => {'Content-Type'=>'application/json'}).
|
38
38
|
to_return(:body => fixture("v3/issue.json"))
|
39
39
|
issue = @client.create_issue("ctshryock/octokit", "Migrate issues to v3", "Move all Issues calls to v3 of the API")
|
40
|
-
issue.number.should == 12
|
40
|
+
issue.number.should == 12
|
41
41
|
end
|
42
42
|
|
43
43
|
end
|
@@ -10,7 +10,7 @@ describe Octokit::Client::Repositories do
|
|
10
10
|
describe ".search_user" do
|
11
11
|
|
12
12
|
it "should return matching repositories" do
|
13
|
-
stub_get("https://github.com/
|
13
|
+
stub_get("https://api.github.com/legacy/repos/search/One40Proof").
|
14
14
|
to_return(:body => fixture("v2/repositories.json"))
|
15
15
|
repositories = @client.search_repositories("One40Proof")
|
16
16
|
repositories.first.name.should == "One40Proof"
|
@@ -12,7 +12,7 @@ describe Octokit::Client::Users do
|
|
12
12
|
context "with a username passed" do
|
13
13
|
|
14
14
|
it "should return matching username" do
|
15
|
-
stub_get("https://github.com/
|
15
|
+
stub_get("https://api.github.com/legacy/user/search/sferik").
|
16
16
|
to_return(:body => fixture("v2/users.json"))
|
17
17
|
users = @client.search_users("sferik")
|
18
18
|
users.first.username.should == "sferik"
|
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.
|
4
|
+
version: 1.0.5
|
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-
|
14
|
+
date: 2012-05-02 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: addressable
|
18
|
-
requirement: !ruby/object:Gem::Requirement
|
18
|
+
requirement: &70212265941400 !ruby/object:Gem::Requirement
|
19
19
|
none: false
|
20
20
|
requirements:
|
21
21
|
- - ~>
|
@@ -23,15 +23,10 @@ dependencies:
|
|
23
23
|
version: '2.2'
|
24
24
|
type: :runtime
|
25
25
|
prerelease: false
|
26
|
-
version_requirements:
|
27
|
-
none: false
|
28
|
-
requirements:
|
29
|
-
- - ~>
|
30
|
-
- !ruby/object:Gem::Version
|
31
|
-
version: '2.2'
|
26
|
+
version_requirements: *70212265941400
|
32
27
|
- !ruby/object:Gem::Dependency
|
33
28
|
name: faraday
|
34
|
-
requirement: !ruby/object:Gem::Requirement
|
29
|
+
requirement: &70212265939680 !ruby/object:Gem::Requirement
|
35
30
|
none: false
|
36
31
|
requirements:
|
37
32
|
- - ~>
|
@@ -39,15 +34,10 @@ dependencies:
|
|
39
34
|
version: '0.8'
|
40
35
|
type: :runtime
|
41
36
|
prerelease: false
|
42
|
-
version_requirements:
|
43
|
-
none: false
|
44
|
-
requirements:
|
45
|
-
- - ~>
|
46
|
-
- !ruby/object:Gem::Version
|
47
|
-
version: '0.8'
|
37
|
+
version_requirements: *70212265939680
|
48
38
|
- !ruby/object:Gem::Dependency
|
49
39
|
name: faraday_middleware
|
50
|
-
requirement: !ruby/object:Gem::Requirement
|
40
|
+
requirement: &70212265938860 !ruby/object:Gem::Requirement
|
51
41
|
none: false
|
52
42
|
requirements:
|
53
43
|
- - ~>
|
@@ -55,15 +45,10 @@ dependencies:
|
|
55
45
|
version: '0.8'
|
56
46
|
type: :runtime
|
57
47
|
prerelease: false
|
58
|
-
version_requirements:
|
59
|
-
none: false
|
60
|
-
requirements:
|
61
|
-
- - ~>
|
62
|
-
- !ruby/object:Gem::Version
|
63
|
-
version: '0.8'
|
48
|
+
version_requirements: *70212265938860
|
64
49
|
- !ruby/object:Gem::Dependency
|
65
50
|
name: hashie
|
66
|
-
requirement: !ruby/object:Gem::Requirement
|
51
|
+
requirement: &70212265938080 !ruby/object:Gem::Requirement
|
67
52
|
none: false
|
68
53
|
requirements:
|
69
54
|
- - ~>
|
@@ -71,15 +56,10 @@ dependencies:
|
|
71
56
|
version: '1.2'
|
72
57
|
type: :runtime
|
73
58
|
prerelease: false
|
74
|
-
version_requirements:
|
75
|
-
none: false
|
76
|
-
requirements:
|
77
|
-
- - ~>
|
78
|
-
- !ruby/object:Gem::Version
|
79
|
-
version: '1.2'
|
59
|
+
version_requirements: *70212265938080
|
80
60
|
- !ruby/object:Gem::Dependency
|
81
61
|
name: multi_json
|
82
|
-
requirement: !ruby/object:Gem::Requirement
|
62
|
+
requirement: &70212265937340 !ruby/object:Gem::Requirement
|
83
63
|
none: false
|
84
64
|
requirements:
|
85
65
|
- - ~>
|
@@ -87,15 +67,10 @@ dependencies:
|
|
87
67
|
version: '1.3'
|
88
68
|
type: :runtime
|
89
69
|
prerelease: false
|
90
|
-
version_requirements:
|
91
|
-
none: false
|
92
|
-
requirements:
|
93
|
-
- - ~>
|
94
|
-
- !ruby/object:Gem::Version
|
95
|
-
version: '1.3'
|
70
|
+
version_requirements: *70212265937340
|
96
71
|
- !ruby/object:Gem::Dependency
|
97
72
|
name: json
|
98
|
-
requirement: !ruby/object:Gem::Requirement
|
73
|
+
requirement: &70212265936780 !ruby/object:Gem::Requirement
|
99
74
|
none: false
|
100
75
|
requirements:
|
101
76
|
- - ! '>='
|
@@ -103,15 +78,10 @@ dependencies:
|
|
103
78
|
version: '0'
|
104
79
|
type: :development
|
105
80
|
prerelease: false
|
106
|
-
version_requirements:
|
107
|
-
none: false
|
108
|
-
requirements:
|
109
|
-
- - ! '>='
|
110
|
-
- !ruby/object:Gem::Version
|
111
|
-
version: '0'
|
81
|
+
version_requirements: *70212265936780
|
112
82
|
- !ruby/object:Gem::Dependency
|
113
83
|
name: maruku
|
114
|
-
requirement: !ruby/object:Gem::Requirement
|
84
|
+
requirement: &70212265936040 !ruby/object:Gem::Requirement
|
115
85
|
none: false
|
116
86
|
requirements:
|
117
87
|
- - ! '>='
|
@@ -119,15 +89,10 @@ dependencies:
|
|
119
89
|
version: '0'
|
120
90
|
type: :development
|
121
91
|
prerelease: false
|
122
|
-
version_requirements:
|
123
|
-
none: false
|
124
|
-
requirements:
|
125
|
-
- - ! '>='
|
126
|
-
- !ruby/object:Gem::Version
|
127
|
-
version: '0'
|
92
|
+
version_requirements: *70212265936040
|
128
93
|
- !ruby/object:Gem::Dependency
|
129
94
|
name: rake
|
130
|
-
requirement: !ruby/object:Gem::Requirement
|
95
|
+
requirement: &70212265935540 !ruby/object:Gem::Requirement
|
131
96
|
none: false
|
132
97
|
requirements:
|
133
98
|
- - ! '>='
|
@@ -135,15 +100,10 @@ dependencies:
|
|
135
100
|
version: '0'
|
136
101
|
type: :development
|
137
102
|
prerelease: false
|
138
|
-
version_requirements:
|
139
|
-
none: false
|
140
|
-
requirements:
|
141
|
-
- - ! '>='
|
142
|
-
- !ruby/object:Gem::Version
|
143
|
-
version: '0'
|
103
|
+
version_requirements: *70212265935540
|
144
104
|
- !ruby/object:Gem::Dependency
|
145
105
|
name: rspec
|
146
|
-
requirement: !ruby/object:Gem::Requirement
|
106
|
+
requirement: &70212265935120 !ruby/object:Gem::Requirement
|
147
107
|
none: false
|
148
108
|
requirements:
|
149
109
|
- - ! '>='
|
@@ -151,15 +111,10 @@ dependencies:
|
|
151
111
|
version: '0'
|
152
112
|
type: :development
|
153
113
|
prerelease: false
|
154
|
-
version_requirements:
|
155
|
-
none: false
|
156
|
-
requirements:
|
157
|
-
- - ! '>='
|
158
|
-
- !ruby/object:Gem::Version
|
159
|
-
version: '0'
|
114
|
+
version_requirements: *70212265935120
|
160
115
|
- !ruby/object:Gem::Dependency
|
161
116
|
name: simplecov
|
162
|
-
requirement: !ruby/object:Gem::Requirement
|
117
|
+
requirement: &70212265934680 !ruby/object:Gem::Requirement
|
163
118
|
none: false
|
164
119
|
requirements:
|
165
120
|
- - ! '>='
|
@@ -167,15 +122,10 @@ dependencies:
|
|
167
122
|
version: '0'
|
168
123
|
type: :development
|
169
124
|
prerelease: false
|
170
|
-
version_requirements:
|
171
|
-
none: false
|
172
|
-
requirements:
|
173
|
-
- - ! '>='
|
174
|
-
- !ruby/object:Gem::Version
|
175
|
-
version: '0'
|
125
|
+
version_requirements: *70212265934680
|
176
126
|
- !ruby/object:Gem::Dependency
|
177
127
|
name: webmock
|
178
|
-
requirement: !ruby/object:Gem::Requirement
|
128
|
+
requirement: &70212265934040 !ruby/object:Gem::Requirement
|
179
129
|
none: false
|
180
130
|
requirements:
|
181
131
|
- - ! '>='
|
@@ -183,15 +133,10 @@ dependencies:
|
|
183
133
|
version: '0'
|
184
134
|
type: :development
|
185
135
|
prerelease: false
|
186
|
-
version_requirements:
|
187
|
-
none: false
|
188
|
-
requirements:
|
189
|
-
- - ! '>='
|
190
|
-
- !ruby/object:Gem::Version
|
191
|
-
version: '0'
|
136
|
+
version_requirements: *70212265934040
|
192
137
|
- !ruby/object:Gem::Dependency
|
193
138
|
name: yard
|
194
|
-
requirement: !ruby/object:Gem::Requirement
|
139
|
+
requirement: &70212265960620 !ruby/object:Gem::Requirement
|
195
140
|
none: false
|
196
141
|
requirements:
|
197
142
|
- - ! '>='
|
@@ -199,12 +144,7 @@ dependencies:
|
|
199
144
|
version: '0'
|
200
145
|
type: :development
|
201
146
|
prerelease: false
|
202
|
-
version_requirements:
|
203
|
-
none: false
|
204
|
-
requirements:
|
205
|
-
- - ! '>='
|
206
|
-
- !ruby/object:Gem::Version
|
207
|
-
version: '0'
|
147
|
+
version_requirements: *70212265960620
|
208
148
|
description: Simple wrapper for the GitHub API (v2 and v3)
|
209
149
|
email:
|
210
150
|
- wynn.netherland@gmail.com
|
@@ -355,7 +295,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
355
295
|
version: 1.3.6
|
356
296
|
requirements: []
|
357
297
|
rubyforge_project:
|
358
|
-
rubygems_version: 1.8.
|
298
|
+
rubygems_version: 1.8.10
|
359
299
|
signing_key:
|
360
300
|
specification_version: 3
|
361
301
|
summary: Wrapper for the GitHub API
|