sproutvideo-rb 1.8.0 → 2.0.0

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
  SHA256:
3
- metadata.gz: 8e13ddf68bf70448163cde8c0045b976926a0ed9927ce24b77fe33cd895f146f
4
- data.tar.gz: 985a727c9bc400dbe0844496648d659d03c40d44816ee67aecd0c9d088e9b1f3
3
+ metadata.gz: 00fc9e9bad24363a388a4e9d76594700e19798d205849a47bd0da4b8b374a14e
4
+ data.tar.gz: a89cf708bb9952298f2959cdeb3293659f45661db88088ba8b0b6825dd38c8a4
5
5
  SHA512:
6
- metadata.gz: b31337a738156031080f321fb5642ee55cefea66b3f1db8248d905599d88bbd0e0206e3bfa57df67960f184729ee0fa5e1187aa34b2996e9fcba6e19bfbe98ae
7
- data.tar.gz: '050186fd9d93ac3f392297e7ed3ad106126a1b99a713dddd4b135654b36324e7672383edc268ae35f56452742b2a824654ad3ae06d0382007e69f444cdab1b60'
6
+ metadata.gz: bfd78d4bb733c57743b668f90eee79825dbdc87720bd57708f050badab5e4c829c423b7d73e90fce5e7628a36f87c410df285e9e2c264c2fa56348ce70a03de5
7
+ data.tar.gz: 7f4dd8da964f3e7ea91f9c8768220b254ceb0d57f4b0e326e5f199da5aacdc720acec980ed1186db73d05140945c8e18124cbf9be4a8486de5b546f08f7b6990
data/README.markdown CHANGED
@@ -425,19 +425,19 @@ 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
431
- Sproutvideo::Analytics.playback_types
432
432
  Sproutvideo::Analytics.device_types
433
433
  ```
434
434
  Each method can also take an options hash containing a :video_id for retrieving overall data for a specific video:
435
435
  ```ruby
436
436
  Sproutvideo::Analytics.play_counts(:video_id => 'abc123')
437
+ Sproutvideo::Analytics.download_counts(:video_id => 'abc123')
437
438
  Sproutvideo::Analytics.domains(:video_id => 'abc123')
438
439
  Sproutvideo::Analytics.geo(:video_id => 'abc123')
439
440
  Sproutvideo::Analytics.video_types(:video_id => 'abc123')
440
- Sproutvideo::Analytics.playback_types(:video_id => 'abc123')
441
441
  Sproutvideo::Analytics.device_types(:video_id => 'abc123')
442
442
  ```
443
443
  The following methods can also take an options hash containing a :live_stream_id for retrieving overall data for a specific live_stream:
@@ -463,6 +463,7 @@ see api docs for more info
463
463
 
464
464
  ```ruby
465
465
  Sproutvideo::Analytics.popular_videos
466
+ SproutVideo::Analytics.popular_downloads
466
467
  ```
467
468
 
468
469
  ```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)
@@ -20,11 +25,6 @@ module Sproutvideo
20
25
  get(url, options)
21
26
  end
22
27
 
23
- def self.playback_types(options={})
24
- url = build_path("/stats/playback_types", options)
25
- get(url, options)
26
- end
27
-
28
28
  def self.device_types(options={})
29
29
  url = build_path("/stats/device_types", options)
30
30
  get(url, options)
@@ -66,6 +66,10 @@ module Sproutvideo
66
66
  get("/stats/popular_videos", options)
67
67
  end
68
68
 
69
+ def self.popular_downloads(options={})
70
+ get('/stats/popular_downloads', options)
71
+ end
72
+
69
73
  def self.live_stream_overview(live_stream_id, options={})
70
74
  get("/stats/live_streams/#{live_stream_id}/overview", options)
71
75
  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"
@@ -131,31 +158,6 @@ describe Sproutvideo::Analytics do
131
158
  end
132
159
  end
133
160
 
134
- describe "#playback_types" do
135
- before(:each) do
136
- @url = "#{Sproutvideo.base_url}/stats/playback_types"
137
- end
138
-
139
- it "should GET the correct url for overall method call and return a response" do
140
- RestClient.should_receive(:get).with(
141
- @url,
142
- {'SproutVideo-Api-Key' => @api_key, :params => {}}).and_return(@msg)
143
- Sproutvideo::Analytics.playback_types.class.should == Sproutvideo::Response
144
- end
145
- it "should GET the correct url for individual video method call and return a response" do
146
- RestClient.should_receive(:get).with(
147
- "#{@url}/abc123",
148
- {'SproutVideo-Api-Key' => @api_key, :params => {}}).and_return(@msg)
149
- Sproutvideo::Analytics.playback_types(:video_id => 'abc123').class.should == Sproutvideo::Response
150
- end
151
- it "should GET the correct url if dates are passed in" do
152
- RestClient.should_receive(:get).with(
153
- @url,
154
- {'SproutVideo-Api-Key' => @api_key, :params => {:start_date => '2012-12-31', :end_date => '2013-12-31'}}).and_return(@msg)
155
- Sproutvideo::Analytics.playback_types(:start_date => '2012-12-31', :end_date => '2013-12-31').class.should == Sproutvideo::Response
156
- end
157
- end
158
-
159
161
  describe "#device_types" do
160
162
  before(:each) do
161
163
  @url = "#{Sproutvideo.base_url}/stats/device_types"
@@ -271,6 +273,15 @@ describe Sproutvideo::Analytics do
271
273
  end
272
274
  end
273
275
 
276
+ describe "#popular_downloads" do
277
+ it "should GET the correct url for overall method call and return a response" do
278
+ RestClient.should_receive(:get).with(
279
+ "#{Sproutvideo.base_url}/stats/popular_downloads",
280
+ {'SproutVideo-Api-Key' => @api_key, :params => {}}).and_return(@msg)
281
+ Sproutvideo::Analytics.popular_downloads.class.should == Sproutvideo::Response
282
+ end
283
+ end
284
+
274
285
  describe "#live_stream_overview" do
275
286
  it "should GET the correct url for overall method call and return a response" do
276
287
  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 = "2.0.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: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - SproutVideo
8
- autorequire:
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
@@ -139,7 +139,7 @@ homepage: http://github.com/SproutVideo/sproutvideo-rb
139
139
  licenses:
140
140
  - MIT
141
141
  metadata: {}
142
- post_install_message:
142
+ post_install_message:
143
143
  rdoc_options: []
144
144
  require_paths:
145
145
  - lib
@@ -154,8 +154,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
154
154
  - !ruby/object:Gem::Version
155
155
  version: '0'
156
156
  requirements: []
157
- rubygems_version: 3.0.3.1
158
- signing_key:
157
+ rubygems_version: 3.1.6
158
+ signing_key:
159
159
  specification_version: 4
160
160
  summary: SproutVideo API Client
161
161
  test_files: []