actv 2.10.5 → 2.10.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/actv/asset.rb +22 -2
- data/lib/actv/author.rb +1 -1
- data/lib/actv/event.rb +1 -1
- data/lib/actv/version.rb +1 -1
- data/lib/actv/video.rb +5 -1
- data/spec/actv/asset_spec.rb +27 -0
- data/spec/actv/author_spec.rb +3 -3
- data/spec/actv/client/assets_spec.rb +1 -1
- data/spec/actv/client/videos_spec.rb +1 -1
- data/spec/actv/video_spec.rb +8 -2
- 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: 2c8962be8f84d61a6bec5ddd0330e948469f8ea9
|
4
|
+
data.tar.gz: 73dd3d5bf2832ddac42468eda20ff6e7ce2dad89
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 73045b2b84bab15dc927568badecb9cd742c944e233b54c31508921df49318686edc21c2ddd383cb7d8fd087bab5537184ab565a01917d38fd8b2c98b61d20b3
|
7
|
+
data.tar.gz: 6ca18df1625df56305d802e4227e0afee2aefa256806938161c21a459604a9cc6d6f8671289c66955e0b2e3f23d0b37f56c3cef0c5b3ac5b04e246bc4e5841eb
|
data/lib/actv/asset.rb
CHANGED
@@ -48,6 +48,11 @@ module ACTV
|
|
48
48
|
alias maximum_age regReqMaxAge
|
49
49
|
alias required_gender regReqGenderCd
|
50
50
|
|
51
|
+
def initialize options={}
|
52
|
+
super
|
53
|
+
options[:logoUrlAdr]= replace_http_to_https options[:logoUrlAdr]
|
54
|
+
end
|
55
|
+
|
51
56
|
def self.inherited base
|
52
57
|
@types << base
|
53
58
|
end
|
@@ -96,6 +101,7 @@ module ACTV
|
|
96
101
|
|
97
102
|
def descriptions
|
98
103
|
@descriptions ||= Array(@attrs[:assetDescriptions]).map do |description|
|
104
|
+
description[:description] = convert_all_resource_to_https(description[:description])
|
99
105
|
ACTV::AssetDescription.new(description)
|
100
106
|
end
|
101
107
|
end
|
@@ -128,6 +134,8 @@ module ACTV
|
|
128
134
|
|
129
135
|
def images
|
130
136
|
@images ||= Array(@attrs[:assetImages]).map do |img|
|
137
|
+
img[:imageUrlAdr] = replace_http_to_https img[:imageUrlAdr]
|
138
|
+
img[:linkUrl] = replace_http_to_https img[:linkUrl]
|
131
139
|
ACTV::AssetImage.new(img)
|
132
140
|
end
|
133
141
|
end
|
@@ -172,6 +180,7 @@ module ACTV
|
|
172
180
|
|
173
181
|
def seo_urls
|
174
182
|
@seo_urls ||= Array(@attrs[:assetSeoUrls]).map do |seo_url|
|
183
|
+
seo_url[:urlAdr] = replace_http_to_https seo_url[:urlAdr]
|
175
184
|
ACTV::AssetSeoUrl.new(seo_url)
|
176
185
|
end
|
177
186
|
end
|
@@ -320,7 +329,7 @@ module ACTV
|
|
320
329
|
end
|
321
330
|
|
322
331
|
def image_path
|
323
|
-
default_image = '
|
332
|
+
default_image = 'https://www.active.com/images/events/hotrace.gif'
|
324
333
|
image = image_without_placeholder.imageUrlAdr rescue ""
|
325
334
|
|
326
335
|
if image.empty? and (logoUrlAdr && logoUrlAdr != default_image && !(logoUrlAdr =~ URI::regexp).nil?)
|
@@ -373,7 +382,7 @@ module ACTV
|
|
373
382
|
end
|
374
383
|
|
375
384
|
def image_without_placeholder
|
376
|
-
default_image = '
|
385
|
+
default_image = 'https://www.active.com/images/events/hotrace.gif'
|
377
386
|
current_image = nil
|
378
387
|
|
379
388
|
asset_images.each do |i|
|
@@ -417,5 +426,16 @@ module ACTV
|
|
417
426
|
end_time = Time.parse(sponsoredContent[:endDate])
|
418
427
|
Time.now.between?(start_time, end_time)
|
419
428
|
end
|
429
|
+
|
430
|
+
def convert_all_resource_to_https content
|
431
|
+
content.gsub!(/src=[\'|\"](http:\/\/)/, "src='http://" => "src='https://", 'src="http://' => 'src="https://')
|
432
|
+
content
|
433
|
+
end
|
434
|
+
|
435
|
+
def replace_http_to_https content
|
436
|
+
content = content.to_s
|
437
|
+
content.gsub! 'http://', 'https://'
|
438
|
+
content
|
439
|
+
end
|
420
440
|
end
|
421
441
|
end
|
data/lib/actv/author.rb
CHANGED
data/lib/actv/event.rb
CHANGED
data/lib/actv/version.rb
CHANGED
data/lib/actv/video.rb
CHANGED
@@ -4,7 +4,6 @@ module ACTV
|
|
4
4
|
class Video < Asset
|
5
5
|
attr_reader :sorCreateDtm, :urlAdr
|
6
6
|
alias publish_date sorCreateDtm
|
7
|
-
alias source urlAdr
|
8
7
|
alias channel sub_topic
|
9
8
|
|
10
9
|
def self.valid? response
|
@@ -59,5 +58,10 @@ module ACTV
|
|
59
58
|
true
|
60
59
|
end
|
61
60
|
|
61
|
+
def source
|
62
|
+
urlAdr.to_s.sub! /http:\/\/rodale.videodownload.worldnow.com/i, 'https://rodale.videodownload.worldnow.com'
|
63
|
+
urlAdr
|
64
|
+
end
|
65
|
+
|
62
66
|
end
|
63
67
|
end
|
data/spec/actv/asset_spec.rb
CHANGED
@@ -3,6 +3,33 @@ require 'timecop'
|
|
3
3
|
|
4
4
|
describe ACTV::Asset do
|
5
5
|
|
6
|
+
describe '#initialize' do
|
7
|
+
it 'returns link with HTTPS protocol for www.active.com assets' do
|
8
|
+
asset = ACTV::Asset.new(assetGuid: 1, assetName: 'Asset #1', logoUrlAdr: 'http://www.active.com/images/logo.jpg')
|
9
|
+
expect(asset.logoUrlAdr).to eq 'https://www.active.com/images/logo.jpg'
|
10
|
+
end
|
11
|
+
|
12
|
+
it 'returns link with HTTPS protocol for content.active.com' do
|
13
|
+
asset = ACTV::Asset.new(assetGuid: 1, assetName: 'Asset #1', logoUrlAdr: 'http://content.active.com/images/logo.jpg')
|
14
|
+
expect(asset.logoUrlAdr).to eq 'https://content.active.com/images/logo.jpg'
|
15
|
+
end
|
16
|
+
|
17
|
+
it 'returns link with HTTPS protocol for photos-images.active.com' do
|
18
|
+
asset = ACTV::Asset.new(assetGuid: 1, assetName: 'Asset #1', logoUrlAdr: 'http://photos-images.active.com/images/logo.jpg')
|
19
|
+
expect(asset.logoUrlAdr).to eq 'https://photos-images.active.com/images/logo.jpg'
|
20
|
+
end
|
21
|
+
|
22
|
+
it 'returns link with HTTPS protocol for rodale.images.worldnow.com' do
|
23
|
+
asset = ACTV::Asset.new(assetGuid: 1, assetName: 'Asset #1', logoUrlAdr: 'http://rodale.images.worldnow.com/images/logo.jpg')
|
24
|
+
expect(asset.logoUrlAdr).to eq 'https://rodale.images.worldnow.com/images/logo.jpg'
|
25
|
+
end
|
26
|
+
|
27
|
+
it 'returns link with HTTPS protocol for rodale.videodownload.worldnow.com' do
|
28
|
+
asset = ACTV::Asset.new(assetGuid: 1, assetName: 'Asset #1', logoUrlAdr: 'http://rodale.videodownload.worldnow.com/images/logo.jpg')
|
29
|
+
expect(asset.logoUrlAdr).to eq 'https://rodale.videodownload.worldnow.com/images/logo.jpg'
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
6
33
|
describe '#organization' do
|
7
34
|
subject(:asset) { ACTV::Asset.new assetGuid: 'assetguid' }
|
8
35
|
|
data/spec/actv/author_spec.rb
CHANGED
@@ -11,7 +11,7 @@ describe ACTV::Author do
|
|
11
11
|
context 'when valid author asset is initialized' do
|
12
12
|
its(:footer) { should start_with '<div class="article-signature-block">' }
|
13
13
|
its(:bio) { should start_with 'Jacquie Cattanach is an avid runner and triathlete' }
|
14
|
-
its('photo.url') {should eq '
|
14
|
+
its('photo.url') {should eq 'https://www.active.com/Assets/Running/Bios/jacquie-cattanach-bio.jpg'}
|
15
15
|
its(:name_from_footer) { should eq 'Jacquie Cattanach'}
|
16
16
|
end
|
17
17
|
|
@@ -47,7 +47,7 @@ describe ACTV::Author do
|
|
47
47
|
describe '#image_url' do
|
48
48
|
context 'when photo url is a fully qualified url' do
|
49
49
|
it 'returns the photo url' do
|
50
|
-
expect(author.image_url).to eq '
|
50
|
+
expect(author.image_url).to eq 'https://www.active.com/Assets/Running/Bios/jacquie-cattanach-bio.jpg'
|
51
51
|
end
|
52
52
|
end
|
53
53
|
|
@@ -56,7 +56,7 @@ describe ACTV::Author do
|
|
56
56
|
allow(author.photo).to receive(:url).and_return '/hello'
|
57
57
|
end
|
58
58
|
it 'returns the url for the active.com domain' do
|
59
|
-
expect(author.image_url).to eq '
|
59
|
+
expect(author.image_url).to eq 'https://www.active.com/hello'
|
60
60
|
end
|
61
61
|
end
|
62
62
|
end
|
@@ -64,7 +64,7 @@ describe ACTV::Client do
|
|
64
64
|
describe "#asset_by_path" do
|
65
65
|
context "with a valid url passed" do
|
66
66
|
before do
|
67
|
-
@seo_url = "
|
67
|
+
@seo_url = "https://www.active.com/san-francisco-ca/running/crazy-eight-fall-2013"
|
68
68
|
@seo_url_md5 = Digest::MD5.hexdigest(@seo_url )
|
69
69
|
|
70
70
|
stub_get("/v2/seourls/#{@seo_url_md5}?load_asset=true").
|
@@ -17,7 +17,7 @@ describe ACTV::Client do
|
|
17
17
|
end
|
18
18
|
|
19
19
|
it "should return the correct source" do
|
20
|
-
expect(video.source).to eq("
|
20
|
+
expect(video.source).to eq("https://rodale.videodownload.worldnow.com/RODALE_2505201618134176078AA.mp4")
|
21
21
|
end
|
22
22
|
end
|
23
23
|
end
|
data/spec/actv/video_spec.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
describe ACTV::Video do
|
4
|
-
let(:asset_images) { [{:imageUrlAdr => "http://
|
4
|
+
let(:asset_images) { [{:imageUrlAdr => "http://rodale.images.worldnow.com/images/12508455_vtf.jpg", :imageName => "videoImage"}] }
|
5
5
|
let(:urlAdr) { "http://rodale.videodownload.worldnow.com/RODALE_0906201614333627818AA.mp4" }
|
6
6
|
let(:asset_tags) { [{:tag => {:tagId => "1794337", :tagName => "video/mp4", :tagDescription => "type"}},
|
7
7
|
{:tag => {:tagId => "1794525", :tagName => "640", :tagDescription => "width"}},
|
@@ -115,8 +115,14 @@ describe ACTV::Video do
|
|
115
115
|
describe "#cover" do
|
116
116
|
context "when a video image exists" do
|
117
117
|
it "should return video cover" do
|
118
|
-
expect(video.cover).to eq("
|
118
|
+
expect(video.cover).to eq("https://rodale.images.worldnow.com/images/12508455_vtf.jpg")
|
119
119
|
end
|
120
120
|
end
|
121
121
|
end
|
122
|
+
|
123
|
+
describe '#source' do
|
124
|
+
it 'starts with https' do
|
125
|
+
expect(video.source).to eq("https://rodale.videodownload.worldnow.com/RODALE_0906201614333627818AA.mp4")
|
126
|
+
end
|
127
|
+
end
|
122
128
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: actv
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.10.
|
4
|
+
version: 2.10.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nathaniel Barnes
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-09-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|