sproutvideo-rb 1.8.0 → 1.9.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8e13ddf68bf70448163cde8c0045b976926a0ed9927ce24b77fe33cd895f146f
4
- data.tar.gz: 985a727c9bc400dbe0844496648d659d03c40d44816ee67aecd0c9d088e9b1f3
3
+ metadata.gz: 47db233bcc6fd3d734a1ad76d712d7c164237262d362b19964c18e94672531b9
4
+ data.tar.gz: b97f26548146f07cde07fb06cdf24b4e0493136242315b4c5936d9926772ac0d
5
5
  SHA512:
6
- metadata.gz: b31337a738156031080f321fb5642ee55cefea66b3f1db8248d905599d88bbd0e0206e3bfa57df67960f184729ee0fa5e1187aa34b2996e9fcba6e19bfbe98ae
7
- data.tar.gz: '050186fd9d93ac3f392297e7ed3ad106126a1b99a713dddd4b135654b36324e7672383edc268ae35f56452742b2a824654ad3ae06d0382007e69f444cdab1b60'
6
+ metadata.gz: 13a29044a7761786a0fe03fab8cbb52559397b833fee87bba12fbb80adf0878726e103f2635d2165c68a3564eefb02ef7820b6d54f6b2a72579c59f168df5faa
7
+ data.tar.gz: 5628e387c711581b685a27262a4d7e8e802e348db65e1433eaa2c245ab7c3f2f99e9df7ca9fbf8cd1fb3d7b7ce0faf4824f67afb8a53b2cebc489b2f818472cb
data/README.markdown CHANGED
@@ -425,6 +425,7 @@ Check the API documentation for more information about the data returned by thes
425
425
  Each method can be called on it's own for overall account data for all time like this:
426
426
  ```ruby
427
427
  Sproutvideo::Analytics.play_counts
428
+ Sproutvideo::Analytics.download_counts
428
429
  Sproutvideo::Analytics.domains
429
430
  Sproutvideo::Analytics.geo
430
431
  Sproutvideo::Analytics.video_types
@@ -434,6 +435,7 @@ Sproutvideo::Analytics.device_types
434
435
  Each method can also take an options hash containing a :video_id for retrieving overall data for a specific video:
435
436
  ```ruby
436
437
  Sproutvideo::Analytics.play_counts(:video_id => 'abc123')
438
+ Sproutvideo::Analytics.download_counts(:video_id => 'abc123')
437
439
  Sproutvideo::Analytics.domains(:video_id => 'abc123')
438
440
  Sproutvideo::Analytics.geo(:video_id => 'abc123')
439
441
  Sproutvideo::Analytics.video_types(:video_id => 'abc123')
@@ -463,6 +465,7 @@ see api docs for more info
463
465
 
464
466
  ```ruby
465
467
  Sproutvideo::Analytics.popular_videos
468
+ SproutVideo::Analytics.popular_downloads
466
469
  ```
467
470
 
468
471
  ```ruby
@@ -5,6 +5,11 @@ module Sproutvideo
5
5
  get(url, options)
6
6
  end
7
7
 
8
+ def self.download_counts(options ={})
9
+ url = build_path("/stats/downloads", options)
10
+ get(url, options)
11
+ end
12
+
8
13
  def self.domains(options={})
9
14
  url = build_path("/stats/domains", options)
10
15
  get(url, options)
@@ -66,6 +71,10 @@ module Sproutvideo
66
71
  get("/stats/popular_videos", options)
67
72
  end
68
73
 
74
+ def self.popular_downloads(options={})
75
+ get('/stats/popular_downloads', options)
76
+ end
77
+
69
78
  def self.live_stream_overview(live_stream_id, options={})
70
79
  get("/stats/live_streams/#{live_stream_id}/overview", options)
71
80
  end
@@ -1,3 +1,3 @@
1
1
  module Sproutvideo
2
- VERSION = "1.8.0"
2
+ VERSION = "1.9.0"
3
3
  end
@@ -38,6 +38,33 @@ describe Sproutvideo::Analytics do
38
38
  end
39
39
  end
40
40
 
41
+ describe '#download_counts' do
42
+ before(:each) do
43
+ @url = "#{Sproutvideo.base_url}/stats/downloads"
44
+ end
45
+
46
+ it "should GET the correct url for overall method call and return a response" do
47
+ RestClient.should_receive(:get).with(
48
+ @url,
49
+ {'SproutVideo-Api-Key' => @api_key, :params => {}}).and_return(@msg)
50
+ Sproutvideo::Analytics.download_counts.class.should == Sproutvideo::Response
51
+ end
52
+
53
+ it 'should GET the correct url for individual video method call and return a response' do
54
+ RestClient.should_receive(:get).with(
55
+ "#{@url}/abc123",
56
+ {'SproutVideo-Api-Key' => @api_key, :params => {}}).and_return(@msg)
57
+ Sproutvideo::Analytics.download_counts(:video_id => 'abc123').class.should == Sproutvideo::Response
58
+ end
59
+
60
+ it 'should GET the correct url if dates are passed in' do
61
+ RestClient.should_receive(:get).with(
62
+ @url,
63
+ {'SproutVideo-Api-Key' => @api_key, :params => {:start_date => '2012-12-31', :end_date => '2013-12-31'}}).and_return(@msg)
64
+ Sproutvideo::Analytics.download_counts(:start_date => '2012-12-31', :end_date => '2013-12-31').class.should == Sproutvideo::Response
65
+ end
66
+ end
67
+
41
68
  describe "#domains" do
42
69
  before(:each) do
43
70
  @url = "#{Sproutvideo.base_url}/stats/domains"
@@ -271,6 +298,15 @@ describe Sproutvideo::Analytics do
271
298
  end
272
299
  end
273
300
 
301
+ describe "#popular_downloads" do
302
+ it "should GET the correct url for overall method call and return a response" do
303
+ RestClient.should_receive(:get).with(
304
+ "#{Sproutvideo.base_url}/stats/popular_downloads",
305
+ {'SproutVideo-Api-Key' => @api_key, :params => {}}).and_return(@msg)
306
+ Sproutvideo::Analytics.popular_downloads.class.should == Sproutvideo::Response
307
+ end
308
+ end
309
+
274
310
  describe "#live_stream_overview" do
275
311
  it "should GET the correct url for overall method call and return a response" do
276
312
  id = "abc123"
@@ -1,11 +1,11 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "sproutvideo-rb"
3
- s.version = "1.8.0"
3
+ s.version = "1.9.0"
4
4
 
5
5
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
6
6
  s.require_paths = ["lib"]
7
7
  s.authors = ["SproutVideo"]
8
- s.date = "2020-10-28"
8
+ s.date = "2022-07-11"
9
9
  s.description = "SproutVideo API Client"
10
10
  s.email = "support@sproutvideo.com"
11
11
  s.extra_rdoc_files = [
@@ -57,7 +57,6 @@ Gem::Specification.new do |s|
57
57
  ]
58
58
  s.homepage = "http://github.com/SproutVideo/sproutvideo-rb"
59
59
  s.licenses = ["MIT"]
60
- s.rubygems_version = "2.4.2"
61
60
  s.summary = "SproutVideo API Client"
62
61
 
63
62
  if s.respond_to? :specification_version then
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sproutvideo-rb
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.8.0
4
+ version: 1.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - SproutVideo
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-10-28 00:00:00.000000000 Z
11
+ date: 2022-07-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rest-client