vimeo 1.0.0 → 1.1.0
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 +2 -1
- data/README.markdown +312 -0
- data/Rakefile +1 -1
- data/VERSION.yml +2 -1
- data/init.rb +2 -0
- data/lib/vimeo.rb +1 -0
- data/lib/vimeo/advanced.rb +0 -1
- data/lib/vimeo/advanced/album.rb +8 -10
- data/lib/vimeo/advanced/base.rb +56 -46
- data/lib/vimeo/advanced/channel.rb +6 -9
- data/lib/vimeo/advanced/contact.rb +2 -3
- data/lib/vimeo/advanced/group.rb +5 -11
- data/lib/vimeo/advanced/person.rb +5 -6
- data/lib/vimeo/advanced/test.rb +7 -24
- data/lib/vimeo/advanced/upload.rb +4 -9
- data/lib/vimeo/advanced/video.rb +14 -15
- data/lib/vimeo/advanced/video_embed.rb +1 -2
- data/test/fixtures/advanced/auth/check_access_token.json +9 -0
- data/test/fixtures/advanced/auth/request_token.txt +1 -0
- data/test/fixtures/advanced/channel/get_all.json +17 -55
- data/test/fixtures/advanced/group/get_all.json +5 -29
- data/test/fixtures/advanced/group/get_info.json +1 -2
- data/test/fixtures/advanced/group_events/get_month.json +3 -8
- data/test/fixtures/advanced/group_events/get_past.json +3 -8
- data/test/fixtures/advanced/group_events/get_upcoming.json +3 -8
- data/test/fixtures/advanced/group_forums/get_topic_comments.json +1 -3
- data/test/fixtures/advanced/person/get_info.json +1 -2
- data/test/fixtures/advanced/video/get_by_tag.json +1 -3
- data/test/fixtures/advanced/video/get_subscriptions.json +3 -7
- data/test/fixtures/advanced/video/search.json +1 -2
- data/test/test_helper.rb +17 -6
- data/test/vimeo/advanced/album_test.rb +54 -67
- data/test/vimeo/advanced/auth_test.rb +17 -25
- data/test/vimeo/advanced/base_test.rb +7 -9
- data/test/vimeo/advanced/channels_test.rb +5 -5
- data/test/vimeo/advanced/contacts_test.rb +1 -1
- data/test/vimeo/advanced/group_events_test.rb +1 -1
- data/test/vimeo/advanced/group_forums_test.rb +1 -1
- data/test/vimeo/advanced/groups_test.rb +4 -4
- data/test/vimeo/advanced/person_test.rb +9 -8
- data/test/vimeo/advanced/test_test.rb +3 -3
- data/test/vimeo/advanced/upload_test.rb +6 -6
- data/test/vimeo/advanced/videos_embed_test.rb +6 -5
- data/test/vimeo/advanced/videos_test.rb +15 -15
- data/vimeo.gemspec +13 -11
- metadata +10 -9
- data/README.rdoc +0 -322
- data/lib/vimeo/advanced/auth.rb +0 -22
@@ -7,17 +7,15 @@ class BaseTest < Test::Unit::TestCase
|
|
7
7
|
setup do
|
8
8
|
@base = Vimeo::Advanced::Base.new("12345", "secret")
|
9
9
|
end
|
10
|
-
|
11
|
-
should "
|
12
|
-
|
13
|
-
|
14
|
-
assert_equal "http://vimeo.com/services/auth/?api_key=12345&perms=delete&api_sig=b1a1a1f87a3a8bd84da1d3d464a72706", link
|
10
|
+
|
11
|
+
should "test something" do
|
12
|
+
# TODO: add tests for authorization_url
|
15
13
|
end
|
16
14
|
|
17
|
-
should "
|
18
|
-
|
19
|
-
|
20
|
-
|
15
|
+
should "allow camel-cased methods" do
|
16
|
+
[:check_access_token, :checkAccessToken].each do |method|
|
17
|
+
@base.send method
|
18
|
+
end
|
21
19
|
end
|
22
20
|
|
23
21
|
end
|
@@ -5,14 +5,14 @@ class ChannelTest < Test::Unit::TestCase
|
|
5
5
|
context "vimeo advanced channel" do
|
6
6
|
|
7
7
|
setup do
|
8
|
-
@channel = Vimeo::Advanced::Channel.new("12345", "secret")
|
8
|
+
@channel = Vimeo::Advanced::Channel.new("12345", "secret", :token => "token", :secret => "secret")
|
9
9
|
end
|
10
10
|
|
11
11
|
# context "making api calls" do
|
12
12
|
|
13
13
|
should "be able to add a video to a channel" do
|
14
14
|
stub_post("?auth_token=token&api_key=12345&api_sig=2065e5d5c0836428a2d2e945d160e504&format=json&method=vimeo.channels.addVideo&channel_id=channel_id&video_id=video_id", "advanced/channel/add_video.json")
|
15
|
-
response = @channel.add_video("
|
15
|
+
response = @channel.add_video("channel_id", "video_id")
|
16
16
|
|
17
17
|
assert_equal "ok", response["stat"]
|
18
18
|
end
|
@@ -54,21 +54,21 @@ class ChannelTest < Test::Unit::TestCase
|
|
54
54
|
|
55
55
|
should "be able to remove a video from a channel" do
|
56
56
|
stub_post("?video_id=video_id&api_key=12345&auth_token=token&format=json&api_sig=0d2fe81099d253f45b25c85033507a6f&method=vimeo.channels.removeVideo&channel_id=channel_id", "advanced/channel/remove_video.json")
|
57
|
-
response = @channel.remove_video("
|
57
|
+
response = @channel.remove_video("channel_id", "video_id")
|
58
58
|
|
59
59
|
assert_equal "ok", response["stat"]
|
60
60
|
end
|
61
61
|
|
62
62
|
should "be able to subscribe a user to a channel" do
|
63
63
|
stub_post("?api_key=12345&auth_token=token&format=json&api_sig=cb0c7a3eed35bdd06b575d734e61b815&method=vimeo.channels.subscribe&channel_id=channel_id", "advanced/channel/subscribe.json")
|
64
|
-
response = @channel.subscribe("
|
64
|
+
response = @channel.subscribe("channel_id")
|
65
65
|
|
66
66
|
assert_equal "ok", response["stat"]
|
67
67
|
end
|
68
68
|
|
69
69
|
should "be able to unsubscribe a user from a channel" do
|
70
70
|
stub_post("?api_key=12345&auth_token=token&format=json&api_sig=a6424de0df3134bf69390c9cb2e1653d&method=vimeo.channels.unsubscribe&channel_id=channel_id", "advanced/channel/unsubscribe.json")
|
71
|
-
response = @channel.unsubscribe("
|
71
|
+
response = @channel.unsubscribe("channel_id")
|
72
72
|
|
73
73
|
assert_equal "ok", response["stat"]
|
74
74
|
end
|
@@ -5,7 +5,7 @@ class ContactTest < Test::Unit::TestCase
|
|
5
5
|
context "vimeo advanced channel" do
|
6
6
|
|
7
7
|
setup do
|
8
|
-
@contact = Vimeo::Advanced::Contact.new("12345", "secret")
|
8
|
+
@contact = Vimeo::Advanced::Contact.new("12345", "secret", :token => "token", :secret => "secret")
|
9
9
|
end
|
10
10
|
|
11
11
|
should "be able to get a list of contacts for a specified user" do
|
@@ -5,7 +5,7 @@ class GroupEventsTest < Test::Unit::TestCase
|
|
5
5
|
context "vimeo advanced group events" do
|
6
6
|
|
7
7
|
setup do
|
8
|
-
@group_events = Vimeo::Advanced::GroupEvents.new("12345", "secret")
|
8
|
+
@group_events = Vimeo::Advanced::GroupEvents.new("12345", "secret", :token => "token", :secret => "secret")
|
9
9
|
end
|
10
10
|
|
11
11
|
should "be able to get a list of events by month" do
|
@@ -5,7 +5,7 @@ class GroupForumsTest < Test::Unit::TestCase
|
|
5
5
|
context "vimeo advanced group events" do
|
6
6
|
|
7
7
|
setup do
|
8
|
-
@group_forums = Vimeo::Advanced::GroupForums.new("12345", "secret")
|
8
|
+
@group_forums = Vimeo::Advanced::GroupForums.new("12345", "secret", :token => "token", :secret => "secret")
|
9
9
|
end
|
10
10
|
|
11
11
|
should "be able to get a list comments for a group forum topic" do
|
@@ -5,12 +5,12 @@ class GroupTest < Test::Unit::TestCase
|
|
5
5
|
context "vimeo advanced group" do
|
6
6
|
|
7
7
|
setup do
|
8
|
-
@group = Vimeo::Advanced::Group.new("12345", "secret")
|
8
|
+
@group = Vimeo::Advanced::Group.new("12345", "secret", :token => "token", :secret => "secret")
|
9
9
|
end
|
10
10
|
|
11
11
|
should "be able to add a video to a group" do
|
12
12
|
stub_post("?video_id=video_id&api_key=12345&auth_token=token&format=json&api_sig=e37ae534be5b03cdc1cb9ed28ed99317&method=vimeo.groups.addVideo&group_id=group_id", "advanced/group/add_video.json")
|
13
|
-
response = @group.add_video("
|
13
|
+
response = @group.add_video("group_id", "video_id")
|
14
14
|
|
15
15
|
assert_equal "ok", response["stat"]
|
16
16
|
end
|
@@ -66,14 +66,14 @@ class GroupTest < Test::Unit::TestCase
|
|
66
66
|
|
67
67
|
should "be able to join a group" do
|
68
68
|
stub_post("?api_key=12345&auth_token=token&format=json&api_sig=99114c85438cb286adbfba05a1b921ed&method=vimeo.groups.join&group_id=group_id", "advanced/group/join.json")
|
69
|
-
response = @group.join("
|
69
|
+
response = @group.join("group_id")
|
70
70
|
|
71
71
|
assert_equal "ok", response["stat"]
|
72
72
|
end
|
73
73
|
|
74
74
|
should "be able to leave a group" do
|
75
75
|
stub_post("?api_key=12345&auth_token=token&format=json&api_sig=a465333190c89f9eedc06a148db018be&method=vimeo.groups.leave&group_id=group_id", "advanced/group/leave.json")
|
76
|
-
response = @group.leave("
|
76
|
+
response = @group.leave("group_id")
|
77
77
|
|
78
78
|
assert_equal "ok", response["stat"]
|
79
79
|
end
|
@@ -5,19 +5,19 @@ class PersonTest < Test::Unit::TestCase
|
|
5
5
|
context "vimeo advanced person" do
|
6
6
|
|
7
7
|
setup do
|
8
|
-
@person = Vimeo::Advanced::Person.new("12345", "secret")
|
8
|
+
@person = Vimeo::Advanced::Person.new("12345", "secret", :token => "token", :secret => "secret")
|
9
9
|
end
|
10
10
|
|
11
11
|
should "be able to add a contact" do
|
12
12
|
stub_post("?api_key=12345&auth_token=token&format=json&api_sig=da78079bb036f66f6ccca31014650371&method=vimeo.people.addContact&user_id=user_id", "advanced/person/add_contact.json")
|
13
|
-
response = @person.add_contact("
|
13
|
+
response = @person.add_contact("user_id")
|
14
14
|
|
15
15
|
assert_equal "ok", response["stat"]
|
16
16
|
end
|
17
17
|
|
18
18
|
should "be able to get add a subscription" do
|
19
19
|
stub_post("?api_key=12345&types=likes&auth_token=token&format=json&api_sig=f02dae35e4eb7a7e2ca0ad9c026ad311&method=vimeo.people.addSubscription&user_id=user_id", "advanced/person/add_subscription.json")
|
20
|
-
response = @person.add_subscription("
|
20
|
+
response = @person.add_subscription("user_id", "likes")
|
21
21
|
|
22
22
|
assert_equal "ok", response["stat"]
|
23
23
|
end
|
@@ -31,9 +31,10 @@ class PersonTest < Test::Unit::TestCase
|
|
31
31
|
|
32
32
|
should "be able to get the remaining number of hd embeds" do
|
33
33
|
stub_post("?api_key=12345&auth_token=token&format=json&api_sig=3ac165886cbfc8dbf0f5a1cbc49c2943&method=vimeo.people.getHDEmbeds", "advanced/person/get_hd_embeds.json")
|
34
|
-
|
35
|
-
|
36
|
-
|
34
|
+
|
35
|
+
assert_raise(Vimeo::Advanced::RequestFailed) do
|
36
|
+
response = @person.get_hd_embeds
|
37
|
+
end
|
37
38
|
end
|
38
39
|
|
39
40
|
should "be able to get a user's info" do
|
@@ -52,14 +53,14 @@ class PersonTest < Test::Unit::TestCase
|
|
52
53
|
|
53
54
|
should "be able to get remove a user from your contacts" do
|
54
55
|
stub_post("?api_key=12345&auth_token=token&format=json&api_sig=0d21943588aae94c65575f4a49e05b63&method=vimeo.people.removeContact&user_id=user_id", "advanced/person/remove_contact.json")
|
55
|
-
response = @person.remove_contact("
|
56
|
+
response = @person.remove_contact("user_id")
|
56
57
|
|
57
58
|
assert_equal "ok", response["stat"]
|
58
59
|
end
|
59
60
|
|
60
61
|
should "be able to remove you from a subscription" do
|
61
62
|
stub_post("?api_key=12345&types=likes&auth_token=token&format=json&api_sig=8f63f6fc9988250db4ff4d92bbb2b9c1&method=vimeo.people.removeSubscription&user_id=user_id", "advanced/person/remove_subscription.json")
|
62
|
-
response = @person.remove_subscription("
|
63
|
+
response = @person.remove_subscription("user_id", "likes")
|
63
64
|
|
64
65
|
assert_equal "ok", response["stat"]
|
65
66
|
end
|
@@ -5,7 +5,7 @@ class TestTest < Test::Unit::TestCase
|
|
5
5
|
context "vimeo advanced test" do
|
6
6
|
|
7
7
|
setup do
|
8
|
-
@test = Vimeo::Advanced::Test.new("12345", "secret")
|
8
|
+
@test = Vimeo::Advanced::Test.new("12345", "secret", :token => "token", :secret => "secret")
|
9
9
|
end
|
10
10
|
|
11
11
|
should "be able to get an echo" do
|
@@ -17,14 +17,14 @@ class TestTest < Test::Unit::TestCase
|
|
17
17
|
|
18
18
|
should "be able to test if a user is logged in" do
|
19
19
|
stub_post("?api_key=12345&auth_token=token&format=json&api_sig=9753d04b7b5b3c47101aace3f314ed84&method=vimeo.test.login", "advanced/test/login.json")
|
20
|
-
response = @test.login
|
20
|
+
response = @test.login
|
21
21
|
|
22
22
|
assert_equal "matthooks", response["user"]["username"]
|
23
23
|
end
|
24
24
|
|
25
25
|
should "be able to ping the Vimeo advanced API" do
|
26
26
|
stub_post("?api_key=12345&auth_token=token&format=json&api_sig=5f45b34d1e7078636f5386b8db7408ee&method=vimeo.test.null", "advanced/test/null.json")
|
27
|
-
response = @test.null
|
27
|
+
response = @test.null
|
28
28
|
|
29
29
|
assert_equal "ok", response["stat"]
|
30
30
|
end
|
@@ -5,26 +5,26 @@ class UploadTest < Test::Unit::TestCase
|
|
5
5
|
context "vimeo advanced upload" do
|
6
6
|
|
7
7
|
setup do
|
8
|
-
@upload = Vimeo::Advanced::Upload.new("12345", "secret")
|
8
|
+
@upload = Vimeo::Advanced::Upload.new("12345", "secret", :token => "token", :secret => "secret")
|
9
9
|
end
|
10
10
|
|
11
11
|
should "be able confirm an upload" do
|
12
12
|
stub_post("?api_key=12345&ticket_id=ticket_id&format=json&auth_token=token&api_sig=576b41966709651aead8754b3c5d370d&method=vimeo.videos.upload.confirm", "advanced/upload/confirm.json")
|
13
|
-
response = @upload.confirm("
|
13
|
+
response = @upload.confirm("ticket_id")
|
14
14
|
|
15
15
|
assert_equal "ticket_id", response["ticket"]["id"]
|
16
16
|
end
|
17
17
|
|
18
18
|
should "be able to get a user's quota" do
|
19
19
|
stub_post("?api_key=12345&auth_token=token&format=json&api_sig=4eb2da55156fca5ab81bfe1a67a016ec&method=vimeo.videos.upload.getQuota", "advanced/upload/get_quota.json")
|
20
|
-
response = @upload.get_quota
|
20
|
+
response = @upload.get_quota
|
21
21
|
|
22
22
|
assert_equal "888046", response["user"]["id"]
|
23
23
|
end
|
24
24
|
|
25
25
|
should "be able to get an upload ticket" do
|
26
26
|
stub_post("?api_key=12345&auth_token=token&format=json&api_sig=0eabe7404e1c1fd22a269190c36e4093&method=vimeo.videos.upload.getTicket", "advanced/upload/get_ticket.json")
|
27
|
-
response = @upload.get_ticket
|
27
|
+
response = @upload.get_ticket
|
28
28
|
|
29
29
|
assert_equal "ticket_id", response["ticket"]["id"]
|
30
30
|
end
|
@@ -33,7 +33,7 @@ class UploadTest < Test::Unit::TestCase
|
|
33
33
|
# should "be able to upload a file to vimeo" do
|
34
34
|
# HTTPClient.any_instance.stubs(:post)
|
35
35
|
# file_path = File.expand_path(File.dirname(__FILE__) + "../../../fixtures/advanced/upload/sample_iTunes.mov")
|
36
|
-
# response = @upload.upload(
|
36
|
+
# response = @upload.upload(file_path, "ticket_id", "http:\/\/67.202.6.15\/upload_multi?ticket_id=ticket_id")
|
37
37
|
#
|
38
38
|
# assert_equal "MD5", response
|
39
39
|
# end
|
@@ -41,7 +41,7 @@ class UploadTest < Test::Unit::TestCase
|
|
41
41
|
# TODO: Make sure this manifest fixture file is right.
|
42
42
|
should "be able to verify a file manifest" do
|
43
43
|
stub_post("?api_key=12345&ticket_id=ticket_id&format=json&auth_token=token&api_sig=3b1c022ba0be09e5901bd91fb5a4426c&method=vimeo.videos.upload.verifyManifest", "advanced/upload/verify_manifest.json")
|
44
|
-
response = @upload.verify_manifest("
|
44
|
+
response = @upload.verify_manifest("ticket_id")
|
45
45
|
|
46
46
|
assert_equal "ticket_id", response["ticket"]["id"]
|
47
47
|
end
|
@@ -5,19 +5,20 @@ class VideoEmbedTest < Test::Unit::TestCase
|
|
5
5
|
context "vimeo advanced video embed" do
|
6
6
|
|
7
7
|
setup do
|
8
|
-
@video_embed = Vimeo::Advanced::VideoEmbed.new("12345", "secret")
|
8
|
+
@video_embed = Vimeo::Advanced::VideoEmbed.new("12345", "secret", :token => "token", :secret => "secret")
|
9
9
|
end
|
10
10
|
|
11
11
|
should "be able to get a list presets for video embeds" do
|
12
12
|
stub_post("?api_key=12345&format=json&method=vimeo.video.embed.getPresets&auth_token=token&api_sig=37baebafad1eafc408b9789e9f0115be", "advanced/video_embed/get_presets.json")
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
|
14
|
+
assert_raise(Vimeo::Advanced::RequestFailed) do
|
15
|
+
response = @video_embed.get_presets
|
16
|
+
end
|
16
17
|
end
|
17
18
|
|
18
19
|
should "be able to set the preset of a video embed" do
|
19
20
|
stub_post("?preset_id=preset_id&video_id=video_id&api_key=12345&format=json&method=vimeo.video.embed.setPreset&auth_token=token&api_sig=116e80503e8273a6b4475b8561c2818b", "advanced/video_embed/set_preset.json")
|
20
|
-
response = @video_embed.set_preset("
|
21
|
+
response = @video_embed.set_preset("video_id", "preset_id")
|
21
22
|
|
22
23
|
assert_equal "ok", response["stat"]
|
23
24
|
end
|
@@ -5,40 +5,40 @@ class VideoTest < Test::Unit::TestCase
|
|
5
5
|
context "vimeo advanced video" do
|
6
6
|
|
7
7
|
setup do
|
8
|
-
@video = Vimeo::Advanced::Video.new("12345", "secret")
|
8
|
+
@video = Vimeo::Advanced::Video.new("12345", "secret", :token => "token", :secret => "secret")
|
9
9
|
end
|
10
10
|
|
11
11
|
should "be able to add cast to a video" do
|
12
12
|
stub_post("?video_id=video_id&api_key=12345&user_id=user_id&format=json&method=vimeo.videos.addCast&auth_token=token&api_sig=d4490b9ebe5914fe2e05756dd6fb1db0", "advanced/video/add_cast.json")
|
13
|
-
response = @video.add_cast("
|
13
|
+
response = @video.add_cast("video_id", "user_id")
|
14
14
|
|
15
15
|
assert_equal "ok", response["stat"]
|
16
16
|
end
|
17
17
|
|
18
18
|
should "be able to add photos to a video" do
|
19
19
|
stub_post("?video_id=video_id&api_key=12345&format=json&method=vimeo.videos.addPhotos&photo_urls=photo_urls&auth_token=token&api_sig=25e09737829e9a0c3a57201ada350b03", "advanced/video/add_photos.json")
|
20
|
-
response = @video.add_photos("
|
20
|
+
response = @video.add_photos("video_id", "photo_urls")
|
21
21
|
|
22
22
|
assert_equal "ok", response["stat"]
|
23
23
|
end
|
24
24
|
|
25
25
|
should "be able to add tags to a video" do
|
26
26
|
stub_post("?video_id=video_id&api_key=12345&format=json&method=vimeo.videos.addTags&auth_token=token&tags=tags&api_sig=9969e062d985a91363630d2003843341", "advanced/video/add_tags.json")
|
27
|
-
response = @video.add_tags("
|
27
|
+
response = @video.add_tags("video_id", "tags")
|
28
28
|
|
29
29
|
assert_equal "ok", response["stat"]
|
30
30
|
end
|
31
31
|
|
32
32
|
should "be able to clear tags from a video" do
|
33
33
|
stub_post("?video_id=video_id&api_key=12345&format=json&method=vimeo.videos.clearTags&auth_token=token&api_sig=b901229a90f9f2d99d82d71da269573f", "advanced/video/clear_tags.json")
|
34
|
-
response = @video.clear_tags("
|
34
|
+
response = @video.clear_tags("video_id")
|
35
35
|
|
36
36
|
assert_equal "ok", response["stat"]
|
37
37
|
end
|
38
38
|
|
39
39
|
should "be able to delete a video" do
|
40
40
|
stub_post("?video_id=video_id&api_key=12345&format=json&method=vimeo.videos.delete&auth_token=token&api_sig=55a6902be853ed835d5f9f359fd66719", "advanced/video/delete.json")
|
41
|
-
response = @video.delete("
|
41
|
+
response = @video.delete("video_id")
|
42
42
|
|
43
43
|
assert_equal "ok", response["stat"]
|
44
44
|
end
|
@@ -122,14 +122,14 @@ class VideoTest < Test::Unit::TestCase
|
|
122
122
|
|
123
123
|
should "be able to remove cast from a video" do
|
124
124
|
stub_post("?video_id=video_id&api_key=12345&user_id=user_id&format=json&method=vimeo.videos.removeCast&auth_token=token&api_sig=31edc8eb16e2bc192d2b04405a7577c5", "advanced/video/remove_cast.json")
|
125
|
-
response = @video.remove_cast("
|
125
|
+
response = @video.remove_cast("video_id", "user_id")
|
126
126
|
|
127
127
|
assert_equal "ok", response["stat"]
|
128
128
|
end
|
129
129
|
|
130
130
|
should "be able to remove a tag from a video" do
|
131
131
|
stub_post("?video_id=video_id&api_key=12345&tag_id=tag_id&format=json&method=vimeo.videos.removeTag&auth_token=token&api_sig=8a0f215d43a6cd5ecdb07525f19323d6", "advanced/video/remove_tag.json")
|
132
|
-
response = @video.remove_tag("
|
132
|
+
response = @video.remove_tag("video_id", "tag_id")
|
133
133
|
|
134
134
|
assert_equal "ok", response["stat"]
|
135
135
|
end
|
@@ -143,28 +143,28 @@ class VideoTest < Test::Unit::TestCase
|
|
143
143
|
|
144
144
|
should "be able to set the description of a video" do
|
145
145
|
stub_post("?video_id=video_id&api_key=12345&format=json&method=vimeo.videos.setDescription&description=description&auth_token=token&api_sig=b80965c8c5f62f006c7d897fc9ce10b2", "advanced/video/set_description.json")
|
146
|
-
response = @video.set_description("
|
146
|
+
response = @video.set_description("video_id", "description")
|
147
147
|
|
148
148
|
assert_equal "ok", response["stat"]
|
149
149
|
end
|
150
150
|
|
151
151
|
should "be able to set the like of a video" do
|
152
152
|
stub_post("?video_id=video_id&api_key=12345&format=json&method=vimeo.videos.setLike&like=like&auth_token=token&api_sig=55d3ad34bc4015cc4b0b8c1bf36ca68e", "advanced/video/set_like.json")
|
153
|
-
response = @video.set_like("
|
153
|
+
response = @video.set_like("video_id", "like")
|
154
154
|
|
155
155
|
assert_equal "ok", response["stat"]
|
156
156
|
end
|
157
157
|
|
158
158
|
should "be able to set the privacy for a video" do
|
159
159
|
stub_post("?privacy=privacy&video_id=video_id&api_key=12345&format=json&method=vimeo.videos.setPrivacy&auth_token=token&api_sig=e34654e6260ca22869a39c0213938e80", "advanced/video/set_privacy.json")
|
160
|
-
response = @video.set_privacy("
|
160
|
+
response = @video.set_privacy("video_id", "privacy")
|
161
161
|
|
162
162
|
assert_equal "ok", response["stat"]
|
163
163
|
end
|
164
164
|
|
165
165
|
should "be able to set the title of a video" do
|
166
166
|
stub_post("?title=title&video_id=video_id&api_key=12345&format=json&method=vimeo.videos.setTitle&auth_token=token&api_sig=164cc69c87f1a460169875493623f9b4", "advanced/video/set_title.json")
|
167
|
-
response = @video.set_title("
|
167
|
+
response = @video.set_title("video_id", "title")
|
168
168
|
|
169
169
|
assert_equal "ok", response["stat"]
|
170
170
|
end
|
@@ -173,21 +173,21 @@ class VideoTest < Test::Unit::TestCase
|
|
173
173
|
|
174
174
|
should "be able to add a comment to a video" do
|
175
175
|
stub_post("?video_id=video_id&api_key=12345&format=json&comment_text=comment_text&method=vimeo.videos.comments.addComment&auth_token=token&api_sig=cd01f8a9ed97bd68a4e1da8be337d9df", "advanced/video/add_comment.json")
|
176
|
-
response = @video.add_comment("
|
176
|
+
response = @video.add_comment("video_id", "comment_text")
|
177
177
|
|
178
178
|
assert_equal "ok", response["stat"]
|
179
179
|
end
|
180
180
|
|
181
181
|
should "be able to delete a comment" do
|
182
182
|
stub_post("?video_id=video_id&api_key=12345&format=json&method=vimeo.videos.comments.deleteComment&auth_token=token&comment_id=comment_id&api_sig=aac80a3b34f94950f4000be7e337f1a8", "advanced/video/delete_comment.json")
|
183
|
-
response = @video.delete_comment("
|
183
|
+
response = @video.delete_comment("video_id", "comment_id")
|
184
184
|
|
185
185
|
assert_equal "ok", response["stat"]
|
186
186
|
end
|
187
187
|
|
188
188
|
should "be able to edit a comment" do
|
189
189
|
stub_post("?video_id=video_id&api_key=12345&format=json&comment_text=comment_text&method=vimeo.videos.comments.editComment&auth_token=token&comment_id=comment_id&api_sig=4f2c2503cd53ead8f1203b55241259c8", "advanced/video/edit_comment.json")
|
190
|
-
response = @video.edit_comment("
|
190
|
+
response = @video.edit_comment("video_id", "comment_id", "comment_text")
|
191
191
|
|
192
192
|
assert_equal "ok", response["stat"]
|
193
193
|
end
|
data/vimeo.gemspec
CHANGED
@@ -1,33 +1,32 @@
|
|
1
1
|
# Generated by jeweler
|
2
|
-
# DO NOT EDIT THIS FILE
|
3
|
-
# Instead, edit Jeweler::Tasks in Rakefile, and run
|
2
|
+
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{vimeo}
|
8
|
-
s.version = "1.
|
8
|
+
s.version = "1.1.0"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Matt Hooks"]
|
12
|
-
s.date = %q{2009-
|
12
|
+
s.date = %q{2009-12-20}
|
13
13
|
s.description = %q{A full featured Ruby implementation of the Vimeo API.}
|
14
14
|
s.email = %q{matthooks@gmail.com}
|
15
15
|
s.extra_rdoc_files = [
|
16
16
|
"CHANGELOG.rdoc",
|
17
|
-
"LICENSE"
|
18
|
-
"README.rdoc"
|
17
|
+
"LICENSE"
|
19
18
|
]
|
20
19
|
s.files = [
|
21
20
|
".gitignore",
|
22
21
|
"CHANGELOG.rdoc",
|
23
22
|
"LICENSE",
|
24
|
-
"README.
|
23
|
+
"README.markdown",
|
25
24
|
"Rakefile",
|
26
25
|
"VERSION.yml",
|
26
|
+
"init.rb",
|
27
27
|
"lib/vimeo.rb",
|
28
28
|
"lib/vimeo/advanced.rb",
|
29
29
|
"lib/vimeo/advanced/album.rb",
|
30
|
-
"lib/vimeo/advanced/auth.rb",
|
31
30
|
"lib/vimeo/advanced/base.rb",
|
32
31
|
"lib/vimeo/advanced/channel.rb",
|
33
32
|
"lib/vimeo/advanced/contact.rb",
|
@@ -56,9 +55,11 @@ Gem::Specification.new do |s|
|
|
56
55
|
"test/fixtures/advanced/album/set_description.json",
|
57
56
|
"test/fixtures/advanced/album/set_password.json",
|
58
57
|
"test/fixtures/advanced/album/set_title.json",
|
58
|
+
"test/fixtures/advanced/auth/check_access_token.json",
|
59
59
|
"test/fixtures/advanced/auth/check_token.json",
|
60
60
|
"test/fixtures/advanced/auth/get_frob.json",
|
61
61
|
"test/fixtures/advanced/auth/get_token.json",
|
62
|
+
"test/fixtures/advanced/auth/request_token.txt",
|
62
63
|
"test/fixtures/advanced/channel/add_video.json",
|
63
64
|
"test/fixtures/advanced/channel/get_all.json",
|
64
65
|
"test/fixtures/advanced/channel/get_info.json",
|
@@ -223,22 +224,23 @@ Gem::Specification.new do |s|
|
|
223
224
|
s.add_development_dependency(%q<fakeweb>, [">= 1.2.6"])
|
224
225
|
s.add_development_dependency(%q<crack>, [">= 0.1.4"])
|
225
226
|
s.add_runtime_dependency(%q<httparty>, [">= 0.4.5"])
|
226
|
-
s.add_runtime_dependency(%q<curb>, [">= 0.5.4.0"])
|
227
227
|
s.add_runtime_dependency(%q<json>, [">= 1.1.9"])
|
228
|
+
s.add_runtime_dependency(%q<oauth>, [">= 0.3.6"])
|
228
229
|
else
|
229
230
|
s.add_dependency(%q<thoughtbot-shoulda>, [">= 2.10.2"])
|
230
231
|
s.add_dependency(%q<fakeweb>, [">= 1.2.6"])
|
231
232
|
s.add_dependency(%q<crack>, [">= 0.1.4"])
|
232
233
|
s.add_dependency(%q<httparty>, [">= 0.4.5"])
|
233
|
-
s.add_dependency(%q<curb>, [">= 0.5.4.0"])
|
234
234
|
s.add_dependency(%q<json>, [">= 1.1.9"])
|
235
|
+
s.add_dependency(%q<oauth>, [">= 0.3.6"])
|
235
236
|
end
|
236
237
|
else
|
237
238
|
s.add_dependency(%q<thoughtbot-shoulda>, [">= 2.10.2"])
|
238
239
|
s.add_dependency(%q<fakeweb>, [">= 1.2.6"])
|
239
240
|
s.add_dependency(%q<crack>, [">= 0.1.4"])
|
240
241
|
s.add_dependency(%q<httparty>, [">= 0.4.5"])
|
241
|
-
s.add_dependency(%q<curb>, [">= 0.5.4.0"])
|
242
242
|
s.add_dependency(%q<json>, [">= 1.1.9"])
|
243
|
+
s.add_dependency(%q<oauth>, [">= 0.3.6"])
|
243
244
|
end
|
244
245
|
end
|
246
|
+
|