ruby-vast 1.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/LICENSE +20 -0
- data/README.rdoc +55 -0
- data/lib/ruby-vast.rb +1 -0
- data/lib/vast.rb +33 -0
- data/lib/vast/ad.rb +103 -0
- data/lib/vast/companion_creative.rb +81 -0
- data/lib/vast/creative.rb +62 -0
- data/lib/vast/document.rb +71 -0
- data/lib/vast/element.rb +9 -0
- data/lib/vast/extension.rb +18 -0
- data/lib/vast/icon.rb +87 -0
- data/lib/vast/inline_ad.rb +22 -0
- data/lib/vast/linear_creative.rb +57 -0
- data/lib/vast/mediafile.rb +56 -0
- data/lib/vast/non_linear_creative.rb +97 -0
- data/lib/vast/version.rb +3 -0
- data/lib/vast/wrapper_ad.rb +19 -0
- data/lib/vast3_draft.xsd +1036 -0
- data/lib/vast_2.0.1.xsd +643 -0
- data/test/ad_test.rb +122 -0
- data/test/companion_creative_test.rb +38 -0
- data/test/creative_test.rb +35 -0
- data/test/document_test.rb +72 -0
- data/test/examples/document_with_no_ads.xml +3 -0
- data/test/examples/document_with_one_inline_ad.xml +121 -0
- data/test/examples/document_with_one_inline_and_one_wrapper_ad.xml +105 -0
- data/test/examples/document_with_one_wrapper_ad.xml +40 -0
- data/test/examples/document_with_two_inline_ads.xml +120 -0
- data/test/examples/invalid_document.xml +3 -0
- data/test/examples/invalid_document_with_missing_ad_type.xml +58 -0
- data/test/examples/invalid_document_with_missing_creative_type.xml +39 -0
- data/test/examples/vast3_inline.xml +86 -0
- data/test/extension_test.rb +20 -0
- data/test/inline_ad_test.rb +14 -0
- data/test/linear_creative_test.rb +26 -0
- data/test/mediafile_test.rb +20 -0
- data/test/non_linear_creative_test.rb +39 -0
- data/test/test_helper.rb +13 -0
- data/test/vast3_inline_ad_test.rb +23 -0
- data/test/wrapper_ad_test.rb +16 -0
- metadata +99 -0
data/test/test_helper.rb
ADDED
@@ -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,99 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: ruby-vast
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.6
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Chris Dinn
|
8
|
+
- Mike Mulev
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2017-06-29 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: nokogiri
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
requirements:
|
18
|
+
- - "~>"
|
19
|
+
- !ruby/object:Gem::Version
|
20
|
+
version: '1.8'
|
21
|
+
type: :runtime
|
22
|
+
prerelease: false
|
23
|
+
version_requirements: !ruby/object:Gem::Requirement
|
24
|
+
requirements:
|
25
|
+
- - "~>"
|
26
|
+
- !ruby/object:Gem::Version
|
27
|
+
version: '1.8'
|
28
|
+
description:
|
29
|
+
email:
|
30
|
+
- m.mulev@gmail.com
|
31
|
+
executables: []
|
32
|
+
extensions: []
|
33
|
+
extra_rdoc_files: []
|
34
|
+
files:
|
35
|
+
- LICENSE
|
36
|
+
- README.rdoc
|
37
|
+
- lib/ruby-vast.rb
|
38
|
+
- lib/vast.rb
|
39
|
+
- lib/vast/ad.rb
|
40
|
+
- lib/vast/companion_creative.rb
|
41
|
+
- lib/vast/creative.rb
|
42
|
+
- lib/vast/document.rb
|
43
|
+
- lib/vast/element.rb
|
44
|
+
- lib/vast/extension.rb
|
45
|
+
- lib/vast/icon.rb
|
46
|
+
- lib/vast/inline_ad.rb
|
47
|
+
- lib/vast/linear_creative.rb
|
48
|
+
- lib/vast/mediafile.rb
|
49
|
+
- lib/vast/non_linear_creative.rb
|
50
|
+
- lib/vast/version.rb
|
51
|
+
- lib/vast/wrapper_ad.rb
|
52
|
+
- lib/vast3_draft.xsd
|
53
|
+
- lib/vast_2.0.1.xsd
|
54
|
+
- test/ad_test.rb
|
55
|
+
- test/companion_creative_test.rb
|
56
|
+
- test/creative_test.rb
|
57
|
+
- test/document_test.rb
|
58
|
+
- test/examples/document_with_no_ads.xml
|
59
|
+
- test/examples/document_with_one_inline_ad.xml
|
60
|
+
- test/examples/document_with_one_inline_and_one_wrapper_ad.xml
|
61
|
+
- test/examples/document_with_one_wrapper_ad.xml
|
62
|
+
- test/examples/document_with_two_inline_ads.xml
|
63
|
+
- test/examples/invalid_document.xml
|
64
|
+
- test/examples/invalid_document_with_missing_ad_type.xml
|
65
|
+
- test/examples/invalid_document_with_missing_creative_type.xml
|
66
|
+
- test/examples/vast3_inline.xml
|
67
|
+
- test/extension_test.rb
|
68
|
+
- test/inline_ad_test.rb
|
69
|
+
- test/linear_creative_test.rb
|
70
|
+
- test/mediafile_test.rb
|
71
|
+
- test/non_linear_creative_test.rb
|
72
|
+
- test/test_helper.rb
|
73
|
+
- test/vast3_inline_ad_test.rb
|
74
|
+
- test/wrapper_ad_test.rb
|
75
|
+
homepage: https://github.com/mulev/vast
|
76
|
+
licenses:
|
77
|
+
- MIT
|
78
|
+
metadata: {}
|
79
|
+
post_install_message:
|
80
|
+
rdoc_options: []
|
81
|
+
require_paths:
|
82
|
+
- lib
|
83
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
84
|
+
requirements:
|
85
|
+
- - ">="
|
86
|
+
- !ruby/object:Gem::Version
|
87
|
+
version: '0'
|
88
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
89
|
+
requirements:
|
90
|
+
- - ">="
|
91
|
+
- !ruby/object:Gem::Version
|
92
|
+
version: '0'
|
93
|
+
requirements: []
|
94
|
+
rubyforge_project:
|
95
|
+
rubygems_version: 2.6.12
|
96
|
+
signing_key:
|
97
|
+
specification_version: 4
|
98
|
+
summary: A gem for working with VAST documents
|
99
|
+
test_files: []
|