yt 0.25.16 → 0.25.17
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/MIT-LICENSE +1 -1
- data/lib/yt/models/content_owner.rb +10 -1
- data/lib/yt/request.rb +1 -0
- data/lib/yt/version.rb +2 -2
- data/spec/requests/as_content_owner/content_owner_spec.rb +38 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4740a6f0d76647ecc9d2fc04ed46fb6386a5c31d
|
4
|
+
data.tar.gz: f2b37bb5f0b81f4bd597079d75342d35d665871e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: eba0b93123998b7a17377f6f3353c00da95ac0c8738d5f8319ae04fa74d1a6b54ad7fcae361dc893fe2c7537a298311859105a8cc08ba8ec89e250e6010610df
|
7
|
+
data.tar.gz: 87e76462320bedeee2e77d82071cad3c40ff0793963805797561e24737018f416f74b6f75fd5fe795cf8b9ebff42ad71eee1ac8851e0f58906d0b0afd988d676
|
data/CHANGELOG.md
CHANGED
@@ -6,6 +6,10 @@ For more information about changelogs, check
|
|
6
6
|
[Keep a Changelog](http://keepachangelog.com) and
|
7
7
|
[Vandamme](http://tech-angels.github.io/vandamme).
|
8
8
|
|
9
|
+
## 0.25.17 - 2016-01-05
|
10
|
+
|
11
|
+
* [FEATURE] Add `:videos` to Yt::ContentOwner to list videos in network with a content owner
|
12
|
+
|
9
13
|
## 0.25.16 - 2015-12-19
|
10
14
|
|
11
15
|
* [FEATURE] Add `access_token_was_refreshed` to Yt::Account
|
data/MIT-LICENSE
CHANGED
@@ -47,6 +47,15 @@ module Yt
|
|
47
47
|
def create_claim(params = {})
|
48
48
|
claims.insert params
|
49
49
|
end
|
50
|
+
|
51
|
+
### PRIVATE API ###
|
52
|
+
|
53
|
+
# @private
|
54
|
+
# Tells `has_many :videos` that account.videos should return all the
|
55
|
+
# videos *on behalf of* the content owner (public, private, unlisted).
|
56
|
+
def videos_params
|
57
|
+
{for_content_owner: true, on_behalf_of_content_owner: @owner_name}
|
58
|
+
end
|
50
59
|
end
|
51
60
|
end
|
52
|
-
end
|
61
|
+
end
|
data/lib/yt/request.rb
CHANGED
data/lib/yt/version.rb
CHANGED
@@ -1,3 +1,3 @@
|
|
1
1
|
module Yt
|
2
|
-
VERSION = '0.25.
|
3
|
-
end
|
2
|
+
VERSION = '0.25.17'
|
3
|
+
end
|
@@ -14,6 +14,44 @@ describe Yt::ContentOwner, :partner do
|
|
14
14
|
end
|
15
15
|
end
|
16
16
|
|
17
|
+
describe '.videos' do
|
18
|
+
let(:video) { $content_owner.videos.where(order: 'viewCount').first }
|
19
|
+
|
20
|
+
specify 'returns the videos in network with the content owner with their tags and category ID' do
|
21
|
+
expect(video).to be_a Yt::Video
|
22
|
+
expect(video.tags).not_to be_empty
|
23
|
+
expect(video.category_id).not_to be_nil
|
24
|
+
end
|
25
|
+
|
26
|
+
describe '.includes(:snippet)' do
|
27
|
+
let(:video) { $content_owner.videos.includes(:snippet).first }
|
28
|
+
|
29
|
+
specify 'eager-loads the *full* snippet of each video' do
|
30
|
+
expect(video.instance_variable_defined? :@snippet).to be true
|
31
|
+
expect(video.channel_title).to be
|
32
|
+
expect(video.snippet).to be_complete
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
describe '.includes(:statistics, :status)' do
|
37
|
+
let(:video) { $content_owner.videos.includes(:statistics, :status).first }
|
38
|
+
|
39
|
+
specify 'eager-loads the statistics and status of each video' do
|
40
|
+
expect(video.instance_variable_defined? :@statistics_set).to be true
|
41
|
+
expect(video.instance_variable_defined? :@status).to be true
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
describe '.includes(:content_details)' do
|
46
|
+
let(:video) { $content_owner.videos.includes(:content_details).first }
|
47
|
+
|
48
|
+
specify 'eager-loads the statistics of each video' do
|
49
|
+
expect(video.instance_variable_defined? :@content_detail).to be true
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
|
17
55
|
describe 'claims' do
|
18
56
|
let(:asset_id) { ENV['YT_TEST_PARTNER_ASSET_ID'] }
|
19
57
|
let(:video_id) { ENV['YT_TEST_PARTNER_CLAIMABLE_VIDEO_ID'] }
|
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.25.
|
4
|
+
version: 0.25.17
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Claudio Baccigalupo
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-01-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|