vimeo 1.1.0 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.markdown +12 -7
- data/Rakefile +1 -1
- data/VERSION.yml +2 -2
- data/lib/vimeo/advanced/base.rb +7 -7
- data/test/test_helper.rb +1 -1
- data/vimeo.gemspec +7 -7
- metadata +79 -31
data/README.markdown
CHANGED
@@ -114,15 +114,20 @@ First, instantiate the Base class:
|
|
114
114
|
|
115
115
|
base = Vimeo::Advanced::Base.new("consumer_key", "consumer_secret")
|
116
116
|
|
117
|
+
Get a request token, and save the token secret in the session hash.
|
118
|
+
|
119
|
+
request_token = base.get_request_token
|
120
|
+
session[:oauth_secret] = request_token.secret
|
121
|
+
|
117
122
|
Then, send your user to the authorization URL:
|
118
123
|
|
119
124
|
redirect_to base.authorize_url
|
120
125
|
|
121
|
-
Once the user has allowed your application to access their account, they will be redirected to the callback URL you set up for your application. You will be given two parameters `oauth_token` and `oauth_verifier`. Re-instantiate your Base class, then get an access token
|
126
|
+
Once the user has allowed your application to access their account, they will be redirected to the callback URL you set up for your application. You will be given two parameters `oauth_token` and `oauth_verifier`. Re-instantiate your Base class, then get an access token.
|
122
127
|
|
123
128
|
base = Vimeo::Advanced::Base.new("consumer_key", "consumer_secret")
|
124
|
-
access_token = base.get_access_token(params[:oauth_token], params[:oauth_verifier])
|
125
|
-
# You'll want to hold on to the user's token and secret. I'll save it to the database.
|
129
|
+
access_token = base.get_access_token(params[:oauth_token], session[:oauth_secret], params[:oauth_verifier])
|
130
|
+
# You'll want to hold on to the user's access token and secret. I'll save it to the database.
|
126
131
|
user.token = access_token.token
|
127
132
|
user.secret = access_token.secret
|
128
133
|
user.save
|
@@ -301,12 +306,12 @@ __Uploads are not working since the move to OAuth. They will be fixed shortly.__
|
|
301
306
|
|
302
307
|
## Contributors
|
303
308
|
|
304
|
-
*
|
305
|
-
*
|
309
|
+
* [matthooks](http://github.com/matthooks)
|
310
|
+
* [sirlantis](http://github.com/sirlantis)
|
306
311
|
|
307
312
|
## Thanks to
|
308
313
|
|
309
|
-
*
|
310
|
-
*
|
314
|
+
* [HTTParty](http://github.com/jnunemaker/httparty): Easily one of the best tools I have used since I started using Ruby.
|
315
|
+
* [Jeweler](http://github.com/technicalpickles/jeweler): Great tool for creating gems for Github.
|
311
316
|
|
312
317
|
### Copyright (c) 2009 Matt Hooks. See LICENSE for details.
|
data/Rakefile
CHANGED
@@ -11,7 +11,7 @@ begin
|
|
11
11
|
gem.homepage = "http://github.com/matthooks/vimeo"
|
12
12
|
gem.authors = ["Matt Hooks"]
|
13
13
|
gem.rubyforge_project = "vimeo"
|
14
|
-
gem.add_development_dependency "
|
14
|
+
gem.add_development_dependency "shoulda", ">= 2.11.1"
|
15
15
|
gem.add_development_dependency "fakeweb", ">= 1.2.6"
|
16
16
|
gem.add_development_dependency "crack", ">= 0.1.4"
|
17
17
|
|
data/VERSION.yml
CHANGED
data/lib/vimeo/advanced/base.rb
CHANGED
@@ -75,19 +75,19 @@ module Vimeo
|
|
75
75
|
get_request_token.authorize_url :permission => permission
|
76
76
|
end
|
77
77
|
|
78
|
-
def
|
79
|
-
@
|
78
|
+
def get_request_token
|
79
|
+
@request_token ||= @oauth_consumer.get_request_token :scheme => :query_string
|
80
|
+
end
|
81
|
+
|
82
|
+
def get_access_token(oauth_token=nil, oauth_secret=nil, oauth_verifier=nil)
|
83
|
+
@access_token ||= OAuth::RequestToken.new(@oauth_consumer, oauth_token, oauth_secret).get_access_token :oauth_verifier => oauth_verifier
|
80
84
|
end
|
81
85
|
|
82
86
|
# TODO: Move this to OAuth
|
83
87
|
create_api_method :check_access_token,
|
84
88
|
"vimeo.oauth.checkAccessToken"
|
85
89
|
|
86
|
-
|
87
|
-
|
88
|
-
def get_request_token
|
89
|
-
@request_token ||= @oauth_consumer.get_request_token :scheme => :query_string
|
90
|
-
end
|
90
|
+
private
|
91
91
|
|
92
92
|
def make_request(options)
|
93
93
|
response = Crack::JSON.parse @oauth_consumer.request(:post, "http://vimeo.com/api/rest/v2", get_access_token, {}, options).body
|
data/test/test_helper.rb
CHANGED
data/vimeo.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{vimeo}
|
8
|
-
s.version = "1.
|
8
|
+
s.version = "1.2.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{
|
12
|
+
s.date = %q{2010-07-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 = [
|
@@ -187,7 +187,7 @@ Gem::Specification.new do |s|
|
|
187
187
|
s.rdoc_options = ["--main", "README.rdoc", "--inline-source", "--charset=UTF-8"]
|
188
188
|
s.require_paths = ["lib"]
|
189
189
|
s.rubyforge_project = %q{vimeo}
|
190
|
-
s.rubygems_version = %q{1.3.
|
190
|
+
s.rubygems_version = %q{1.3.7}
|
191
191
|
s.summary = %q{A full featured Ruby implementation of the Vimeo API.}
|
192
192
|
s.test_files = [
|
193
193
|
"test/test_helper.rb",
|
@@ -219,15 +219,15 @@ Gem::Specification.new do |s|
|
|
219
219
|
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
220
220
|
s.specification_version = 3
|
221
221
|
|
222
|
-
if Gem::Version.new(Gem::
|
223
|
-
s.add_development_dependency(%q<
|
222
|
+
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
223
|
+
s.add_development_dependency(%q<shoulda>, [">= 2.11.1"])
|
224
224
|
s.add_development_dependency(%q<fakeweb>, [">= 1.2.6"])
|
225
225
|
s.add_development_dependency(%q<crack>, [">= 0.1.4"])
|
226
226
|
s.add_runtime_dependency(%q<httparty>, [">= 0.4.5"])
|
227
227
|
s.add_runtime_dependency(%q<json>, [">= 1.1.9"])
|
228
228
|
s.add_runtime_dependency(%q<oauth>, [">= 0.3.6"])
|
229
229
|
else
|
230
|
-
s.add_dependency(%q<
|
230
|
+
s.add_dependency(%q<shoulda>, [">= 2.11.1"])
|
231
231
|
s.add_dependency(%q<fakeweb>, [">= 1.2.6"])
|
232
232
|
s.add_dependency(%q<crack>, [">= 0.1.4"])
|
233
233
|
s.add_dependency(%q<httparty>, [">= 0.4.5"])
|
@@ -235,7 +235,7 @@ Gem::Specification.new do |s|
|
|
235
235
|
s.add_dependency(%q<oauth>, [">= 0.3.6"])
|
236
236
|
end
|
237
237
|
else
|
238
|
-
s.add_dependency(%q<
|
238
|
+
s.add_dependency(%q<shoulda>, [">= 2.11.1"])
|
239
239
|
s.add_dependency(%q<fakeweb>, [">= 1.2.6"])
|
240
240
|
s.add_dependency(%q<crack>, [">= 0.1.4"])
|
241
241
|
s.add_dependency(%q<httparty>, [">= 0.4.5"])
|
metadata
CHANGED
@@ -1,7 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vimeo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
4
|
+
hash: 31
|
5
|
+
prerelease: false
|
6
|
+
segments:
|
7
|
+
- 1
|
8
|
+
- 2
|
9
|
+
- 0
|
10
|
+
version: 1.2.0
|
5
11
|
platform: ruby
|
6
12
|
authors:
|
7
13
|
- Matt Hooks
|
@@ -9,69 +15,105 @@ autorequire:
|
|
9
15
|
bindir: bin
|
10
16
|
cert_chain: []
|
11
17
|
|
12
|
-
date:
|
18
|
+
date: 2010-07-20 00:00:00 -05:00
|
13
19
|
default_executable:
|
14
20
|
dependencies:
|
15
21
|
- !ruby/object:Gem::Dependency
|
16
|
-
name:
|
17
|
-
|
18
|
-
|
19
|
-
|
22
|
+
name: shoulda
|
23
|
+
prerelease: false
|
24
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
20
26
|
requirements:
|
21
27
|
- - ">="
|
22
28
|
- !ruby/object:Gem::Version
|
23
|
-
|
24
|
-
|
29
|
+
hash: 33
|
30
|
+
segments:
|
31
|
+
- 2
|
32
|
+
- 11
|
33
|
+
- 1
|
34
|
+
version: 2.11.1
|
35
|
+
type: :development
|
36
|
+
version_requirements: *id001
|
25
37
|
- !ruby/object:Gem::Dependency
|
26
38
|
name: fakeweb
|
27
|
-
|
28
|
-
|
29
|
-
|
39
|
+
prerelease: false
|
40
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
30
42
|
requirements:
|
31
43
|
- - ">="
|
32
44
|
- !ruby/object:Gem::Version
|
45
|
+
hash: 19
|
46
|
+
segments:
|
47
|
+
- 1
|
48
|
+
- 2
|
49
|
+
- 6
|
33
50
|
version: 1.2.6
|
34
|
-
|
51
|
+
type: :development
|
52
|
+
version_requirements: *id002
|
35
53
|
- !ruby/object:Gem::Dependency
|
36
54
|
name: crack
|
37
|
-
|
38
|
-
|
39
|
-
|
55
|
+
prerelease: false
|
56
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
40
58
|
requirements:
|
41
59
|
- - ">="
|
42
60
|
- !ruby/object:Gem::Version
|
61
|
+
hash: 19
|
62
|
+
segments:
|
63
|
+
- 0
|
64
|
+
- 1
|
65
|
+
- 4
|
43
66
|
version: 0.1.4
|
44
|
-
|
67
|
+
type: :development
|
68
|
+
version_requirements: *id003
|
45
69
|
- !ruby/object:Gem::Dependency
|
46
70
|
name: httparty
|
47
|
-
|
48
|
-
|
49
|
-
|
71
|
+
prerelease: false
|
72
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
73
|
+
none: false
|
50
74
|
requirements:
|
51
75
|
- - ">="
|
52
76
|
- !ruby/object:Gem::Version
|
77
|
+
hash: 5
|
78
|
+
segments:
|
79
|
+
- 0
|
80
|
+
- 4
|
81
|
+
- 5
|
53
82
|
version: 0.4.5
|
54
|
-
|
83
|
+
type: :runtime
|
84
|
+
version_requirements: *id004
|
55
85
|
- !ruby/object:Gem::Dependency
|
56
86
|
name: json
|
57
|
-
|
58
|
-
|
59
|
-
|
87
|
+
prerelease: false
|
88
|
+
requirement: &id005 !ruby/object:Gem::Requirement
|
89
|
+
none: false
|
60
90
|
requirements:
|
61
91
|
- - ">="
|
62
92
|
- !ruby/object:Gem::Version
|
93
|
+
hash: 1
|
94
|
+
segments:
|
95
|
+
- 1
|
96
|
+
- 1
|
97
|
+
- 9
|
63
98
|
version: 1.1.9
|
64
|
-
|
99
|
+
type: :runtime
|
100
|
+
version_requirements: *id005
|
65
101
|
- !ruby/object:Gem::Dependency
|
66
102
|
name: oauth
|
67
|
-
|
68
|
-
|
69
|
-
|
103
|
+
prerelease: false
|
104
|
+
requirement: &id006 !ruby/object:Gem::Requirement
|
105
|
+
none: false
|
70
106
|
requirements:
|
71
107
|
- - ">="
|
72
108
|
- !ruby/object:Gem::Version
|
109
|
+
hash: 31
|
110
|
+
segments:
|
111
|
+
- 0
|
112
|
+
- 3
|
113
|
+
- 6
|
73
114
|
version: 0.3.6
|
74
|
-
|
115
|
+
type: :runtime
|
116
|
+
version_requirements: *id006
|
75
117
|
description: A full featured Ruby implementation of the Vimeo API.
|
76
118
|
email: matthooks@gmail.com
|
77
119
|
executables: []
|
@@ -260,21 +302,27 @@ rdoc_options:
|
|
260
302
|
require_paths:
|
261
303
|
- lib
|
262
304
|
required_ruby_version: !ruby/object:Gem::Requirement
|
305
|
+
none: false
|
263
306
|
requirements:
|
264
307
|
- - ">="
|
265
308
|
- !ruby/object:Gem::Version
|
309
|
+
hash: 3
|
310
|
+
segments:
|
311
|
+
- 0
|
266
312
|
version: "0"
|
267
|
-
version:
|
268
313
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
314
|
+
none: false
|
269
315
|
requirements:
|
270
316
|
- - ">="
|
271
317
|
- !ruby/object:Gem::Version
|
318
|
+
hash: 3
|
319
|
+
segments:
|
320
|
+
- 0
|
272
321
|
version: "0"
|
273
|
-
version:
|
274
322
|
requirements: []
|
275
323
|
|
276
324
|
rubyforge_project: vimeo
|
277
|
-
rubygems_version: 1.3.
|
325
|
+
rubygems_version: 1.3.7
|
278
326
|
signing_key:
|
279
327
|
specification_version: 3
|
280
328
|
summary: A full featured Ruby implementation of the Vimeo API.
|