vast 1.0.1 → 1.0.2

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.
data/lib/vast/ad.rb CHANGED
@@ -46,7 +46,7 @@ module VAST
46
46
  # Returns URI to request if ad does not play due to error.
47
47
  def error_url
48
48
  error_url_node = source_node.at("Error")
49
- URI.parse(error_url_node.content) if error_url_node
49
+ URI.parse(error_url_node.content.strip) if error_url_node
50
50
  end
51
51
 
52
52
  # Returns an array containing all linear creatives.
@@ -78,14 +78,14 @@ module VAST
78
78
 
79
79
  # Each Ad must contain at least one impression.
80
80
  def impression
81
- URI.parse(source_node.at('Impression').content)
81
+ URI.parse(source_node.at('Impression').content.strip)
82
82
  end
83
83
 
84
84
  # Array of all impressions available for this ad, excluding those specific
85
85
  # to a particular creative.
86
86
  def impressions
87
87
  source_node.xpath('.//Impression').to_a.collect do |node|
88
- URI.parse(node)
88
+ URI.parse(node.content.strip)
89
89
  end
90
90
  end
91
91
 
@@ -34,7 +34,7 @@ module VAST
34
34
 
35
35
  # URI to open as destination page when user clicks on the video
36
36
  def click_through_url
37
- URI.parse source_node.at('CompanionClickThrough').content
37
+ URI.parse source_node.at('CompanionClickThrough').content.strip
38
38
  end
39
39
 
40
40
  # Alternate text to be displayed when companion is rendered in HTML environment.
@@ -65,9 +65,9 @@ module VAST
65
65
  def resource_url
66
66
  case resource_type
67
67
  when :static
68
- URI.parse source_node.at('StaticResource').content
68
+ URI.parse source_node.at('StaticResource').content.strip
69
69
  when :iframe
70
- URI.parse source_node.at('IFrameResource').content
70
+ URI.parse source_node.at('IFrameResource').content.strip
71
71
  end
72
72
  end
73
73
 
@@ -4,7 +4,7 @@ module VAST
4
4
 
5
5
  # URI of request to survey vendor
6
6
  def survey_url
7
- URI.parse source_node.at('Survey').content
7
+ URI.parse source_node.at('Survey').content.strip
8
8
  end
9
9
 
10
10
  # Common name of ad
@@ -10,13 +10,13 @@ module VAST
10
10
 
11
11
  # URI to open as destination page when user clicks on the video
12
12
  def click_through_url
13
- URI.parse source_node.at('ClickThrough').content
13
+ URI.parse source_node.at('ClickThrough').content.strip
14
14
  end
15
15
 
16
16
  # An array of URIs to request for tracking purposes when user clicks on the video
17
17
  def click_tracking_urls
18
18
  source_node.xpath('.//ClickTracking').to_a.collect do |node|
19
- URI.parse node.content
19
+ URI.parse node.content.strip
20
20
  end
21
21
  end
22
22
 
@@ -27,7 +27,7 @@ module VAST
27
27
  custom_click_urls = {}
28
28
  source_node.xpath('.//CustomClick').to_a.collect do |node|
29
29
  key = underscore(node[:id]).to_sym
30
- custom_click_urls[key] = URI.parse(node.content)
30
+ custom_click_urls[key] = URI.parse(node.content.strip)
31
31
  end
32
32
  custom_click_urls
33
33
  end
@@ -5,7 +5,7 @@ module VAST
5
5
 
6
6
  # Location of linear file
7
7
  def url
8
- URI.parse source_node.content
8
+ URI.parse source_node.content.strip
9
9
  end
10
10
 
11
11
  def id
@@ -34,7 +34,7 @@ module VAST
34
34
 
35
35
  # URI to open as destination page when user clicks on creative
36
36
  def click_through_url
37
- URI.parse source_node.at('NonLinearClickThrough').content
37
+ URI.parse source_node.at('NonLinearClickThrough').content.strip
38
38
  end
39
39
 
40
40
  # Whether it is acceptable to scale the mediafile.
@@ -76,9 +76,9 @@ module VAST
76
76
  def resource_url
77
77
  case resource_type
78
78
  when :static
79
- URI.parse source_node.at('StaticResource').content
79
+ URI.parse source_node.at('StaticResource').content.strip
80
80
  when :iframe
81
- URI.parse source_node.at('IFrameResource').content
81
+ URI.parse source_node.at('IFrameResource').content.strip
82
82
  end
83
83
  end
84
84
 
@@ -12,7 +12,7 @@ module VAST
12
12
 
13
13
  # URI of ad tag of downstream Secondary Ad Server
14
14
  def ad_tag_url
15
- URI.parse source_node.at('VASTAdTagURI').content
15
+ URI.parse source_node.at('VASTAdTagURI').content.strip
16
16
  end
