yt 0.24.3 → 0.24.4
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/README.md +1 -1
- data/lib/yt/collections/reports.rb +2 -0
- data/lib/yt/version.rb +1 -1
- data/spec/requests/as_content_owner/channel_spec.rb +21 -1
- data/spec/requests/as_content_owner/video_spec.rb +15 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 13f722082a0563925b7f9d95ece5ff723fd96b7d
|
4
|
+
data.tar.gz: 0cf90eda3d4d1170a0b6c618c193f864af9c3b89
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 34b643c9657ad003fefcba80cd3bc7ec286813f323f6d947854b704f413f161093b031c8113aa93fd63f1fc4caa264897cbeca4cf950c7c7bdab5b50dd03e335
|
7
|
+
data.tar.gz: ae540eff03ac2222382408bb910c9bb10abfffbac6ef3b5cb524483f947c21ca8631a5acd41e9f275f9967fb6c1421166d0253b65f80a78cddce04ac5e7a0a49
|
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.24.4 - 2015-06-05
|
10
|
+
|
11
|
+
* [ENHANCEMENT] When grouping by traffic source, country, state or playback location, return results sorted by descending views
|
12
|
+
|
9
13
|
## 0.24.3 - 2015-06-05
|
10
14
|
|
11
15
|
* [ENHANCEMENT] Add newly available traffic sources
|
data/README.md
CHANGED
@@ -41,7 +41,7 @@ To install on your system, run
|
|
41
41
|
|
42
42
|
To use inside a bundled Ruby project, add this line to the Gemfile:
|
43
43
|
|
44
|
-
gem 'yt', '~> 0.24.
|
44
|
+
gem 'yt', '~> 0.24.4'
|
45
45
|
|
46
46
|
Since the gem follows [Semantic Versioning](http://semver.org),
|
47
47
|
indicating the full version in your Gemfile (~> *major*.*minor*.*patch*)
|
@@ -76,6 +76,8 @@ module Yt
|
|
76
76
|
end
|
77
77
|
if dimension == :month
|
78
78
|
hash = hash.transform_values{|h| h.sort_by{|range, v| range.first}.to_h}
|
79
|
+
elsif dimension.in? [:traffic_source, :country, :state, :playback_location]
|
80
|
+
hash = hash.transform_values{|h| h.sort_by{|range, v| -v}.to_h}
|
79
81
|
end
|
80
82
|
(@metrics.one? || @metrics.keys == [:earnings, :estimated_minutes_watched]) ? hash[@metrics.keys.first] : hash
|
81
83
|
end
|
data/lib/yt/version.rb
CHANGED
@@ -302,6 +302,11 @@ describe Yt::Channel, :partner do
|
|
302
302
|
views = channel.views range.merge by: :traffic_source
|
303
303
|
expect(views.keys - keys).to be_empty
|
304
304
|
end
|
305
|
+
|
306
|
+
specify 'and are returned sorted by descending views' do
|
307
|
+
views = channel.views range.merge by: :traffic_source
|
308
|
+
expect(views.values.sort.reverse).to eq views.values
|
309
|
+
end
|
305
310
|
end
|
306
311
|
|
307
312
|
describe 'views can be grouped by playback location' do
|
@@ -312,6 +317,11 @@ describe Yt::Channel, :partner do
|
|
312
317
|
views = channel.views range.merge by: :playback_location
|
313
318
|
expect(views.keys - keys).to be_empty
|
314
319
|
end
|
320
|
+
|
321
|
+
specify 'and are returned sorted by descending views' do
|
322
|
+
views = channel.views range.merge by: :playback_location
|
323
|
+
expect(views.values.sort.reverse).to eq views.values
|
324
|
+
end
|
315
325
|
end
|
316
326
|
|
317
327
|
describe 'views can be grouped by embedded player location' do
|
@@ -405,6 +415,11 @@ describe Yt::Channel, :partner do
|
|
405
415
|
expect(views.keys.map(&:length).uniq).to eq [2]
|
406
416
|
expect(views.values).to all(be_an Integer)
|
407
417
|
end
|
418
|
+
|
419
|
+
specify 'and are returned sorted by descending views' do
|
420
|
+
views = channel.views range.merge by: :country
|
421
|
+
expect(views.values.sort.reverse).to eq views.values
|
422
|
+
end
|
408
423
|
end
|
409
424
|
|
410
425
|
describe 'views can be grouped by state' do
|
@@ -416,6 +431,11 @@ describe Yt::Channel, :partner do
|
|
416
431
|
expect(views.keys.map(&:length).uniq).to eq [2]
|
417
432
|
expect(views.values).to all(be_an Integer)
|
418
433
|
end
|
434
|
+
|
435
|
+
specify 'and are returned sorted by descending views' do
|
436
|
+
views = channel.views range.merge by: :state
|
437
|
+
expect(views.values.sort.reverse).to eq views.values
|
438
|
+
end
|
419
439
|
end
|
420
440
|
|
421
441
|
describe 'uniques can be retrieved for a single country' do
|
@@ -1637,7 +1657,7 @@ describe Yt::Channel, :partner do
|
|
1637
1657
|
describe 'annotation close rate can be retrieved for a single US state' do
|
1638
1658
|
let(:state_code) { 'NY' }
|
1639
1659
|
let(:result) { channel.annotation_close_rate since: date, by: by, in: location }
|
1640
|
-
let(:date) {
|
1660
|
+
let(:date) { ENV['YT_TEST_PARTNER_VIDEO_DATE'] }
|
1641
1661
|
|
1642
1662
|
context 'and grouped by day' do
|
1643
1663
|
let(:by) { :day }
|
@@ -300,6 +300,11 @@ describe Yt::Video, :partner do
|
|
300
300
|
views = video.views range.merge by: :traffic_source
|
301
301
|
expect(views.keys - keys).to be_empty
|
302
302
|
end
|
303
|
+
|
304
|
+
specify 'and are returned sorted by descending views' do
|
305
|
+
views = video.views range.merge by: :traffic_source
|
306
|
+
expect(views.values.sort.reverse).to eq views.values
|
307
|
+
end
|
303
308
|
end
|
304
309
|
|
305
310
|
describe 'views can be grouped by playback location' do
|
@@ -367,6 +372,11 @@ describe Yt::Video, :partner do
|
|
367
372
|
expect(views.keys.map(&:length).uniq).to eq [2]
|
368
373
|
expect(views.values).to all(be_an Integer)
|
369
374
|
end
|
375
|
+
|
376
|
+
specify 'and are returned sorted by descending views' do
|
377
|
+
views = video.views range.merge by: :country
|
378
|
+
expect(views.values.sort.reverse).to eq views.values
|
379
|
+
end
|
370
380
|
end
|
371
381
|
|
372
382
|
describe 'views can be grouped by state' do
|
@@ -378,6 +388,11 @@ describe Yt::Video, :partner do
|
|
378
388
|
expect(views.keys.map(&:length).uniq).to eq [2]
|
379
389
|
expect(views.values).to all(be_an Integer)
|
380
390
|
end
|
391
|
+
|
392
|
+
specify 'and are returned sorted by descending views' do
|
393
|
+
views = video.views range.merge by: :state
|
394
|
+
expect(views.values.sort.reverse).to eq views.values
|
395
|
+
end
|
381
396
|
end
|
382
397
|
|
383
398
|
describe 'uniques can be retrieved for a single US state' do
|