octokit 1.2.0 → 1.2.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -21,6 +21,16 @@ module Octokit
21
21
  get("/users/#{user}/events", options, 3)
22
22
  end
23
23
 
24
+ # List events that a user has received
25
+ #
26
+ # @return [Array] A list of all user received events
27
+ # @see http://developer.github.com/v3/received_events
28
+ # @example List all user received events
29
+ # Octokit.received_events("sferik")
30
+ def received_events(user, options={})
31
+ get("/users/#{user}/received_events", options, 3)
32
+ end
33
+
24
34
  # List events for a repository
25
35
  #
26
36
  # @param repo [String, Repository, Hash] A GitHub repository
@@ -55,11 +55,11 @@ module Octokit
55
55
  alias :create :create_repository
56
56
 
57
57
  def set_private(repo, options={})
58
- update_repository repo, options.merge({ :public => false })
58
+ update_repository repo, options.merge({ :private => true })
59
59
  end
60
60
 
61
61
  def set_public(repo, options={})
62
- update_repository repo, options.merge({ :public => true })
62
+ update_repository repo, options.merge({ :private => false })
63
63
  end
64
64
 
65
65
  def deploy_keys(repo, options={})
@@ -1,3 +1,3 @@
1
1
  module Octokit
2
- VERSION = "1.2.0".freeze unless defined?(Octokit::VERSION)
2
+ VERSION = "1.2.1" unless defined?(Octokit::VERSION)
3
3
  end
@@ -15,7 +15,7 @@ Gem::Specification.new do |gem|
15
15
  gem.add_development_dependency 'webmock'
16
16
  gem.add_development_dependency 'yard'
17
17
  gem.authors = ["Wynn Netherland", "Adam Stacoviak", "Erik Michaels-Ober"]
18
- gem.description = %q{Simple wrapper for the GitHub API (v2 and v3)}
18
+ gem.description = %q{Simple wrapper for the GitHub v3 API}
19
19
  gem.email = ['wynn.netherland@gmail.com', 'adam@stacoviak.com', 'sferik@gmail.com']
20
20
  gem.files = `git ls-files`.split("\n")
21
21
  gem.homepage = 'https://github.com/pengwynn/octokit'
@@ -23,7 +23,7 @@ Gem::Specification.new do |gem|
23
23
  gem.platform = Gem::Platform::RUBY
24
24
  gem.require_paths = ['lib']
25
25
  gem.required_rubygems_version = Gem::Requirement.new('>= 1.3.6')
26
- gem.summary = %q{Wrapper for the GitHub API}
26
+ gem.summary = gem.description
27
27
  gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
28
- gem.version = Octokit::VERSION.dup
28
+ gem.version = Octokit::VERSION
29
29
  end
@@ -14,7 +14,7 @@ describe Octokit::Client::Events do
14
14
  public_events.first.id.should == '1513284759'
15
15
  end
16
16
  end
17
-
17
+
18
18
  describe ".user_events" do
19
19
  it "should return all user events" do
20
20
  stub_get("/users/sferik/events").
@@ -24,6 +24,15 @@ describe Octokit::Client::Events do
24
24
  end
25
25
  end
26
26
 
27
+ describe ".received_events" do
28
+ it "should return all user received events" do
29
+ stub_get("/users/sferik/received_events").
30
+ to_return(:body => fixture("v3/user_events.json"))
31
+ received_events = @client.received_events('sferik')
32
+ received_events.first.type.should == 'PushEvent'
33
+ end
34
+ end
35
+
27
36
  describe ".repository_events" do
28
37
  it "should return events for a repository" do
29
38
  stub_get("/repos/sferik/rails_admin/events").
@@ -124,7 +124,7 @@ describe Octokit::Client::Repositories do
124
124
 
125
125
  it "should set a repository private" do
126
126
  stub_patch("/repos/sferik/rails_admin").
127
- with({ :name => "rails_admin", :public => false }).
127
+ with({ :name => "rails_admin", :private => false }).
128
128
  to_return(:body => fixture("v3/repository.json"))
129
129
  repository = @client.set_private("sferik/rails_admin")
130
130
  repository.name.should == "rails_admin"
@@ -136,10 +136,11 @@ describe Octokit::Client::Repositories do
136
136
 
137
137
  it "should set a repository public" do
138
138
  stub_patch("/repos/sferik/rails_admin").
139
- with({ :name => "rails_admin", :public => false }).
139
+ with({ :name => "rails_admin", :private => true }).
140
140
  to_return(:body => fixture("v3/repository.json"))
141
141
  repository = @client.set_public("sferik/rails_admin")
