yt 0.25.16 → 0.25.17

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 57f9c2d75847b4137201f2c9355c185ec00c69af
4
- data.tar.gz: 5cc9fc386bbaaaa90732f8e76a4de3648280b4b7
3
+ metadata.gz: 4740a6f0d76647ecc9d2fc04ed46fb6386a5c31d
4
+ data.tar.gz: f2b37bb5f0b81f4bd597079d75342d35d665871e
5
5
  SHA512:
6
- metadata.gz: 2f003be68c2877096fec9d440d184ff263f89dd7043da1d974d51d079f9997846c9a2eb90a5490f46a914f843a54957633546ec96b36388a4f940f979325793b
7
- data.tar.gz: c8a10b2f29d6a065007fa925fe0a96ade022f1f236c0bfb35b530ea7dcf8778d64e3b8aa6b899be7dc867183f199710c6c54aa0e66048fd6641fee8b4fa09880
6
+ metadata.gz: eba0b93123998b7a17377f6f3353c00da95ac0c8738d5f8319ae04fa74d1a6b54ad7fcae361dc893fe2c7537a298311859105a8cc08ba8ec89e250e6010610df
7
+ data.tar.gz: 87e76462320bedeee2e77d82071cad3c40ff0793963805797561e24737018f416f74b6f75fd5fe795cf8b9ebff42ad71eee1ac8851e0f58906d0b0afd988d676
@@ -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
@@ -1,4 +1,4 @@
1
- Copyright 2014 Fullscreen, Inc.
1
+ Copyright 2014-2016 Fullscreen, Inc.
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the
@@ -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
@@ -209,6 +209,7 @@ module Yt
209
209
  Errno::EHOSTUNREACH,
210
210
  Errno::ENETUNREACH,
211
211
  Errno::ECONNRESET,
212
+ Net::OpenTimeout,
212
213
  Net::HTTPServerError
213
214
  ] + extra_server_errors
214
215
  end
@@ -1,3 +1,3 @@
1
1
  module Yt
2
- VERSION = '0.25.16'
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.16
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: 2015-12-19 00:00:00.000000000 Z
11
+ date: 2016-01-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport