yt 0.11.6 → 0.12.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +35 -0
- data/README.md +13 -2
- data/lib/yt/actions/list.rb +11 -1
- data/lib/yt/associations/has_attribute.rb +51 -0
- data/lib/yt/associations/has_many.rb +0 -15
- data/lib/yt/collections/content_owners.rb +0 -4
- data/lib/yt/collections/playlist_items.rb +1 -1
- data/lib/yt/collections/resources.rb +1 -1
- data/lib/yt/collections/subscribed_channels.rb +46 -0
- data/lib/yt/collections/subscribers.rb +33 -0
- data/lib/yt/collections/subscriptions.rb +0 -23
- data/lib/yt/models/account.rb +6 -1
- data/lib/yt/models/annotation.rb +4 -10
- data/lib/yt/models/asset.rb +3 -10
- data/lib/yt/models/base.rb +2 -0
- data/lib/yt/models/channel.rb +53 -25
- data/lib/yt/models/claim.rb +13 -25
- data/lib/yt/models/content_detail.rb +9 -11
- data/lib/yt/models/content_owner_detail.rb +2 -8
- data/lib/yt/models/device_flow.rb +3 -11
- data/lib/yt/models/live_streaming_detail.rb +5 -25
- data/lib/yt/models/ownership.rb +8 -8
- data/lib/yt/models/playlist.rb +14 -10
- data/lib/yt/models/playlist_item.rb +13 -0
- data/lib/yt/models/policy.rb +10 -14
- data/lib/yt/models/policy_rule.rb +15 -21
- data/lib/yt/models/reference.rb +13 -37
- data/lib/yt/models/right_owner.rb +6 -17
- data/lib/yt/models/snippet.rb +19 -33
- data/lib/yt/models/statistics_set.rb +9 -23
- data/lib/yt/models/status.rb +20 -25
- data/lib/yt/models/subscription.rb +2 -8
- data/lib/yt/models/user_info.rb +11 -33
- data/lib/yt/version.rb +1 -1
- data/spec/collections/subscriptions_spec.rb +0 -7
- data/spec/errors/forbidden_spec.rb +10 -0
- data/spec/errors/server_error_spec.rb +10 -0
- data/spec/models/subscription_spec.rb +0 -9
- data/spec/requests/as_account/account_spec.rb +8 -0
- data/spec/requests/as_account/channel_spec.rb +40 -6
- data/spec/requests/as_account/playlist_item_spec.rb +26 -0
- data/spec/requests/as_account/playlist_spec.rb +1 -0
- data/spec/requests/as_server_app/channel_spec.rb +9 -0
- metadata +9 -2
@@ -134,6 +134,7 @@ describe Yt::Playlist, :device_app do
|
|
134
134
|
it { expect{playlist.add_video video_id}.to change{playlist.playlist_items.count}.by(1) }
|
135
135
|
it { expect(playlist.add_video! video_id).to be_a Yt::PlaylistItem }
|
136
136
|
it { expect{playlist.add_video! video_id}.to change{playlist.playlist_items.count}.by(1) }
|
137
|
+
it { expect(playlist.add_video(video_id, position: 0).position).to be 0 }
|
137
138
|
end
|
138
139
|
|
139
140
|
describe 'can be removed' do
|
@@ -21,6 +21,15 @@ describe Yt::Channel, :server_app do
|
|
21
21
|
it { expect(channel.videos.first).to be_a Yt::Video }
|
22
22
|
it { expect(channel.playlists).to be_a Yt::Collections::Playlists }
|
23
23
|
it { expect(channel.playlists.first).to be_a Yt::Playlist }
|
24
|
+
|
25
|
+
specify 'with a public list of subscriptions' do
|
26
|
+
expect(channel.subscribed_channels.first).to be_a Yt::Channel
|
27
|
+
end
|
28
|
+
|
29
|
+
context 'with a hidden list of subscriptions' do
|
30
|
+
let(:id) { 'UCG0hw7n_v0sr8MXgb6oel6w' }
|
31
|
+
it { expect{channel.subscribed_channels.size}.to raise_error Yt::Errors::Forbidden }
|
32
|
+
end
|
24
33
|
end
|
25
34
|
|
26
35
|
context 'given an unknown channel' do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: yt
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.12.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Claudio Baccigalupo
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-09-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -124,6 +124,7 @@ files:
|
|
124
124
|
- lib/yt/actions/modify.rb
|
125
125
|
- lib/yt/actions/patch.rb
|
126
126
|
- lib/yt/actions/update.rb
|
127
|
+
- lib/yt/associations/has_attribute.rb
|
127
128
|
- lib/yt/associations/has_authentication.rb
|
128
129
|
- lib/yt/associations/has_many.rb
|
129
130
|
- lib/yt/associations/has_one.rb
|
@@ -154,6 +155,8 @@ files:
|
|
154
155
|
- lib/yt/collections/snippets.rb
|
155
156
|
- lib/yt/collections/statistics_sets.rb
|
156
157
|
- lib/yt/collections/statuses.rb
|
158
|
+
- lib/yt/collections/subscribed_channels.rb
|
159
|
+
- lib/yt/collections/subscribers.rb
|
157
160
|
- lib/yt/collections/subscriptions.rb
|
158
161
|
- lib/yt/collections/user_infos.rb
|
159
162
|
- lib/yt/collections/videos.rb
|
@@ -210,9 +213,11 @@ files:
|
|
210
213
|
- spec/collections/references_spec.rb
|
211
214
|
- spec/collections/subscriptions_spec.rb
|
212
215
|
- spec/collections/videos_spec.rb
|
216
|
+
- spec/errors/forbidden_spec.rb
|
213
217
|
- spec/errors/missing_auth_spec.rb
|
214
218
|
- spec/errors/no_items_spec.rb
|
215
219
|
- spec/errors/request_error_spec.rb
|
220
|
+
- spec/errors/server_error_spec.rb
|
216
221
|
- spec/errors/unauthorized_spec.rb
|
217
222
|
- spec/models/account_spec.rb
|
218
223
|
- spec/models/annotation_spec.rb
|
@@ -301,9 +306,11 @@ test_files:
|
|
301
306
|
- spec/collections/references_spec.rb
|
302
307
|
- spec/collections/subscriptions_spec.rb
|
303
308
|
- spec/collections/videos_spec.rb
|
309
|
+
- spec/errors/forbidden_spec.rb
|
304
310
|
- spec/errors/missing_auth_spec.rb
|
305
311
|
- spec/errors/no_items_spec.rb
|
306
312
|
- spec/errors/request_error_spec.rb
|
313
|
+
- spec/errors/server_error_spec.rb
|
307
314
|
- spec/errors/unauthorized_spec.rb
|
308
315
|
- spec/models/account_spec.rb
|
309
316
|
- spec/models/annotation_spec.rb
|