17
17
 
18
18
  end
@@ -6,11 +6,19 @@
6
6
  <AdSystem>Acudeo Compatible</AdSystem>
7
7
  <AdTitle>VAST 2.0 Instream Test 1</AdTitle>
8
8
  <Description>VAST 2.0 Instream Test 1</Description>
9
- <Survey><![CDATA[http://mySurveyURL/survey]]></Survey>
10
- <Error><![CDATA[http://myErrorURL/error]]></Error>
9
+ <Survey>
10
+ <![CDATA[http://mySurveyURL/survey]]>
11
+ </Survey>
12
+ <Error>
13
+ <![CDATA[http://myErrorURL/error]]>
14
+ </Error>
11
15
 
12
- <Impression id="first"><![CDATA[http://myTrackingURL/impression]]></Impression>
13
- <Impression id="second"><![CDATA[http://myTrackingURL/anotherImpression]]></Impression>
16
+ <Impression id="first">
17
+ <![CDATA[http://myTrackingURL/impression]]>
18
+ </Impression>
19
+ <Impression id="second">
20
+ <![CDATA[http://myTrackingURL/anotherImpression]]>
21
+ </Impression>
14
22
  <Creatives>
15
23
  <Creative id="6012" AdID="601364" sequence="1">
16
24
  <Linear>
@@ -39,14 +47,18 @@
39
47
  </TrackingEvents>
40
48
  <AdParameters><![CDATA[params=for&request=gohere]]></AdParameters>
41
49
  <VideoClicks>
42
- <ClickThrough><![CDATA[http://www.tremormedia.com]]></ClickThrough>
50
+ <ClickThrough>
51
+ <![CDATA[http://www.tremormedia.com]]>
52
+ </ClickThrough>
43
53
  <ClickTracking id="first"><![CDATA[http://myTrackingURL/click1]]></ClickTracking>
44
54
  <ClickTracking id="second"><![CDATA[http://myTrackingURL/click2]]></ClickTracking>
45
55
  <CustomClick id="customOne"><![CDATA[http://myTrackingURL/custom1]]></CustomClick>
46
56
  <CustomClick id="customTwo"><![CDATA[http://myTrackingURL/custom2]]></CustomClick>
47
57
  </VideoClicks>
48
58
  <MediaFiles>
49
- <MediaFile id="firstFile" delivery="progressive" type="video/x-flv" bitrate="500" width="400" height="300" scalable="true" maintainAspectRatio="true" apiFramework="VPAID"><![CDATA[http://cdnp.tremormedia.com/video/acudeo/Carrot_400x300_500kb.flv]]></MediaFile>
59
+ <MediaFile id="firstFile" delivery="progressive" type="video/x-flv" bitrate="500" width="400" height="300" scalable="true" maintainAspectRatio="true" apiFramework="VPAID">
60
+ <![CDATA[http://cdnp.tremormedia.com/video/acudeo/Carrot_400x300_500kb.flv]]>
61
+ </MediaFile>
50
62
  </MediaFiles>
51
63
  </Linear>
52
64
  </Creative>
@@ -61,22 +73,32 @@
61
73
  <AltText>Display this instead of the ad</AltText>
62
74
  </Companion>
63
75
  <Companion width="728" height="90">
64
- <IFrameResource><![CDATA[http://ad3.liverail.com/util/companions.php]]></IFrameResource>
65
- <CompanionClickThrough>http://www.tremormedia.com</CompanionClickThrough>
76
+ <IFrameResource>
77
+ <![CDATA[http://ad3.liverail.com/util/companions.php]]>
78
+ </IFrameResource>
79
+ <CompanionClickThrough>
80
+ http://www.tremormedia.com
81
+ </CompanionClickThrough>
66
82
  </Companion>
67
83
  </CompanionAds>
68
84
  </Creative>
69
85
  <Creative AdID="601365">
70
86
  <NonLinearAds>
71
87
  <NonLinear id="special_overlay" width="300" height="50" expandedWidth="600" expandedHeight="500" apiFramework="VPAID" scalable="true" maintainAspectRatio="true">
72
- <StaticResource creativeType="image/jpeg"><![CDATA[http://cdn.liverail.com/adasset/228/330/overlay.jpg]]></StaticResource>
73
- <NonLinearClickThrough><![CDATA[http://t3.liverail.com]]></NonLinearClickThrough>
74
- </NonLinear>
88
+ <StaticResource creativeType="image/jpeg">
89
+ <![CDATA[http://cdn.liverail.com/adasset/228/330/overlay.jpg]]>
90
+ </StaticResource>
91
+ <NonLinearClickThrough>
92
+ <![CDATA[http://t3.liverail.com]]>
93
+ </NonLinearClickThrough>
94
+ </NonLinear>
75
95
  <NonLinear width="728" height="90">
76
- <IFrameResource><![CDATA[http://ad3.liverail.com/util/non_linear.php]]></IFrameResource>
96
+ <IFrameResource>
97
+ <![CDATA[http://ad3.liverail.com/util/non_linear.php]]>
98
+ </IFrameResource>
77
99
  <NonLinearClickThrough>http://www.tremormedia.com</NonLinearClickThrough>
78
100
  </NonLinear>
79
- </NonLinearAds>
101
+ </NonLinearAds>
80
102
  </Creative>
81
103
  </Creatives>
82
104
  <Extensions>
@@ -7,7 +7,9 @@
7
7
  <Description>VAST 2.0 Instream Test 1</Description>
8
8
  <Error>http://myErrorURL/error</Error>
9
9
 
10
- <Impression>http://myTrackingURL/impression</Impression>
10
+ <Impression>
11
+ <![CDATA[http://myTrackingURL/impression]]>
12
+ </Impression>
11
13
  <Creatives>
12
14
  <Creative AdID="601364">
13
15
  <Linear>
@@ -15,7 +17,9 @@
15
17
  <TrackingEvents>
16
18
  <Tracking event="creativeView">http://myTrackingURL/creativeView</Tracking>
17
19
 
18
- <Tracking event="start">http://myTrackingURL/start</Tracking>
20
+ <Tracking event="start">
21
+ <![CDATA[http://myTrackingURL/start]]>
22
+ </Tracking>
19
23
  <Tracking event="midpoint">http://myTrackingURL/midpoint</Tracking>
20
24
  <Tracking event="firstQuartile">http://myTrackingURL/firstQuartile</Tracking>
21
25
  <Tracking event="thirdQuartile">http://myTrackingURL/thirdQuartile</Tracking>
@@ -23,11 +27,15 @@
23
27
  </TrackingEvents>
24
28
 
25
29
  <VideoClicks>
26
- <ClickThrough>http://www.tremormedia.com</ClickThrough>
30
+ <ClickThrough>
31
+ <![CDATA[http://www.tremormedia.com]]>
32
+ </ClickThrough>
27
33
  <ClickTracking>http://myTrackingURL/click</ClickTracking>
28
34
  </VideoClicks>
29
35
  <MediaFiles>
30
- <MediaFile delivery="progressive" type="video/x-flv" bitrate="500" width="400" height="300" scalable="true" maintainAspectRatio="true">http://cdnp.tremormedia.com/video/acudeo/Carrot_400x300_500kb.flv</MediaFile>
36
+ <MediaFile delivery="progressive" type="video/x-flv" bitrate="500" width="400" height="300" scalable="true" maintainAspectRatio="true">
37
+ <![CDATA[http://cdnp.tremormedia.com/video/acudeo/Carrot_400x300_500kb.flv]]>
38
+ </MediaFile>
31
39
  </MediaFiles>
32
40
 
33
41
  </Linear>
@@ -37,14 +45,18 @@
37
45
  <Companion width="300" height="250">
38
46
  <StaticResource creativeType="image/jpeg">http://demo.tremormedia.com/proddev/vast/Blistex1.jpg</StaticResource>
39
47
  <TrackingEvents>
40
- <Tracking event="creativeView">http://myTrackingURL/firstCompanionCreativeView</Tracking>
48
+ <Tracking event="creativeView">
49
+ <![CDATA[http://myTrackingURL/firstCompanionCreativeView]]>
50
+ </Tracking>
41
51
 
42
52
  </TrackingEvents>
43
53
 
44
54
  <CompanionClickThrough>http://www.tremormedia.com</CompanionClickThrough>
45
55
  </Companion>
46
56
  <Companion width="728" height="90">
47
- <StaticResource creativeType="image/jpeg">http://demo.tremormedia.com/proddev/vast/728x90_banner1.jpg</StaticResource>
57
+ <StaticResource creativeType="image/jpeg">
58
+ <![CDATA[http://demo.tremormedia.com/proddev/vast/728x90_banner1.jpg]]>
59
+ </StaticResource>
48
60
  <CompanionClickThrough>http://www.tremormedia.com</CompanionClickThrough>
49
61
  </Companion>
50
62
 
@@ -57,7 +69,9 @@
57
69
  <Wrapper>
58
70
  <AdSystem>Acudeo Compatible</AdSystem>
59
71
  <VASTAdTagURI>http://demo.tremormedia.com/proddev/vast/vast_inline_linear.xml</VASTAdTagURI>
60
- <Impression>http://myTrackingURL/wrapper/impression</Impression>
72
+ <Impression>
73
+ <![CDATA[http://myTrackingURL/wrapper/impression]]>
74
+ </Impression>
61
75
  <Creatives>
62
76
 
63
77
  <Creative AdID="602833">
@@ -70,7 +84,9 @@
70
84
  <CompanionAds>
71
85
  <Companion width="300" height="250">
72
86
 
73
- <StaticResource creativeType="image/jpeg">http://demo.tremormedia.com/proddev/vast/300x250_banner1.jpg</StaticResource>
87
+ <StaticResource creativeType="image/jpeg">
88
+ <![CDATA[http://demo.tremormedia.com/proddev/vast/300x250_banner1.jpg]]>
89
+ </StaticResource>
74
90
  <TrackingEvents>
75
91
  <Tracking event="creativeView">http://myTrackingURL/wrapper/firstCompanionCreativeView</Tracking>
76
92
  </TrackingEvents>
@@ -27,7 +27,7 @@
27
27
  <Companion width="728" height="90">
28
28
 
29
29
  <StaticResource creativeType="image/jpeg">
30
- http://demo.tremormedia.com/proddev/vast/728x90_banner1.jpg
30
+ <![CDATA[http://demo.tremormedia.com/proddev/vast/728x90_banner1.jpg]]>
31
31
  </StaticResource>
32
32
  <CompanionClickThrough>http://www.tremormedia.com</CompanionClickThrough>
33
33
  </Companion>
@@ -7,7 +7,9 @@
7
7
  <Description>VAST 2.0 Instream Test 1</Description>
8
8
  <Error>http://myErrorURL/error</Error>
9
9
 
10
- <Impression>http://myTrackingURL/impression</Impression>
10
+ <Impression>
11
+ <![CDATA[http://myTrackingURL/impression]]>
12
+ </Impression>
11
13
  <Creatives>
12
14
  <Creative AdID="601364">
13
15
  <Linear>
@@ -35,10 +37,11 @@
35
37
  <Creative AdID="601364-Companion">
36
38
  <CompanionAds>
37
39
  <Companion width="300" height="250">
38
- <StaticResource creativeType="image/jpeg">http://demo.tremormedia.com/proddev/vast/Blistex1.jpg</StaticResource>
40
+ <StaticResource creativeType="image/jpeg">
41
+ <![CDATA[http://demo.tremormedia.com/proddev/vast/Blistex1.jpg]]>
42
+ </StaticResource>
39
43
  <TrackingEvents>
40
44
  <Tracking event="creativeView">http://myTrackingURL/firstCompanionCreativeView</Tracking>
41
-
42
45
  </TrackingEvents>
43
46
 
44
47
  <CompanionClickThrough>http://www.tremormedia.com</CompanionClickThrough>
@@ -61,7 +64,9 @@
61
64
  <Description>VAST 2.0 Instream Test 1</Description>
62
65
  <Error>http://myErrorURL/error</Error>
63
66
 
64
- <Impression>http://myTrackingURL/impression</Impression>
67
+ <Impression>
68
+ <![CDATA[http://myTrackingURL/impression]]>
69
+ </Impression>
65
70
  <Creatives>
66
71
  <Creative AdID="601365">
67
72
  <Linear>
@@ -89,7 +94,9 @@
89
94
  <Creative AdID="601365-Companion">
90
95
  <CompanionAds>
91
96
  <Companion width="300" height="250">
92
- <StaticResource creativeType="image/jpeg">http://demo.tremormedia.com/proddev/vast/Blistex1.jpg</StaticResource>
97
+ <StaticResource creativeType="image/jpeg">
98
+ <![CDATA[http://demo.tremormedia.com/proddev/vast/Blistex1.jpg]]>
99
+ </StaticResource>
93
100
  <TrackingEvents>
94
101
  <Tracking event="creativeView">http://myTrackingURL/firstCompanionCreativeView</Tracking>
95
102
 
@@ -98,7 +105,9 @@
98
105
  <CompanionClickThrough>http://www.tremormedia.com</CompanionClickThrough>
99
106
  </Companion>
100
107
  <Companion width="728" height="90">
101
- <StaticResource creativeType="image/jpeg">http://demo.tremormedia.com/proddev/vast/728x90_banner1.jpg</StaticResource>
108
+ <StaticResource creativeType="image/jpeg">
109
+ <![CDATA[http://demo.tremormedia.com/proddev/vast/728x90_banner1.jpg]]>
110
+ </StaticResource>
102
111
  <CompanionClickThrough>http://www.tremormedia.com</CompanionClickThrough>
103
112
  </Companion>
104
113
 
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vast
3
3
  version: !ruby/object:Gem::Version
4
- hash: 21
4
+ hash: 19
5
5
  prerelease: false
6
6
  segments:
7
7
  - 1
8
8
  - 0
9
- - 1
10
- version: 1.0.1
9
+ - 2
10
+ version: 1.0.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Chris Dinn