sessionm-vast 1.0.4

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.
Files changed (39) hide show
  1. data/LICENSE +20 -0
  2. data/README.rdoc +51 -0
  3. data/lib/vast/ad.rb +103 -0
  4. data/lib/vast/companion_creative.rb +81 -0
  5. data/lib/vast/creative.rb +62 -0
  6. data/lib/vast/document.rb +71 -0
  7. data/lib/vast/element.rb +9 -0
  8. data/lib/vast/extension.rb +18 -0
  9. data/lib/vast/icon.rb +87 -0
  10. data/lib/vast/inline_ad.rb +22 -0
  11. data/lib/vast/linear_creative.rb +57 -0
  12. data/lib/vast/mediafile.rb +56 -0
  13. data/lib/vast/non_linear_creative.rb +97 -0
  14. data/lib/vast/wrapper_ad.rb +19 -0
  15. data/lib/vast.rb +33 -0
  16. data/lib/vast3_draft.xsd +1036 -0
  17. data/lib/vast_2.0.1.xsd +643 -0
  18. data/test/ad_test.rb +122 -0
  19. data/test/companion_creative_test.rb +38 -0
  20. data/test/creative_test.rb +35 -0
  21. data/test/document_test.rb +72 -0
  22. data/test/examples/document_with_no_ads.xml +3 -0
  23. data/test/examples/document_with_one_inline_ad.xml +121 -0
  24. data/test/examples/document_with_one_inline_and_one_wrapper_ad.xml +105 -0
  25. data/test/examples/document_with_one_wrapper_ad.xml +40 -0
  26. data/test/examples/document_with_two_inline_ads.xml +120 -0
  27. data/test/examples/invalid_document.xml +3 -0
  28. data/test/examples/invalid_document_with_missing_ad_type.xml +58 -0
  29. data/test/examples/invalid_document_with_missing_creative_type.xml +39 -0
  30. data/test/examples/vast3_inline.xml +86 -0
  31. data/test/extension_test.rb +20 -0
  32. data/test/inline_ad_test.rb +14 -0
  33. data/test/linear_creative_test.rb +26 -0
  34. data/test/mediafile_test.rb +20 -0
  35. data/test/non_linear_creative_test.rb +39 -0
  36. data/test/test_helper.rb +13 -0
  37. data/test/vast3_inline_ad_test.rb +23 -0
  38. data/test/wrapper_ad_test.rb +16 -0
  39. metadata +94 -0