142
142
  repository.name.should == "rails_admin"
143
+ repository.private.should == false
143
144
  end
144
145
 
145
146
  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.2.0
4
+ version: 1.2.1
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-18 00:00:00.000000000 Z
14
+ date: 2012-05-20 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: addressable
18
- requirement: &70343270586900 !ruby/object:Gem::Requirement
18
+ requirement: !ruby/object:Gem::Requirement
19
19
  none: false
20
20
  requirements:
21
21
  - - ~>
@@ -23,10 +23,15 @@ dependencies:
23
23
  version: '2.2'
24
24
  type: :runtime
25
25
  prerelease: false
26
- version_requirements: *70343270586900
26
+ version_requirements: !ruby/object:Gem::Requirement
27
+ none: false
28
+ requirements:
29
+ - - ~>
30
+ - !ruby/object:Gem::Version
31
+ version: '2.2'
27
32
  - !ruby/object:Gem::Dependency
28
33
  name: faraday
29
- requirement: &70343270582840 !ruby/object:Gem::Requirement
34
+ requirement: !ruby/object:Gem::Requirement
30
35
  none: false
31
36
  requirements:
32
37
  - - ~>
@@ -34,10 +39,15 @@ dependencies:
34
39
  version: '0.8'
35
40
  type: :runtime
36
41
  prerelease: false
37
- version_requirements: *70343270582840
42
+ version_requirements: !ruby/object:Gem::Requirement
43
+ none: false
44
+ requirements:
45
+ - - ~>
46
+ - !ruby/object:Gem::Version
47
+ version: '0.8'
38
48
  - !ruby/object:Gem::Dependency
39
49
  name: faraday_middleware
40
- requirement: &70343270581080 !ruby/object:Gem::Requirement
50
+ requirement: !ruby/object:Gem::Requirement
41
51
  none: false
42
52
  requirements:
43
53
  - - ~>
@@ -45,10 +55,15 @@ dependencies:
45
55
  version: '0.8'
46
56
  type: :runtime
47
57
  prerelease: false
48
- version_requirements: *70343270581080
58
+ version_requirements: !ruby/object:Gem::Requirement
59
+ none: false
60
+ requirements:
61
+ - - ~>
62
+ - !ruby/object:Gem::Version
63
+ version: '0.8'
49
64
  - !ruby/object:Gem::Dependency
50
65
  name: hashie
51
- requirement: &70343270576360 !ruby/object:Gem::Requirement
66
+ requirement: !ruby/object:Gem::Requirement
52
67
  none: false
53
68
  requirements:
54
69
  - - ~>
@@ -56,10 +71,15 @@ dependencies:
56
71
  version: '1.2'
57
72
  type: :runtime
58
73
  prerelease: false
59
- version_requirements: *70343270576360
74
+ version_requirements: !ruby/object:Gem::Requirement
75
+ none: false
76
+ requirements:
77
+ - - ~>
78
+ - !ruby/object:Gem::Version
79
+ version: '1.2'
60
80
  - !ruby/object:Gem::Dependency
61
81
  name: multi_json
62
- requirement: &70343270575460 !ruby/object:Gem::Requirement
82
+ requirement: !ruby/object:Gem::Requirement
63
83
  none: false
64
84
  requirements:
65
85
  - - ~>
@@ -67,10 +87,15 @@ dependencies:
67
87
  version: '1.3'
68
88
  type: :runtime
69
89
  prerelease: false
70
- version_requirements: *70343270575460
90
+ version_requirements: !ruby/object:Gem::Requirement
91
+ none: false
92
+ requirements:
93
+ - - ~>
94
+ - !ruby/object:Gem::Version
95
+ version: '1.3'
71
96
  - !ruby/object:Gem::Dependency
72
97
  name: json
73
- requirement: &70343270574580 !ruby/object:Gem::Requirement
98
+ requirement: !ruby/object:Gem::Requirement
74
99
  none: false
75
100
  requirements:
76
101
  - - ! '>='
@@ -78,10 +103,15 @@ dependencies:
78
103
  version: '0'
79
104
  type: :development
80
105
  prerelease: false
81
- version_requirements: *70343270574580
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ none: false
108
+ requirements:
109
+ - - ! '>='
110
+ - !ruby/object:Gem::Version
111
+ version: '0'
82
112
  - !ruby/object:Gem::Dependency
83
113
  name: maruku
84
- requirement: &70343270573360 !ruby/object:Gem::Requirement
114
+ requirement: !ruby/object:Gem::Requirement
85
115
  none: false
86
116
  requirements:
87
117
  - - ! '>='
