omniauth-vimeo 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1 @@
1
+ .DS_Store
@@ -0,0 +1,21 @@
1
+ # OmniAuth Vimeo
2
+
3
+ This is an OmniAuth strategy for authenticating to Vimeo. To
4
+ use it, you'll need to sign up for an OAuth Application ID and Secret
5
+ on the [Vimeo Applications Page](http://vimeo.com/api/applications).
6
+
7
+ ## Basic Usage
8
+
9
+ use OmniAuth::Builder do
10
+ provider :vimeo, ENV['VIMEO_KEY'], ENV['VIMEO_SECRET']
11
+ end
12
+
13
+ ## License
14
+
15
+ Copyright (c) 2011 Benjamin Fritsch and Lomographische AG.
16
+
17
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
18
+
19
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
20
+
21
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,2 @@
1
+ require "omniauth-vimeo/version"
2
+ require 'omniauth/strategies/vimeo'
@@ -0,0 +1,5 @@
1
+ module Omniauth
2
+ module Vimeo
3
+ VERSION = "0.0.1"
4
+ end
5
+ end
@@ -0,0 +1,40 @@
1
+ require 'omniauth-oauth'
2
+ require 'multi_json'
3
+
4
+ module OmniAuth
5
+ module Strategies
6
+ class Vimeo < OmniAuth::Strategies::OAuth
7
+ option :name, 'vimeo'
8
+ option :client_options, {:site => 'http://vimeo.com' }
9
+
10
+ uid { user['id'] }
11
+
12
+ info do
13
+ {
14
+ 'nickname' => user['username'],
15
+ 'name' => user['display_name'],
16
+ 'location' => user['location'],
17
+ 'description' => user['bio'],
18
+ 'image' => user['portraits']['portrait'].select{|h| h['height'] == '300'}.first['_content'],
19
+ 'urls' => {
20
+ 'website' => user['url'],
21
+ 'vimeo' => user['profileurl']
22
+ }
23
+ }
24
+ end
25
+
26
+ extra do
27
+ { 'user_hash' => user }
28
+ end
29
+
30
+ def user
31
+ user_hash['person']
32
+ end
33
+
34
+ def user_hash
35
+ url = "http://vimeo.com/api/rest/v2?method=vimeo.people.getInfo&format=json"
36
+ @user_hash ||= MultiJson.decode(access_token.get(url).body)
37
+ end
38
+ end
39
+ end
40
+ end
@@ -0,0 +1,22 @@
1
+ # -*- encoding: utf-8 -*-
2
+ $:.push File.expand_path("../lib", __FILE__)
3
+ require "omniauth-vimeo/version"
4
+
5
+ Gem::Specification.new do |gem|
6
+ gem.name = "omniauth-vimeo"
7
+ gem.version = Omniauth::Vimeo::VERSION
8
+ gem.authors = ["Benjamin Fritsch"]
9
+ gem.email = ["ben@lomography.com"]
10
+ gem.homepage = "https://github.com/lomography/omniauth-vimeo"
11
+ gem.description = %q{OmniAuth strategy for Vimeo}
12
+ gem.summary = gem.description
13
+
14
+ gem.files = `git ls-files`.split("\n")
15
+ gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
16
+ gem.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
17
+ gem.require_paths = ["lib"]
18
+
19
+ gem.add_runtime_dependency 'omniauth-oauth', '~> 1.0'
20
+
21
+ gem.required_rubygems_version = Gem::Requirement.new('>= 1.3.6') if gem.respond_to? :required_rubygems_version=
22
+ end
metadata ADDED
@@ -0,0 +1,82 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: omniauth-vimeo
3
+ version: !ruby/object:Gem::Version
4
+ prerelease: false
5
+ segments:
6
+ - 0
7
+ - 0
8
+ - 1
9
+ version: 0.0.1
10
+ platform: ruby
11
+ authors:
12
+ - Benjamin Fritsch
13
+ autorequire:
14
+ bindir: bin
15
+ cert_chain: []
16
+
17
+ date: 2011-11-08 00:00:00 +01:00
18
+ default_executable:
19
+ dependencies:
20
+ - !ruby/object:Gem::Dependency
21
+ name: omniauth-oauth
22
+ prerelease: false
23
+ requirement: &id001 !ruby/object:Gem::Requirement
24
+ requirements:
25
+ - - ~>
26
+ - !ruby/object:Gem::Version
27
+ segments:
28
+ - 1
29
+ - 0
30
+ version: "1.0"
31
+ type: :runtime
32
+ version_requirements: *id001
33
+ description: OmniAuth strategy for Vimeo
34
+ email:
35
+ - ben@lomography.com
36
+ executables: []
37
+
38
+ extensions: []
39
+
40
+ extra_rdoc_files: []
41
+
42
+ files:
43
+ - .gitignore
44
+ - README.md
45
+ - lib/omniauth-vimeo.rb
46
+ - lib/omniauth-vimeo/version.rb
47
+ - lib/omniauth/strategies/vimeo.rb
48
+ - omniauth-vimeo.gemspec
49
+ has_rdoc: true
50
+ homepage: https://github.com/lomography/omniauth-vimeo
51
+ licenses: []
52
+
53
+ post_install_message:
54
+ rdoc_options: []
55
+
56
+ require_paths:
57
+ - lib
58
+ required_ruby_version: !ruby/object:Gem::Requirement
59
+ requirements:
60
+ - - ">="
61
+ - !ruby/object:Gem::Version
62
+ segments:
63
+ - 0
64
+ version: "0"
65
+ required_rubygems_version: !ruby/object:Gem::Requirement
66
+ requirements:
67
+ - - ">="
68
+ - !ruby/object:Gem::Version
69
+ segments:
70
+ - 1
71
+ - 3
72
+ - 6
73
+ version: 1.3.6
74
+ requirements: []
75
+
76
+ rubyforge_project:
77
+ rubygems_version: 1.3.6
78
+ signing_key:
79
+ specification_version: 3
80
+ summary: OmniAuth strategy for Vimeo
81
+ test_files: []
82
+