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 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
- * {matthooks}[http://github.com/matthooks]
305
- * {sirlantis}[http://github.com/sirlantis]
309
+ * [matthooks](http://github.com/matthooks)
310
+ * [sirlantis](http://github.com/sirlantis)
306
311
 
307
312
  ## Thanks to
308
313
 
309
- * {HTTParty}[http://github.com/jnunemaker/httparty/tree/master]: Easily one of the best tools I have used since I started using Ruby.
310
- * {Jeweler}[http://github.com/technicalpickles/jeweler/tree/master]: Great tool for creating gems for Github.
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 "thoughtbot-shoulda", ">= 2.10.2"
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
@@ -1,5 +1,5 @@
1
1
  ---
2
- :build:
3
2
  :patch: 0
4
3
  :major: 1
5
- :minor: 1
4
+ :build:
5
+ :minor: 2
@@ -75,19 +75,19 @@ module Vimeo
75
75
  get_request_token.authorize_url :permission => permission
76
76
  end
77
77
 
78
- def get_access_token(oauth_token=nil, oauth_verifier=nil)
79
- @access_token ||= get_request_token.get_access_token :oauth_token => oauth_token, :oauth_verifier => oauth_verifier
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
- private
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
@@ -1,7 +1,7 @@
1
1
  require 'rubygems'
2
2
  require 'test/unit'
3
3
 
4
- gem 'thoughtbot-shoulda', ">= 2.10.2"
4
+ gem 'shoulda', ">= 2.11.1"
5
5
  gem 'fakeweb', ">= 1.2.6"
6
6
  gem 'crack', ">= 0.1.4"
7
7
  gem 'mocha', ">= 0.9.8"
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.1.0"
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{2009-12-20}
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.5}
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::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
223
- s.add_development_dependency(%q<thoughtbot-shoulda>, [">= 2.10.2"])
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<thoughtbot-shoulda>, [">= 2.10.2"])
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<thoughtbot-shoulda>, [">= 2.10.2"])
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
- version: 1.1.0
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: 2009-12-20 00:00:00 -06:00
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: thoughtbot-shoulda
17
- type: :development
18
- version_requirement:
19
- version_requirements: !ruby/object:Gem::Requirement
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
- version: 2.10.2
24
- version:
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
- type: :development
28
- version_requirement:
29
- version_requirements: !ruby/object:Gem::Requirement
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
- version:
51
+ type: :development
52
+ version_requirements: *id002
35
53
  - !ruby/object:Gem::Dependency
36
54
  name: crack
37
- type: :development
38
- version_requirement:
39
- version_requirements: !ruby/object:Gem::Requirement
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
- version:
67
+ type: :development
68
+ version_requirements: *id003
45
69
  - !ruby/object:Gem::Dependency
46
70
  name: httparty
47
- type: :runtime
48
- version_requirement:
49
- version_requirements: !ruby/object:Gem::Requirement
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
- version:
83
+ type: :runtime
84
+ version_requirements: *id004
55
85
  - !ruby/object:Gem::Dependency
56
86
  name: json
57
- type: :runtime
58
- version_requirement:
59
- version_requirements: !ruby/object:Gem::Requirement
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
- version:
99
+ type: :runtime
100
+ version_requirements: *id005
65
101
  - !ruby/object:Gem::Dependency
66
102
  name: oauth
67
- type: :runtime
68
- version_requirement:
69
- version_requirements: !ruby/object:Gem::Requirement
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
- version:
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.5
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.