@@ -89,10 +119,15 @@ dependencies:
89
119
  version: '0'
90
120
  type: :development
91
121
  prerelease: false
92
- version_requirements: *70343270573360
122
+ version_requirements: !ruby/object:Gem::Requirement
123
+ none: false
124
+ requirements:
125
+ - - ! '>='
126
+ - !ruby/object:Gem::Version
127
+ version: '0'
93
128
  - !ruby/object:Gem::Dependency
94
129
  name: rake
95
- requirement: &70343270572520 !ruby/object:Gem::Requirement
130
+ requirement: !ruby/object:Gem::Requirement
96
131
  none: false
97
132
  requirements:
98
133
  - - ! '>='
@@ -100,10 +135,15 @@ dependencies:
100
135
  version: '0'
101
136
  type: :development
102
137
  prerelease: false
103
- version_requirements: *70343270572520
138
+ version_requirements: !ruby/object:Gem::Requirement
139
+ none: false
140
+ requirements:
141
+ - - ! '>='
142
+ - !ruby/object:Gem::Version
143
+ version: '0'
104
144
  - !ruby/object:Gem::Dependency
105
145
  name: rspec
106
- requirement: &70343270571320 !ruby/object:Gem::Requirement
146
+ requirement: !ruby/object:Gem::Requirement
107
147
  none: false
108
148
  requirements:
109
149
  - - ! '>='
@@ -111,10 +151,15 @@ dependencies:
111
151
  version: '0'
112
152
  type: :development
113
153
  prerelease: false
114
- version_requirements: *70343270571320
154
+ version_requirements: !ruby/object:Gem::Requirement
155
+ none: false
156
+ requirements:
157
+ - - ! '>='
158
+ - !ruby/object:Gem::Version
159
+ version: '0'
115
160
  - !ruby/object:Gem::Dependency
116
161
  name: simplecov
117
- requirement: &70343270570860 !ruby/object:Gem::Requirement
162
+ requirement: !ruby/object:Gem::Requirement
118
163
  none: false
119
164
  requirements:
120
165
  - - ! '>='
@@ -122,10 +167,15 @@ dependencies:
122
167
  version: '0'
123
168
  type: :development
124
169
  prerelease: false
125
- version_requirements: *70343270570860
170
+ version_requirements: !ruby/object:Gem::Requirement
171
+ none: false
172
+ requirements:
173
+ - - ! '>='
174
+ - !ruby/object:Gem::Version
175
+ version: '0'
126
176
  - !ruby/object:Gem::Dependency
127
177
  name: webmock
128
- requirement: &70343270570060 !ruby/object:Gem::Requirement
178
+ requirement: !ruby/object:Gem::Requirement
129
179
  none: false
130
180
  requirements:
131
181
  - - ! '>='
@@ -133,10 +183,15 @@ dependencies:
133
183
  version: '0'
134
184
  type: :development
135
185
  prerelease: false
136
- version_requirements: *70343270570060
186
+ version_requirements: !ruby/object:Gem::Requirement
187
+ none: false
188
+ requirements:
189
+ - - ! '>='
190
+ - !ruby/object:Gem::Version
191
+ version: '0'
137
192
  - !ruby/object:Gem::Dependency
138
193
  name: yard
139
- requirement: &70343270569180 !ruby/object:Gem::Requirement
194
+ requirement: !ruby/object:Gem::Requirement
140
195
  none: false
141
196
  requirements:
142
197
  - - ! '>='
@@ -144,8 +199,13 @@ dependencies:
144
199
  version: '0'
145
200
  type: :development
146
201
  prerelease: false
147
- version_requirements: *70343270569180
148
- description: Simple wrapper for the GitHub API (v2 and v3)
202
+ version_requirements: !ruby/object:Gem::Requirement
203
+ none: false
204
+ requirements:
205
+ - - ! '>='
206
+ - !ruby/object:Gem::Version
207
+ version: '0'
208
+ description: Simple wrapper for the GitHub v3 API
149
209
  email:
150
210
  - wynn.netherland@gmail.com
151
211
  - adam@stacoviak.com
@@ -305,10 +365,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
305
365
  version: 1.3.6
306
366
  requirements: []
307
367
  rubyforge_project:
308
- rubygems_version: 1.8.10
368
+ rubygems_version: 1.8.24
309
369
  signing_key:
310
370
  specification_version: 3
311
- summary: Wrapper for the GitHub API
371
+ summary: Simple wrapper for the GitHub v3 API
312
372
  test_files:
313
373
  - spec/faraday/response_spec.rb
314
374
  - spec/fixtures/timeline.json