@@ -0,0 +1,58 @@
1
+ <!-- Invalid VAST document with ad type commented out -->
2
+ <VAST version="2.0">
3
+
4
+ <Ad id="601364">
5
+ <!-- <InLine> -->
6
+ <AdSystem>Acudeo Compatible</AdSystem>
7
+ <AdTitle>VAST 2.0 Instream Test 1</AdTitle>
8
+ <Description>VAST 2.0 Instream Test 1</Description>
9
+ <Error>http://myErrorURL/error</Error>
10
+
11
+ <Impression>http://myTrackingURL/impression</Impression>
12
+ <Creatives>
13
+ <Creative AdID="601364">
14
+ <Linear>
15
+ <Duration>00:00:30</Duration>
16
+ <TrackingEvents>
17
+ <Tracking event="creativeView">http://myTrackingURL/creativeView</Tracking>
18
+
19
+ <Tracking event="start">http://myTrackingURL/start</Tracking>
20
+ <Tracking event="midpoint">http://myTrackingURL/midpoint</Tracking>
21
+ <Tracking event="firstQuartile">http://myTrackingURL/firstQuartile</Tracking>
22
+ <Tracking event="thirdQuartile">http://myTrackingURL/thirdQuartile</Tracking>
23
+ <Tracking event="complete">http://myTrackingURL/complete</Tracking>
24
+ </TrackingEvents>
25
+
26
+ <VideoClicks>
27
+ <ClickThrough>http://www.tremormedia.com</ClickThrough>
28
+ <ClickTracking>http://myTrackingURL/click</ClickTracking>
29
+ </VideoClicks>
30
+ <MediaFiles>
31
+ <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>
32
+ </MediaFiles>
33
+
34
+ </Linear>
35
+ </Creative>
36
+ <Creative AdID="601364-Companion">
37
+ <CompanionAds>
38
+ <Companion width="300" height="250">
39
+ <StaticResource creativeType="image/jpeg">http://demo.tremormedia.com/proddev/vast/Blistex1.jpg</StaticResource>
40
+ <TrackingEvents>
41
+ <Tracking event="creativeView">http://myTrackingURL/firstCompanionCreativeView</Tracking>
42
+
43
+ </TrackingEvents>
44
+
45
+ <CompanionClickThrough>http://www.tremormedia.com</CompanionClickThrough>
46
+ </Companion>
47
+ <Companion width="728" height="90">
48
+ <StaticResource creativeType="image/jpeg">http://demo.tremormedia.com/proddev/vast/728x90_banner1.jpg</StaticResource>
49
+ <CompanionClickThrough>http://www.tremormedia.com</CompanionClickThrough>
50
+ </Companion>
51
+
52
+ </CompanionAds>
53
+ </Creative>
54
+ </Creatives>
55
+ <!-- </InLine> -->
56
+ </Ad>
57
+
58
+ </VAST>
@@ -0,0 +1,39 @@
1
+ <!-- Invalid VAST document with missing ad creative-->
2
+ <VAST version="2.0">
3
+
4
+ <Ad id="601364">
5
+ <InLine>
6
+ <AdSystem>Acudeo Compatible</AdSystem>
7
+ <AdTitle>VAST 2.0 Instream Test 1</AdTitle>
8
+ <Description>VAST 2.0 Instream Test 1</Description>
9
+ <Error>http://myErrorURL/error</Error>
10
+
11
+ <Impression>http://myTrackingURL/impression</Impression>
12
+ <Creatives>
13
+ <Creative AdID="601364">
14
+ <!-- <Linear> -->
15
+ <Duration>00:00:30</Duration>
16
+ <TrackingEvents>
17
+ <Tracking event="creativeView">http://myTrackingURL/creativeView</Tracking>
18
+
19
+ <Tracking event="start">http://myTrackingURL/start</Tracking>
20
+ <Tracking event="midpoint">http://myTrackingURL/midpoint</Tracking>
21
+ <Tracking event="firstQuartile">http://myTrackingURL/firstQuartile</Tracking>
22
+ <Tracking event="thirdQuartile">http://myTrackingURL/thirdQuartile</Tracking>
23
+ <Tracking event="complete">http://myTrackingURL/complete</Tracking>
24
+ </TrackingEvents>
25
+
26
+ <VideoClicks>
27
+ <ClickThrough>http://www.tremormedia.com</ClickThrough>
28
+ <ClickTracking>http://myTrackingURL/click</ClickTracking>
29
+ </VideoClicks>
30
+ <MediaFiles>
31
+ <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>
32
+ </MediaFiles>
33
+ <!-- </Linear> -->
34
+ </Creative>
35
+ </Creatives>
36
+ </InLine>
37
+ </Ad>
38
+
39
+ </VAST>
@@ -0,0 +1,86 @@
1
+ <VAST version="3.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="vast.xsd">
2
+ <Ad id="2447226.251866656" sequence="1">
3
+ <InLine>
4
+ <AdSystem>FreeWheel</AdSystem>
5
+ <AdTitle>Ooyla test m3u8 midroll 1</AdTitle>
6
+ <Error><![CDATA[http://g1.v.fwmrm.net/ad/l/1?s=a032&n=164515&t=1366755844262714011&adid=2447226&reid=1698599&arid=0&iw=&uxnw=&uxss=&uxct=&et=e&cn=[ERRORCODE]]]></Error>
7
+ <Impression id="FWi_2447226.0"><![CDATA[http://g1.v.fwmrm.net/ad/l/1?s=a032&n=164515&t=1366755844262714011&adid=2447226&reid=1698599&arid=0&auid=&cn=defaultImpression&et=i&_cc=&tpos=15&iw=&uxnw=&uxss=&uxct=&metr=121&init=1&_dic=1&cr=]]></Impression>
8
+
9
+ <Creatives>
10
+ <Creative AdID="2447226">
11
+ <Linear>
12
+ <Duration>00:00:15</Duration>
13
+ <TrackingEvents>
14
+ <Tracking event="complete"><![CDATA[http://g1.v.fwmrm.net/ad/l/1?s=a032&n=164515&t=1366755844262714011&adid=2447226&reid=1698599&arid=0&auid=&cn=complete&et=i&_cc=&tpos=15&init=1&iw=&uxnw=&uxss=&uxct=&metr=121]]></Tracking>
15
+ <Tracking event="firstQuartile"><![CDATA[http://g1.v.fwmrm.net/ad/l/1?s=a032&n=164515&t=1366755844262714011&adid=2447226&reid=1698599&arid=0&auid=&cn=firstQuartile&et=i&_cc=&tpos=15&init=1&iw=&uxnw=&uxss=&uxct=&metr=121]]></Tracking>
16
+ <Tracking event="midpoint"><![CDATA[http://g1.v.fwmrm.net/ad/l/1?s=a032&n=164515&t=1366755844262714011&adid=2447226&reid=1698599&arid=0&auid=&cn=midPoint&et=i&_cc=&tpos=15&init=1&iw=&uxnw=&uxss=&uxct=&metr=121]]></Tracking>
17
+ <Tracking event="thirdQuartile"><![CDATA[http://g1.v.fwmrm.net/ad/l/1?s=a032&n=164515&t=1366755844262714011&adid=2447226&reid=1698599&arid=0&auid=&cn=thirdQuartile&et=i&_cc=&tpos=15&init=1&iw=&uxnw=&uxss=&uxct=&metr=121]]></Tracking>
18
+ </TrackingEvents>
19
+ <VideoClicks>
20
+ <ClickTracking id="FWc_2447226.0"><![CDATA[http://g1.v.fwmrm.net/ad/l/1?s=a032&n=164515&t=1366755844262714011&adid=2447226&reid=1698599&arid=0&auid=&cn=defaultClick&et=c&_cc=&tpos=15&cr=]]></ClickTracking>
21
+ </VideoClicks>
22
+ <MediaFiles>
23
+ <MediaFile delivery="streaming" height="0" type="application/x-mpegURL" width="0"><![CDATA[http://hdadshds-f.akamaihd.net/i/video/campaigns/fox/tmobile/tmo15unlimitedh641080_,130,80,180,340,450,250,50,30,22,15,0.mp4.csmil/master.m3u8]]></MediaFile>
24
+ </MediaFiles>
25
+ </Linear>
26
+ </Creative>
27
+ </Creatives>
28
+ </InLine>
29
+ </Ad>
30
+ <Ad id="2447227.255243472" sequence="2">
31
+ <InLine>
32
+ <AdSystem>FreeWheel</AdSystem>
33
+ <AdTitle>Ooyla test m3u8 midroll 2</AdTitle>
34
+ <Error><![CDATA[http://g1.v.fwmrm.net/ad/l/1?s=a032&n=164515&t=1366755844262714011&adid=2447227&reid=1698600&arid=0&iw=&uxnw=&uxss=&uxct=&et=e&cn=[ERRORCODE]]]></Error>
35
+ <Impression id="FWi_2447227.0"><![CDATA[http://g1.v.fwmrm.net/ad/l/1?s=a032&n=164515&t=1366755844262714011&adid=2447227&reid=1698600&arid=0&auid=&cn=defaultImpression&et=i&_cc=&tpos=15&iw=&uxnw=&uxss=&uxct=&metr=121&init=1&_dic=1&cr=]]></Impression>
36
+
37
+ <Creatives>
38
+ <Creative AdID="2447227">
39
+ <Linear>
40
+ <Duration>00:00:31</Duration>
41
+ <TrackingEvents>
42
+ <Tracking event="complete"><![CDATA[http://g1.v.fwmrm.net/ad/l/1?s=a032&n=164515&t=1366755844262714011&adid=2447227&reid=1698600&arid=0&auid=&cn=complete&et=i&_cc=&tpos=15&init=1&iw=&uxnw=&uxss=&uxct=&metr=121]]></Tracking>
43
+ <Tracking event="firstQuartile"><![CDATA[http://g1.v.fwmrm.net/ad/l/1?s=a032&n=164515&t=1366755844262714011&adid=2447227&reid=1698600&arid=0&auid=&cn=firstQuartile&et=i&_cc=&tpos=15&init=1&iw=&uxnw=&uxss=&uxct=&metr=121]]></Tracking>
44
+ <Tracking event="midpoint"><![CDATA[http://g1.v.fwmrm.net/ad/l/1?s=a032&n=164515&t=1366755844262714011&adid=2447227&reid=1698600&arid=0&auid=&cn=midPoint&et=i&_cc=&tpos=15&init=1&iw=&uxnw=&uxss=&uxct=&metr=121]]></Tracking>
45
+ <Tracking event="thirdQuartile"><![CDATA[http://g1.v.fwmrm.net/ad/l/1?s=a032&n=164515&t=1366755844262714011&adid=2447227&reid=1698600&arid=0&auid=&cn=thirdQuartile&et=i&_cc=&tpos=15&init=1&iw=&uxnw=&uxss=&uxct=&metr=121]]></Tracking>
46
+ </TrackingEvents>
47
+ <VideoClicks>
48
+ <ClickTracking id="FWc_2447227.0"><![CDATA[http://g1.v.fwmrm.net/ad/l/1?s=a032&n=164515&t=1366755844262714011&adid=2447227&reid=1698600&arid=0&auid=&cn=defaultClick&et=c&_cc=&tpos=15&cr=]]></ClickTracking>
49
+ </VideoClicks>
50
+ <MediaFiles>
51
+ <MediaFile delivery="streaming" height="0" type="application/x-mpegURL" width="0"><![CDATA[http://hdadshds-f.akamaihd.net/i/video/campaigns/fox/showtime/homelandlookagain30qsbj2330h_,340,450,180,250,130,80,50,30,22,15,0.mp4.csmil/master.m3u8]]></MediaFile>
52
+ </MediaFiles>
53
+ </Linear>
54
+ </Creative>
55
+ </Creatives>
56
+ </InLine>
57
+ </Ad>
58
+ <Ad id="2447228.257609712" sequence="3">
59
+ <InLine>
60
+ <AdSystem>FreeWheel</AdSystem>
61
+ <AdTitle>Ooyla test m3u8 midroll 3</AdTitle>
62
+ <Error><![CDATA[http://g1.v.fwmrm.net/ad/l/1?s=a032&n=164515&t=1366755844262714011&adid=2447228&reid=1698602&arid=0&iw=&uxnw=&uxss=&uxct=&et=e&cn=[ERRORCODE]]]></Error>
63
+ <Impression id="FWi_2447228.0"><![CDATA[http://g1.v.fwmrm.net/ad/l/1?s=a032&n=164515&t=1366755844262714011&adid=2447228&reid=1698602&arid=0&auid=&cn=defaultImpression&et=i&_cc=&tpos=15&iw=&uxnw=&uxss=&uxct=&metr=121&init=1&_dic=1&cr=]]></Impression>
64
+
65
+ <Creatives>
66
+ <Creative AdID="2447228">
67
+ <Linear>
68
+ <Duration>00:00:31</Duration>
69
+ <TrackingEvents>
70
+ <Tracking event="complete"><![CDATA[http://g1.v.fwmrm.net/ad/l/1?s=a032&n=164515&t=1366755844262714011&adid=2447228&reid=1698602&arid=0&auid=&cn=complete&et=i&_cc=&tpos=15&init=1&iw=&uxnw=&uxss=&uxct=&metr=121]]></Tracking>
71
+ <Tracking event="firstQuartile"><![CDATA[http://g1.v.fwmrm.net/ad/l/1?s=a032&n=164515&t=1366755844262714011&adid=2447228&reid=1698602&arid=0&auid=&cn=firstQuartile&et=i&_cc=&tpos=15&init=1&iw=&uxnw=&uxss=&uxct=&metr=121]]></Tracking>
72
+ <Tracking event="midpoint"><![CDATA[http://g1.v.fwmrm.net/ad/l/1?s=a032&n=164515&t=1366755844262714011&adid=2447228&reid=1698602&arid=0&auid=&cn=midPoint&et=i&_cc=&tpos=15&init=1&iw=&uxnw=&uxss=&uxct=&metr=121]]></Tracking>
73
+ <Tracking event="thirdQuartile"><![CDATA[http://g1.v.fwmrm.net/ad/l/1?s=a032&n=164515&t=1366755844262714011&adid=2447228&reid=1698602&arid=0&auid=&cn=thirdQuartile&et=i&_cc=&tpos=15&init=1&iw=&uxnw=&uxss=&uxct=&metr=121]]></Tracking>
74
+ </TrackingEvents>
75
+ <VideoClicks>
76
+ <ClickTracking id="FWc_2447228.0"><![CDATA[http://g1.v.fwmrm.net/ad/l/1?s=a032&n=164515&t=1366755844262714011&adid=2447228&reid=1698602&arid=0&auid=&cn=defaultClick&et=c&_cc=&tpos=15&cr=]]></ClickTracking>
77
+ </VideoClicks>
78
+ <MediaFiles>
79
+ <MediaFile delivery="streaming" height="0" type="application/x-mpegURL" width="0"><![CDATA[http://hdadshds-f.akamaihd.net/i/video/campaigns/fx/millercoors/snowparty30enhdns_,340,50,30,22,15,450,180,250,130,80,0.mp4.csmil/master.m3u8]]></MediaFile>
80
+ </MediaFiles>
81
+ </Linear>
82
+ </Creative>
83
+ </Creatives>
84
+ </InLine>
85
+ </Ad>
86
+ </VAST>
@@ -0,0 +1,20 @@
1
+ require 'test_helper'
2
+
3
+ class ExtensionTest < Test::Unit::TestCase
4
+
5
+ def test_should_know_attributes
6
+ document_file = example_file('document_with_one_inline_ad.xml')
7
+ document = VAST::Document.parse!(document_file)
8
+ extension = VAST::Extension.new(document.at('Extension'))
9
+
10
+ assert_equal "DART", extension.type
11
+ end
12
+
13
+ def test_should_know_attributes
14
+ document_file = example_file('document_with_one_inline_ad.xml')
15
+ document = VAST::Document.parse!(document_file)
16
+ extension = VAST::Extension.new(document.at('Extension'))
17
+
18
+ assert_equal extension.source_node, extension.xml
19
+ end
20
+ end
@@ -0,0 +1,14 @@
1
+ require 'test_helper'
2
+
3
+ class InlineAdTest < Test::Unit::TestCase
4
+
5
+ def test_ad_should_know_attributes
6
+ document_file = example_file('document_with_one_inline_ad.xml')
7
+ document = VAST::Document.parse!(document_file)
8
+ inline_ad = document.inline_ads.first
9
+
10
+ assert_equal "http://mySurveyURL/survey", inline_ad.survey_url.to_s
11
+ assert_equal "VAST 2.0 Instream Test 1", inline_ad.ad_title
12
+ end
13
+
14
+ end
@@ -0,0 +1,26 @@
1
+ require 'test_helper'
2
+
3
+ class LinearCreativeTest < Test::Unit::TestCase
4
+
5
+ def test_should_know_attributes
6
+ document_file = example_file('document_with_one_inline_ad.xml')
7
+ document = VAST::Document.parse!(document_file)
8
+ creative = document.inline_ads.first.linear_creatives.first
9
+
10
+ assert_equal "00:00:30", creative.duration
11
+ assert_equal "http://www.tremormedia.com", creative.click_through_url.to_s
12
+ assert_equal "http://myTrackingURL/click1", creative.click_tracking_urls.first.to_s
13
+ assert_equal "http://myTrackingURL/click2", creative.click_tracking_urls.last.to_s
14
+ assert_equal "http://myTrackingURL/custom1", creative.custom_click_urls[:custom_one].to_s
15
+ assert_equal "http://myTrackingURL/custom2", creative.custom_click_urls[:custom_two].to_s
16
+ end
17
+
18
+ def test_should_have_mediafiles
19
+ document_file = example_file('document_with_one_inline_ad.xml')
20
+ document = VAST::Document.parse!(document_file)
21
+ creative = document.inline_ads.first.linear_creatives.first
22
+
23
+ assert creative.mediafiles.first.kind_of?(VAST::Mediafile)
24
+ end
25
+
26
+ end
@@ -0,0 +1,20 @@
1
+ require 'test_helper'
2
+
3
+ class MediafileTest < Test::Unit::TestCase
4
+ def test_should_know_attributes
5
+ document_file = example_file('document_with_one_inline_ad.xml')
6
+ document = VAST::Document.parse!(document_file)
7
+ mediafile = VAST::Mediafile.new(document.at('MediaFile'))
8
+
9
+ assert_equal "http://cdnp.tremormedia.com/video/acudeo/Carrot_400x300_500kb.flv", mediafile.url.to_s
10
+ assert_equal "firstFile", mediafile.id
11
+ assert_equal "progressive", mediafile.delivery
12
+ assert_equal "video/x-flv", mediafile.type
13
+ assert_equal 400, mediafile.width
14
+ assert_equal 300, mediafile.height
15
+ assert_equal 500, mediafile.bitrate
16
+ assert_equal "VPAID", mediafile.api_framework
17
+ assert mediafile.scalable?
18
+ assert mediafile.maintain_aspect_ratio?
19
+ end
20
+ end
@@ -0,0 +1,39 @@
1
+ require 'test_helper'
2
+
3
+ class NonLinearCreativeTest < Test::Unit::TestCase
4
+
5
+ def test_should_know_attributes
6
+ document_file = example_file('document_with_one_inline_ad.xml')
7
+ document = VAST::Document.parse!(document_file)
8
+ creative = document.inline_ads.first.non_linear_creatives.first
9
+
10
+ assert_equal "special_overlay", creative.id
11
+ assert_equal 300, creative.width
12
+ assert_equal 50, creative.height
13
+ assert_equal 600, creative.expanded_width
14
+ assert_equal 500, creative.expanded_height
15
+ assert_equal "http://t3.liverail.com", creative.click_through_url.to_s
16
+ assert_equal "VPAID", creative.api_framework
17
+ assert creative.scalable?
18
+ assert creative.maintain_aspect_ratio?
19
+ end
20
+
21
+ def test_should_know_static_resource
22
+ document_file = example_file('document_with_one_inline_ad.xml')
23
+ document = VAST::Document.parse!(document_file)
24
+ creative_with_static_resource = document.inline_ads.first.non_linear_creatives.first
25
+
26
+ assert_equal :static, creative_with_static_resource.resource_type
27
+ assert_equal "image/jpeg", creative_with_static_resource.creative_type
28
+ assert_equal "http://cdn.liverail.com/adasset/228/330/overlay.jpg", creative_with_static_resource.resource_url.to_s
29
+ end
30
+
31
+ def test_should_know_iframe_resource
32
+ document_file = example_file('document_with_one_inline_ad.xml')
33
+ document = VAST::Document.parse!(document_file)
34
+ creative_with_iframe_resource = document.inline_ads.first.non_linear_creatives.last
35
+
36
+ assert_equal :iframe, creative_with_iframe_resource.resource_type
37
+ assert_equal "http://ad3.liverail.com/util/non_linear.php", creative_with_iframe_resource.resource_url.to_s
38
+ end
39
+ end
@@ -0,0 +1,13 @@
1
+ require 'test/unit'
2
+ require 'rubygems'
3
+ require 'bundler'
4
+
5
+ Bundler.setup(:default, :test)
6
+ Bundler.require(:default, :test)
7
+
8
+ require 'vast'
9
+
10
+ def example_file(filename)
11
+ file_path = File.expand_path(File.join(File.dirname(__FILE__), 'examples', filename))
12
+ File.read file_path
13
+ end
@@ -0,0 +1,23 @@
1
+ require 'test_helper'
2
+
3
+ class InlineAdTest < Test::Unit::TestCase
4
+
5
+ def test_ad_should_know_attributes
6
+ document_file = example_file('vast3_inline.xml')
7
+ document = VAST::Document.parse!(document_file)
8
+
9
+ inline_ad = document.inline_ads.first
10
+
11
+ assert_equal 3, document.inline_ads.length
12
+ assert_equal '3.0', document.xpath('/VAST/@version').first.value
13
+ assert_equal "FreeWheel", inline_ad.ad_system.to_s
14
+ assert_equal "Ooyla test m3u8 midroll 1", inline_ad.ad_title
15
+
16
+ creative = inline_ad.linear_creatives.first
17
+ assert_equal '2447226', creative.ad_id
18
+ assert_equal "00:00:15", creative.duration
19
+ assert_equal "http://g1.v.fwmrm.net/ad/l/1?s=a032&n=164515&t=1366755844262714011&adid=2447226&reid=1698599&arid=0&auid=&cn=defaultClick&et=c&_cc=&tpos=15&cr=", creative.click_tracking_urls.first.to_s
20
+
21
+ end
22
+
23
+ end
@@ -0,0 +1,16 @@
1
+ require 'test_helper'
2
+
3
+ class WrapperAdTest < Test::Unit::TestCase
4
+
5
+ def test_should_know_ad_tag_url
6
+ document_with_wrapper_ad = example_file('document_with_one_wrapper_ad.xml')
7
+ document = VAST::Document.parse!(document_with_wrapper_ad)
8
+
9
+ ad_node = document.root.xpath('.//Ad').first
10
+ ad = VAST::WrapperAd.new(ad_node)
11
+
12
+ assert ad.ad_tag_url.kind_of?(URI)
13
+ assert_equal "http://demo.tremormedia.com/proddev/vast/vast_inline_linear.xml", ad.ad_tag_url.to_s
14
+ end
15
+
16
+ end
metadata ADDED
@@ -0,0 +1,94 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: sessionm-vast
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.4
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Chris Dinn
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2013-07-31 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: nokogiri
16
+ requirement: &70245004446640 !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ~>
20
+ - !ruby/object:Gem::Version
21
+ version: 1.5.5
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: *70245004446640
25
+ description:
26
+ email:
27
+ - chrisgdinn@gmail.com
28
+ executables: []
29
+ extensions: []
30
+ extra_rdoc_files: []
31
+ files:
32
+ - lib/vast.rb
33
+ - lib/vast3_draft.xsd
34
+ - lib/vast_2.0.1.xsd
35
+ - lib/vast/ad.rb
36
+ - lib/vast/companion_creative.rb
37
+ - lib/vast/creative.rb
38
+ - lib/vast/document.rb
39
+ - lib/vast/element.rb
40
+ - lib/vast/extension.rb
41
+ - lib/vast/icon.rb
42
+ - lib/vast/inline_ad.rb
43
+ - lib/vast/linear_creative.rb
44
+ - lib/vast/mediafile.rb
45
+ - lib/vast/non_linear_creative.rb
46
+ - lib/vast/wrapper_ad.rb
47
+ - test/ad_test.rb
48
+ - test/companion_creative_test.rb
49
+ - test/creative_test.rb
50
+ - test/document_test.rb
51
+ - test/extension_test.rb
52
+ - test/inline_ad_test.rb
53
+ - test/linear_creative_test.rb
54
+ - test/mediafile_test.rb
55
+ - test/non_linear_creative_test.rb
56
+ - test/test_helper.rb
57
+ - test/vast3_inline_ad_test.rb
58
+ - test/wrapper_ad_test.rb
59
+ - test/examples/document_with_no_ads.xml
60
+ - test/examples/document_with_one_inline_ad.xml
61
+ - test/examples/document_with_one_inline_and_one_wrapper_ad.xml
62
+ - test/examples/document_with_one_wrapper_ad.xml
63
+ - test/examples/document_with_two_inline_ads.xml
64
+ - test/examples/invalid_document.xml
65
+ - test/examples/invalid_document_with_missing_ad_type.xml
66
+ - test/examples/invalid_document_with_missing_creative_type.xml
67
+ - test/examples/vast3_inline.xml
68
+ - LICENSE
69
+ - README.rdoc
70
+ homepage: http://github.com/chrisdinn/vast
71
+ licenses: []
72
+ post_install_message:
73
+ rdoc_options: []
74
+ require_paths:
75
+ - lib
76
+ required_ruby_version: !ruby/object:Gem::Requirement
77
+ none: false
78
+ requirements:
79
+ - - ! '>='
80
+ - !ruby/object:Gem::Version
81
+ version: '0'
82
+ required_rubygems_version: !ruby/object:Gem::Requirement
83
+ none: false
84
+ requirements:
85
+ - - ! '>='
86
+ - !ruby/object:Gem::Version
87
+ version: '0'
88
+ requirements: []
89
+ rubyforge_project:
90
+ rubygems_version: 1.8.15
91
+ signing_key:
92
+ specification_version: 3
93
+ summary: A gem for working with VAST 2.0 documents
94
+ test_files: []