rbvimeo 0.3.0 → 0.3.1
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/.gitignore +5 -0
- data/VERSION.yml +1 -1
- data/lib/rbvimeo/user.rb +9 -3
- data/lib/rbvimeo/video.rb +30 -26
- data/lib/rbvimeo/vimeo.rb +1 -1
- data/rbvimeo.gemspec +63 -0
- data/test/XML/339189.xml +77 -27
- data/test/rbvimeo_test.rb +1 -1
- data/test/video_test.rb +27 -23
- metadata +8 -4
data/VERSION.yml
CHANGED
data/lib/rbvimeo/user.rb
CHANGED
@@ -1,9 +1,15 @@
|
|
1
|
+
# <owner display_name="Vimeo Staff" id="152184" is_plus="1" is_staff="1" profileurl="http://vimeo.com/staff" realname="Vimeo Staff" username="staff" videosurl="http://vimeo.com/staff/videos">
|
2
|
+
|
1
3
|
module RBVIMEO
|
2
4
|
class User
|
3
|
-
attr_accessor :id, :username, :
|
4
|
-
|
5
|
+
attr_accessor :id, :username, :display_name, :is_plus, :is_staff, :profileurl, :realname, :username, :videosurl
|
6
|
+
|
5
7
|
def id
|
6
|
-
|
8
|
+
@id.to_i
|
9
|
+
end
|
10
|
+
|
11
|
+
def fullname
|
12
|
+
@realname
|
7
13
|
end
|
8
14
|
end
|
9
15
|
end
|
data/lib/rbvimeo/video.rb
CHANGED
@@ -2,9 +2,9 @@ module RBVIMEO
|
|
2
2
|
class Video
|
3
3
|
attr_reader :id, :title, :caption, :upload_date, :number_of_likes, :number_of_plays
|
4
4
|
attr_reader :number_of_comments, :width, :height, :owner, :tags, :url
|
5
|
-
attr_reader :thumbs
|
5
|
+
attr_reader :thumbs, :duration
|
6
|
+
|
6
7
|
|
7
|
-
|
8
8
|
# Fetches data about a video from the Vimeo site
|
9
9
|
# id is the id of the the Vimeo video
|
10
10
|
# vimeo is an instance of RBVIMEO::Vimeo
|
@@ -17,8 +17,8 @@ module RBVIMEO
|
|
17
17
|
@comments = []
|
18
18
|
@id = id
|
19
19
|
@vimeo = vimeo
|
20
|
-
|
21
|
-
url = vimeo.generate_url({"method" => "vimeo.videos.getInfo",
|
20
|
+
|
21
|
+
url = vimeo.generate_url({"method" => "vimeo.videos.getInfo",
|
22
22
|
"video_id" => id, "api_key" => vimeo.api_key}, "read")
|
23
23
|
|
24
24
|
xml_doc = @vimeo.get_xml(url)
|
@@ -42,52 +42,56 @@ EOF
|
|
42
42
|
get_comments if @comments.empty?
|
43
43
|
return @comments
|
44
44
|
end
|
45
|
-
|
45
|
+
|
46
46
|
def likes
|
47
47
|
@number_of_likes.to_i
|
48
48
|
end
|
49
|
-
|
49
|
+
|
50
50
|
def plays
|
51
51
|
@number_of_plays.to_i
|
52
52
|
end
|
53
|
-
|
53
|
+
|
54
54
|
def num_comments
|
55
55
|
@number_of_comments.to_i
|
56
56
|
end
|
57
|
-
|
57
|
+
|
58
58
|
def number_of_likes
|
59
59
|
@number_of_likes.to_i
|
60
60
|
end
|
61
|
-
|
61
|
+
|
62
62
|
def number_of_plays
|
63
63
|
@number_of_plays.to_i
|
64
64
|
end
|
65
|
-
|
65
|
+
|
66
66
|
def number_of_comments
|
67
67
|
@number_of_comments.to_i
|
68
68
|
end
|
69
|
-
|
69
|
+
|
70
70
|
def height
|
71
71
|
@height.to_i
|
72
72
|
end
|
73
|
-
|
73
|
+
|
74
74
|
def width
|
75
75
|
@width.to_i
|
76
76
|
end
|
77
|
-
|
77
|
+
|
78
|
+
def duration
|
79
|
+
@duration.to_i
|
80
|
+
end
|
81
|
+
|
78
82
|
private
|
79
83
|
# Parses data using the xml recieved from the Vimeo REST API
|
80
84
|
# Should not need to be called by anything other than the initialize method
|
81
85
|
def parse_xml xml_doc
|
82
86
|
return nil if xml_doc.at("title").nil?
|
83
87
|
@id = id
|
84
|
-
|
85
|
-
%w[title caption upload_date number_of_likes number_of_plays width height number_of_comments url].each do |attribute|
|
88
|
+
|
89
|
+
%w[title caption upload_date number_of_likes number_of_plays width height number_of_comments url duration].each do |attribute|
|
86
90
|
instance_variable_set("@#{attribute}", xml_doc.at(attribute).inner_html)
|
87
91
|
end
|
88
|
-
|
92
|
+
|
89
93
|
@owner = User.new
|
90
|
-
%w[id username
|
94
|
+
%w[id username display_name is_plus is_staff profileurl realname username videosurl].each do |attribute|
|
91
95
|
@owner.instance_variable_set("@#{attribute}", xml_doc.at("owner").attributes[attribute])
|
92
96
|
end
|
93
97
|
|
@@ -95,7 +99,7 @@ EOF
|
|
95
99
|
@thumbs << build_thumbnail(thumbnail)
|
96
100
|
end
|
97
101
|
end
|
98
|
-
|
102
|
+
|
99
103
|
# Fetches the comments for the specified Video
|
100
104
|
# id is the id of the Vimeo video
|
101
105
|
# vimeo is an instance of RBVIMEO::Vimeo
|
@@ -107,18 +111,18 @@ EOF
|
|
107
111
|
def get_comments
|
108
112
|
xml_doc = @vimeo.get_xml(@vimeo.generate_url({"method" => "vimeo.videos.comments.getList",
|
109
113
|
"video_id" => @id, "api_key" => @vimeo.api_key}, "read"))
|
110
|
-
|
111
|
-
(xml_doc/:comment).each do |comment|
|
114
|
+
|
115
|
+
(xml_doc/:comment).each do |comment|
|
112
116
|
@comments << build_comment(comment)
|
113
117
|
end
|
114
118
|
return self
|
115
119
|
end
|
116
|
-
|
120
|
+
|
117
121
|
def build_comment(c)
|
118
122
|
comment = Comment.new
|
119
123
|
|
120
124
|
comment.text = c.children.select{|e| e.text?}.join
|
121
|
-
|
125
|
+
|
122
126
|
%w[id author authorname datecreate permalink].each do |attribute|
|
123
127
|
comment.instance_variable_set("@#{attribute}", c.attributes[attribute])
|
124
128
|
end
|
@@ -126,13 +130,13 @@ EOF
|
|
126
130
|
(c/'portraits'/'portrait').each do |portrait|
|
127
131
|
comment.portraits << build_thumbnail(portrait)
|
128
132
|
end
|
129
|
-
|
133
|
+
|
130
134
|
return comment
|
131
135
|
end
|
132
|
-
|
136
|
+
|
133
137
|
def build_thumbnail(t)
|
134
138
|
thumbnail = Thumbnail.new(t.inner_html, t.attributes['width'].to_i, t.attributes['height'].to_i)
|
135
139
|
end
|
136
|
-
|
140
|
+
|
137
141
|
end
|
138
|
-
end
|
142
|
+
end
|
data/lib/rbvimeo/vimeo.rb
CHANGED
@@ -2,7 +2,7 @@ module RBVIMEO
|
|
2
2
|
class Vimeo
|
3
3
|
attr_accessor :api_key, :api_secret
|
4
4
|
|
5
|
-
@@API_REST_URL
|
5
|
+
@@API_REST_URL = "http://www.vimeo.com/api/rest/v2/"
|
6
6
|
@@API_AUTH_URL = "http://www.vimeo.com/services/auth/"
|
7
7
|
@@API_UPLOAD_URL = "http://www.vimeo.com/services/upload/"
|
8
8
|
|
data/rbvimeo.gemspec
ADDED
@@ -0,0 +1,63 @@
|
|
1
|
+
# Generated by jeweler
|
2
|
+
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
|
4
|
+
# -*- encoding: utf-8 -*-
|
5
|
+
|
6
|
+
Gem::Specification.new do |s|
|
7
|
+
s.name = %q{rbvimeo}
|
8
|
+
s.version = "0.3.1"
|
9
|
+
|
10
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
|
+
s.authors = ["Matt Pruitt"]
|
12
|
+
s.date = %q{2010-02-22}
|
13
|
+
s.email = %q{guitsaru@gmail.com}
|
14
|
+
s.extra_rdoc_files = [
|
15
|
+
"LICENSE",
|
16
|
+
"README.textile"
|
17
|
+
]
|
18
|
+
s.files = [
|
19
|
+
".gitignore",
|
20
|
+
"LICENSE",
|
21
|
+
"README.textile",
|
22
|
+
"Rakefile",
|
23
|
+
"VERSION.yml",
|
24
|
+
"lib/rbvimeo.rb",
|
25
|
+
"lib/rbvimeo/comment.rb",
|
26
|
+
"lib/rbvimeo/thumbnail.rb",
|
27
|
+
"lib/rbvimeo/user.rb",
|
28
|
+
"lib/rbvimeo/video.rb",
|
29
|
+
"lib/rbvimeo/vimeo.rb",
|
30
|
+
"rbvimeo.gemspec",
|
31
|
+
"test/XML/339189.comments.xml",
|
32
|
+
"test/XML/339189.xml",
|
33
|
+
"test/XML/not_found.xml",
|
34
|
+
"test/rbvimeo_test.rb",
|
35
|
+
"test/test_helper.rb",
|
36
|
+
"test/video_test.rb"
|
37
|
+
]
|
38
|
+
s.homepage = %q{http://github.com/guitsaru/rbvimeo}
|
39
|
+
s.rdoc_options = ["--charset=UTF-8"]
|
40
|
+
s.require_paths = ["lib"]
|
41
|
+
s.rubyforge_project = %q{rbvimeo}
|
42
|
+
s.rubygems_version = %q{1.3.5}
|
43
|
+
s.summary = %q{A ruby wrapper for the vimeo api.}
|
44
|
+
s.test_files = [
|
45
|
+
"test/rbvimeo_test.rb",
|
46
|
+
"test/test_helper.rb",
|
47
|
+
"test/video_test.rb"
|
48
|
+
]
|
49
|
+
|
50
|
+
if s.respond_to? :specification_version then
|
51
|
+
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
52
|
+
s.specification_version = 3
|
53
|
+
|
54
|
+
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
|
55
|
+
s.add_runtime_dependency(%q<hpricot>, [">= 0.6"])
|
56
|
+
else
|
57
|
+
s.add_dependency(%q<hpricot>, [">= 0.6"])
|
58
|
+
end
|
59
|
+
else
|
60
|
+
s.add_dependency(%q<hpricot>, [">= 0.6"])
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
data/test/XML/339189.xml
CHANGED
@@ -1,28 +1,78 @@
|
|
1
|
-
<?xml version="1.0" encoding="
|
2
|
-
<rsp
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
</
|
22
|
-
<
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
2
|
+
<rsp generated_in="0.1775" stat="ok">
|
3
|
+
<video embed_privacy="anywhere" id="339189" is_hd="1" is_transcoding="0" privacy="anybody">
|
4
|
+
<title>Upload Tutorial</title>
|
5
|
+
<caption>This is a tutorial about our new Uploader. Enjoy!
|
6
|
+
Note- If you have problems uploading post a message here, http://www.vimeo.com/forum:known_issues under problems uploading and we'll help you.
|
7
|
+
</caption>
|
8
|
+
<description>This is a tutorial about our new Uploader. Enjoy!
|
9
|
+
Note- If you have problems uploading post a message here, http://www.vimeo.com/forum:known_issues under problems uploading and we'll help you.
|
10
|
+
</description>
|
11
|
+
<upload_date>2007-10-12 16:30:32</upload_date>
|
12
|
+
<number_of_likes>542</number_of_likes>
|
13
|
+
<number_of_plays>145299</number_of_plays>
|
14
|
+
<number_of_comments>166</number_of_comments>
|
15
|
+
<width>506</width>
|
16
|
+
<height>380</height>
|
17
|
+
<duration>333</duration>
|
18
|
+
<owner display_name="Vimeo Staff" id="152184" is_plus="1" is_staff="1" profileurl="http://vimeo.com/staff" realname="Vimeo Staff" username="staff" videosurl="http://vimeo.com/staff/videos">
|
19
|
+
<portraits>
|
20
|
+
<portrait height="30" width="30">http://30.media.vimeo.com/d1/5/40/55/portrait-4055523.jpg</portrait>
|
21
|
+
<portrait height="75" width="75">http://90.media.vimeo.com/d1/5/40/55/portrait-4055519.jpg</portrait>
|
22
|
+
<portrait height="100" width="100">http://80.media.vimeo.com/d1/5/40/55/portrait-4055518.jpg</portrait>
|
23
|
+
<portrait height="300" width="300">http://40.media.vimeo.com/d1/5/40/55/portrait-4055514.jpg</portrait>
|
24
|
+
</portraits>
|
25
|
+
</owner>
|
26
|
+
<tags>
|
27
|
+
<tag author="152184" id="600358" normalized="vimeo" url="http://vimeo.com/tag:vimeo">vimeo</tag>
|
28
|
+
<tag author="152184" id="600359" normalized="tutorial" url="http://vimeo.com/tag:tutorial">tutorial</tag>
|
29
|
+
<tag author="152184" id="600360" normalized="upload" url="http://vimeo.com/tag:upload">upload</tag>
|
30
|
+
<tag author="152184" id="600361" normalized="uploader" url="http://vimeo.com/tag:uploader">uploader</tag>
|
31
|
+
<tag author="793752" id="3909601" normalized="boatingtips" url="http://vimeo.com/tag:boatingtips">Boating Tips</tag>
|
32
|
+
<tag author="793752" id="3909602" normalized="florida" url="http://vimeo.com/tag:florida">Florida</tag>
|
33
|
+
<tag author="793752" id="3909603" normalized="boatdealer" url="http://vimeo.com/tag:boatdealer">Boat Dealer</tag>
|
34
|
+
<tag author="793752" id="3909604" normalized="yamahamotors" url="http://vimeo.com/tag:yamahamotors">Yamaha Motors</tag>
|
35
|
+
<tag author="793752" id="3909605" normalized="gradywhiteboats" url="http://vimeo.com/tag:gradywhiteboats">Grady White Boats</tag>
|
36
|
+
<tag author="793752" id="3909606" normalized="scoutboats" url="http://vimeo.com/tag:scoutboats">Scout Boats</tag>
|
37
|
+
<tag author="793752" id="3909607" normalized="yamahaservice" url="http://vimeo.com/tag:yamahaservice">Yamaha Service</tag>
|
38
|
+
<tag author="793752" id="3909608" normalized="boatrental" url="http://vimeo.com/tag:boatrental">Boat Rental</tag>
|
39
|
+
<tag author="773100" id="4879093" normalized="ggg" url="http://vimeo.com/tag:ggg">ggg</tag>
|
40
|
+
<tag author="773100" id="4879095" normalized="trv" url="http://vimeo.com/tag:trv">trv</tag>
|
41
|
+
<tag author="773100" id="4879097" normalized="ppwy" url="http://vimeo.com/tag:ppwy">ppwy</tag>
|
42
|
+
<tag author="1256246" id="7321446" normalized="start" url="http://vimeo.com/tag:start">Start</tag>
|
43
|
+
<tag author="1347812" id="8058914" normalized="cortometraje" url="http://vimeo.com/tag:cortometraje">cortometraje</tag>
|
44
|
+
<tag author="1407868" id="8561343" normalized="livemusic" url="http://vimeo.com/tag:livemusic">live music</tag>
|
45
|
+
<tag author="1407868" id="8561346" normalized="tour" url="http://vimeo.com/tag:tour">tour</tag>
|
46
|
+
<tag author="2571689" id="18065912" normalized="video" url="http://vimeo.com/tag:video">video</tag>
|
47
|
+
</tags>
|
48
|
+
<cast>
|
49
|
+
<member display_name="Vimeo Staff" id="152184" role="this is a video about music" username="staff"/>
|
50
|
+
<member display_name="Nick Gray" id="104" role="" username="nickgray"/>
|
51
|
+
<member display_name="adrianmiles" id="109" role="" username="adrianmiles"/>
|
52
|
+
<member display_name="courtwms" id="111" role="" username="courtwms"/>
|
53
|
+
<member display_name="dalas verdugo" id="103" role="" username="dalasv"/>
|
54
|
+
<member display_name="Zach Klein" id="102" role="" username="zach"/>
|
55
|
+
<member display_name="ryanne" id="110" role="" username="ryanne"/>
|
56
|
+
<member display_name="Jake Lodwick" id="101" role="" username="jakob"/>
|
57
|
+
<member display_name="Nick Gray" id="1919203" role="" username="user1919203"/>
|
58
|
+
<member display_name="Nick Gray" id="1061460" role="" username="user1061460"/>
|
59
|
+
<member display_name="Nick Gray" id="572396" role="this is about music" username="user572396"/>
|
60
|
+
<member display_name="nick" id="107879" role="" username="nickanger"/>
|
61
|
+
<member display_name="nick" id="148950" role="" username="user148950"/>
|
62
|
+
<member display_name="Nick" id="194466" role="" username="spiegel"/>
|
63
|
+
<member display_name="Nick" id="211031" role="" username="user211031"/>
|
64
|
+
<member display_name="Antonio Verdugo" id="961704" role="" username="user961704"/>
|
65
|
+
<member display_name="Vartan Simonian" id="1637814" role="" username="user1637814"/>
|
66
|
+
</cast>
|
67
|
+
<urls>
|
68
|
+
<url type="video">http://vimeo.com/339189</url>
|
69
|
+
<url type="mobile">http://vimeo.com/m/#/339189</url>
|
70
|
+
</urls>
|
71
|
+
<thumbnails>
|
72
|
+
<thumbnail height="75" width="100">http://ats.vimeo.com/210/131/21013194_100.jpg</thumbnail>
|
73
|
+
<thumbnail height="150" width="200">http://ats.vimeo.com/210/131/21013194_200.jpg</thumbnail>
|
74
|
+
<thumbnail height="480" width="640">http://ats.vimeo.com/210/131/21013194_640.jpg</thumbnail>
|
75
|
+
<thumbnail height="960" width="1280">http://ats.vimeo.com/210/131/21013194_1280.jpg</thumbnail>
|
76
|
+
</thumbnails>
|
77
|
+
</video>
|
28
78
|
</rsp>
|
data/test/rbvimeo_test.rb
CHANGED
@@ -19,7 +19,7 @@ class RbvimeoTest < Test::Unit::TestCase
|
|
19
19
|
end
|
20
20
|
|
21
21
|
should "generate a url" do
|
22
|
-
assert_equal("http://www.vimeo.com/api/rest
|
22
|
+
assert_equal("http://www.vimeo.com/api/rest/v2/?api_key=#{@api_key}&method=vimeo.videos.getInfo&video_id=339189&api_sig=09cc6d8b963c73caf647e436b2147810", @vimeo.generate_url(@params, "read"))
|
23
23
|
end
|
24
24
|
|
25
25
|
should "generate a video" do
|
data/test/video_test.rb
CHANGED
@@ -8,7 +8,7 @@ class VideoTest < Test::Unit::TestCase
|
|
8
8
|
@vimeo = RBVIMEO::Vimeo.new(@api_key, @api_secret)
|
9
9
|
@params = {"method" => "vimeo.videos.getInfo", "video_id" => "339189", "api_key" => @api_key}
|
10
10
|
end
|
11
|
-
|
11
|
+
|
12
12
|
context "a valid video" do
|
13
13
|
setup do
|
14
14
|
test_video_xml_file = File.join(File.dirname(__FILE__), %w[XML/339189.xml])
|
@@ -22,33 +22,37 @@ class VideoTest < Test::Unit::TestCase
|
|
22
22
|
should "have a title" do
|
23
23
|
assert_equal("Upload Tutorial", @vid.title.chomp)
|
24
24
|
end
|
25
|
-
|
25
|
+
|
26
26
|
should "have a caption" do
|
27
|
-
assert_equal("This is a tutorial about our new Uploader. Enjoy!", @vid.caption.chomp)
|
27
|
+
assert_equal("This is a tutorial about our new Uploader. Enjoy! \nNote- If you have problems uploading post a message here, http://www.vimeo.com/forum:known_issues under problems uploading and we'll help you.", @vid.caption.chomp)
|
28
28
|
end
|
29
|
-
|
29
|
+
|
30
30
|
should "have an upload date" do
|
31
31
|
assert_equal("2007-10-12 16:30:32", @vid.upload_date)
|
32
32
|
end
|
33
|
-
|
33
|
+
|
34
34
|
should "have likes" do
|
35
|
-
assert_equal(
|
36
|
-
assert_equal(
|
35
|
+
assert_equal(542, @vid.likes)
|
36
|
+
assert_equal(542, @vid.number_of_likes)
|
37
37
|
end
|
38
|
-
|
38
|
+
|
39
39
|
should "have plays" do
|
40
|
-
assert_equal(
|
41
|
-
assert_equal(
|
40
|
+
assert_equal(145299, @vid.plays)
|
41
|
+
assert_equal(145299, @vid.number_of_plays)
|
42
|
+
end
|
43
|
+
|
44
|
+
should "have a duration" do
|
45
|
+
assert_equal(333, @vid.duration)
|
42
46
|
end
|
43
|
-
|
47
|
+
|
44
48
|
should "have comments" do
|
45
49
|
test_video_xml_file = File.join(File.dirname(__FILE__), %w[XML/339189.comments.xml])
|
46
50
|
|
47
51
|
comment_hpricot = open(test_video_xml_file) {|file| Hpricot(file)}
|
48
52
|
@vimeo.stubs(:get_xml).returns(comment_hpricot)
|
49
53
|
|
50
|
-
assert_equal(
|
51
|
-
assert_equal(
|
54
|
+
assert_equal(166, @vid.num_comments)
|
55
|
+
assert_equal(166, @vid.number_of_comments)
|
52
56
|
assert_equal(265313, @vid.comments[0].id)
|
53
57
|
assert_equal("ctd3", @vid.comments[0].author)
|
54
58
|
assert_equal("CTD3", @vid.comments[0].authorname)
|
@@ -59,28 +63,28 @@ class VideoTest < Test::Unit::TestCase
|
|
59
63
|
assert_equal(24, @vid.comments[0].portraits[0].width)
|
60
64
|
assert_equal(24, @vid.comments[0].portraits[0].height)
|
61
65
|
end
|
62
|
-
|
66
|
+
|
63
67
|
should "have an owner" do
|
64
68
|
assert_equal(152184, @vid.owner.id)
|
65
69
|
assert_equal("staff", @vid.owner.username)
|
66
70
|
assert_equal("Vimeo Staff", @vid.owner.fullname)
|
67
71
|
end
|
68
|
-
|
72
|
+
|
69
73
|
should "have a url" do
|
70
|
-
assert_equal("http://
|
74
|
+
assert_equal("http://vimeo.com/339189", @vid.url)
|
71
75
|
end
|
72
|
-
|
76
|
+
|
73
77
|
should "have a thumbnail" do
|
74
|
-
assert_equal("http://
|
75
|
-
assert_equal(
|
76
|
-
assert_equal(
|
78
|
+
assert_equal("http://ats.vimeo.com/210/131/21013194_100.jpg", @vid.thumbs[0].url)
|
79
|
+
assert_equal(100, @vid.thumbs[0].width)
|
80
|
+
assert_equal(75, @vid.thumbs[0].height)
|
77
81
|
end
|
78
|
-
|
82
|
+
|
79
83
|
should "have embed code" do
|
80
84
|
assert_not_nil(@vid.embed(240, 480))
|
81
85
|
end
|
82
86
|
end
|
83
|
-
|
87
|
+
|
84
88
|
context "an invalid video" do
|
85
89
|
setup do
|
86
90
|
not_found_xml_file = File.join(File.dirname(__FILE__), %w[XML/not_found.xml])
|
@@ -95,6 +99,6 @@ class VideoTest < Test::Unit::TestCase
|
|
95
99
|
assert_nil(@vid)
|
96
100
|
end
|
97
101
|
end
|
98
|
-
|
102
|
+
|
99
103
|
end
|
100
104
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rbvimeo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matt Pruitt
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date:
|
12
|
+
date: 2010-02-22 00:00:00 -06:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -32,6 +32,7 @@ extra_rdoc_files:
|
|
32
32
|
- LICENSE
|
33
33
|
- README.textile
|
34
34
|
files:
|
35
|
+
- .gitignore
|
35
36
|
- LICENSE
|
36
37
|
- README.textile
|
37
38
|
- Rakefile
|
@@ -42,6 +43,7 @@ files:
|
|
42
43
|
- lib/rbvimeo/user.rb
|
43
44
|
- lib/rbvimeo/video.rb
|
44
45
|
- lib/rbvimeo/vimeo.rb
|
46
|
+
- rbvimeo.gemspec
|
45
47
|
- test/XML/339189.comments.xml
|
46
48
|
- test/XML/339189.xml
|
47
49
|
- test/XML/not_found.xml
|
@@ -50,6 +52,8 @@ files:
|
|
50
52
|
- test/video_test.rb
|
51
53
|
has_rdoc: true
|
52
54
|
homepage: http://github.com/guitsaru/rbvimeo
|
55
|
+
licenses: []
|
56
|
+
|
53
57
|
post_install_message:
|
54
58
|
rdoc_options:
|
55
59
|
- --charset=UTF-8
|
@@ -70,9 +74,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
70
74
|
requirements: []
|
71
75
|
|
72
76
|
rubyforge_project: rbvimeo
|
73
|
-
rubygems_version: 1.3.
|
77
|
+
rubygems_version: 1.3.5
|
74
78
|
signing_key:
|
75
|
-
specification_version:
|
79
|
+
specification_version: 3
|
76
80
|
summary: A ruby wrapper for the vimeo api.
|
77
81
|
test_files:
|
78
82
|
- test/rbvimeo_test.rb
|